From a9585760db6e090e53947f8dbc8ee35fb054f098 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Sat, 9 May 2026 02:43:24 +0000 Subject: [PATCH] Configurations: 'specification/reservations/resource-manager/Microsoft.Capacity/Reservations/tspconfig.yaml', and CommitSHA: '61ef1085014acf8197d8b44e9dec699ef635a750' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6273918 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- eng/versioning/version_client.txt | 2 +- .../CHANGELOG.md | 539 ++++- .../README.md | 14 +- .../SAMPLE.md | 108 +- .../pom.xml | 12 +- .../reservations/ReservationsManager.java | 139 +- .../fluent/CalculateExchangesClient.java | 18 +- .../fluent/CalculateRefundsClient.java | 2 +- .../reservations/fluent/ExchangesClient.java | 18 +- .../reservations/fluent/OperationsClient.java | 10 +- .../fluent/QuotaRequestStatusClient.java | 10 +- .../reservations/fluent/QuotasClient.java | 26 +- .../fluent/ReservationOrdersClient.java | 114 +- .../fluent/ReservationsClient.java | 356 +-- ...java => ReservationsManagementClient.java} | 56 +- .../fluent/ResourceProvidersClient.java | 23 +- .../reservations/fluent/ReturnsClient.java | 2 +- .../models/AppliedReservationsInner.java | 33 +- .../models/AppliedReservationsProperties.java | 30 +- .../models/AvailableScopePropertiesInner.java | 30 +- ...eExchangeOperationResultResponseInner.java | 79 +- .../models/CalculatePriceResponseInner.java | 30 +- .../models/CalculateRefundResponseInner.java | 41 +- .../fluent/models/CatalogInner.java | 39 +- .../models/ChangeDirectoryResponseInner.java | 44 +- .../models/CurrentQuotaLimitBaseInner.java | 30 +- .../ExchangeOperationResultResponseInner.java | 78 +- .../fluent/models/MergeProperties.java | 10 +- .../fluent/models/OperationResponseInner.java | 78 +- .../fluent/models/PatchProperties.java | 16 +- .../models/PurchaseRequestProperties.java | 25 +- .../models/QuotaRequestDetailsInner.java | 64 +- .../fluent/models/QuotaRequestProperties.java | 41 +- .../models/QuotaRequestStatusDetails.java | 99 - .../QuotaRequestSubmitResponse201Inner.java | 154 -- .../fluent/models/RefundResponseInner.java | 125 - .../models/ReservationOrderProperties.java | 165 +- .../models/ReservationOrderResponseInner.java | 246 +- .../models/ReservationResponseInner.java | 117 +- .../SavingsPlanPurchaseRequestProperties.java | 16 +- .../fluent/models/SplitProperties.java | 10 +- .../fluent/models/package-info.java | 6 +- .../reservations/fluent/package-info.java | 6 +- .../AppliedReservationsImpl.java | 2 +- .../AvailableScopePropertiesImpl.java | 2 +- ...teExchangeOperationResultResponseImpl.java | 2 +- .../CalculateExchangesClientImpl.java | 155 +- .../CalculateExchangesImpl.java | 2 +- .../CalculatePriceResponseImpl.java | 2 +- .../CalculateRefundResponseImpl.java | 2 +- .../CalculateRefundsClientImpl.java | 93 +- .../implementation/CalculateRefundsImpl.java | 10 +- .../implementation/CatalogImpl.java | 2 +- .../ChangeDirectoryResponseImpl.java | 2 +- .../CurrentQuotaLimitBaseImpl.java | 7 +- .../ExchangeOperationResultResponseImpl.java | 2 +- .../implementation/ExchangesClientImpl.java | 147 +- .../implementation/ExchangesImpl.java | 2 +- .../implementation/OperationResponseImpl.java | 2 +- .../implementation/OperationsClientImpl.java | 160 +- .../implementation/OperationsImpl.java | 2 +- .../QuotaRequestDetailsImpl.java | 7 +- .../QuotaRequestStatusClientImpl.java | 291 +-- .../QuotaRequestStatusImpl.java | 10 +- .../QuotaRequestSubmitResponse201Impl.java | 49 - .../implementation/QuotasClientImpl.java | 639 ++---- .../implementation/QuotasImpl.java | 2 +- .../implementation/RefundResponseImpl.java | 37 - .../ReservationOrderResponseImpl.java | 2 +- .../ReservationOrdersClientImpl.java | 732 +++--- .../implementation/ReservationOrdersImpl.java | 76 +- .../ReservationResponseImpl.java | 14 +- .../ReservationsClientImpl.java | 2005 ++++++++--------- .../implementation/ReservationsImpl.java | 152 +- ... ReservationsManagementClientBuilder.java} | 42 +- ... => ReservationsManagementClientImpl.java} | 146 +- .../implementation/ResourceManagerUtils.java | 2 +- .../ResourceProvidersClientImpl.java | 301 ++- .../implementation/ResourceProvidersImpl.java | 10 +- .../implementation/ReturnsClientImpl.java | 132 +- .../implementation/ReturnsImpl.java | 2 +- .../models/CatalogsResult.java | 43 +- .../models/OperationList.java | 45 +- .../models/QuotaLimits.java | 54 +- .../models/QuotaRequestDetailsList.java | 54 +- .../models/ReservationList.java | 52 +- .../models/ReservationOrderList.java | 52 +- .../models/ReservationsListResult.java | 36 +- .../implementation/package-info.java | 6 +- .../models/AppliedReservationList.java | 42 +- .../models/AppliedReservations.java | 2 +- .../models/AppliedScopeProperties.java | 10 +- .../reservations/models/AppliedScopeType.java | 8 +- .../models/AvailableScopeProperties.java | 2 +- .../models/AvailableScopeRequest.java | 13 +- .../AvailableScopeRequestProperties.java | 10 +- .../models/BillingInformation.java | 60 +- .../reservations/models/BillingPlan.java | 4 +- ...culateExchangeOperationResultResponse.java | 2 +- ...alculateExchangeOperationResultStatus.java | 10 +- .../models/CalculateExchangeRequest.java | 13 +- .../CalculateExchangeRequestProperties.java | 19 +- .../CalculateExchangeResponseProperties.java | 128 +- .../models/CalculateExchanges.java | 10 +- .../models/CalculatePriceResponse.java | 2 +- .../CalculatePriceResponseProperties.java | 152 +- ...esponsePropertiesBillingCurrencyTotal.java | 38 +- ...esponsePropertiesPricingCurrencyTotal.java | 38 +- .../models/CalculateRefundRequest.java | 13 +- .../CalculateRefundRequestProperties.java | 13 +- .../models/CalculateRefundResponse.java | 2 +- .../reservations/models/CalculateRefunds.java | 2 +- .../reservations/models/Catalog.java | 2 +- .../reservations/models/CatalogMsrp.java | 58 +- .../models/ChangeDirectoryRequest.java | 10 +- .../models/ChangeDirectoryResponse.java | 2 +- .../models/ChangeDirectoryResult.java | 61 +- .../reservations/models/Commitment.java | 11 +- .../reservations/models/CommitmentGrain.java | 4 +- .../models/CurrentQuotaLimitBase.java | 12 +- .../models/ErrorResponseCode.java | 118 +- .../ExchangeOperationResultResponse.java | 2 +- .../models/ExchangeOperationResultStatus.java | 12 +- .../models/ExchangePolicyError.java | 38 +- .../models/ExchangePolicyErrors.java | 30 +- .../reservations/models/ExchangeRequest.java | 13 +- .../models/ExchangeRequestProperties.java | 10 +- .../models/ExchangeResponseProperties.java | 128 +- .../reservations/models/Exchanges.java | 10 +- .../models/ExtendedStatusInfo.java | 38 +- .../models/InstanceFlexibility.java | 6 +- .../reservations/models/MergeRequest.java | 13 +- .../reservations/models/OperationDisplay.java | 60 +- .../models/OperationResponse.java | 2 +- .../models/OperationResultError.java | 40 +- .../reservations/models/OperationStatus.java | 10 +- .../reservations/models/Operations.java | 10 +- .../reservations/models/PatchModel.java | 13 +- .../PatchPropertiesRenewProperties.java | 13 +- .../reservations/models/PaymentDetail.java | 104 +- .../reservations/models/PaymentStatus.java | 10 +- .../reservations/models/Price.java | 10 +- .../models/ProvisioningState.java | 28 +- .../reservations/models/PurchaseRequest.java | 22 +- ...tPropertiesReservedResourceProperties.java | 10 +- .../reservations/models/QuotaProperties.java | 17 +- .../models/QuotaRequestDetails.java | 10 +- .../models/QuotaRequestState.java | 12 +- .../models/QuotaRequestStatus.java | 10 +- .../models/QuotaRequestSubmitResponse201.java | 54 - .../reservations/models/Quotas.java | 10 +- .../reservations/models/QuotasGetHeaders.java | 39 +- .../models/QuotasGetResponse.java | 2 +- .../models/QuotasListHeaders.java | 58 - .../models/QuotasListNextHeaders.java | 58 - .../models/QuotasListNextResponse.java | 38 - .../models/QuotasListResponse.java | 38 - .../models/RefundBillingInformation.java | 93 +- .../models/RefundPolicyError.java | 38 +- .../models/RefundPolicyResult.java | 30 +- .../models/RefundPolicyResultProperty.java | 58 +- .../reservations/models/RefundRequest.java | 13 +- .../models/RefundRequestProperties.java | 13 +- .../reservations/models/RefundResponse.java | 33 - .../models/RefundResponseProperties.java | 94 +- .../models/RenewPropertiesResponse.java | 62 +- ...ropertiesResponseBillingCurrencyTotal.java | 38 +- ...ropertiesResponsePricingCurrencyTotal.java | 38 +- .../models/ReservationBillingPlan.java | 6 +- .../models/ReservationMergeProperties.java | 41 +- ...eservationOrderBillingPlanInformation.java | 67 +- .../models/ReservationOrderResponse.java | 4 +- .../models/ReservationOrders.java | 104 +- .../models/ReservationResponse.java | 18 +- ...Kind.java => ReservationResponseKind.java} | 20 +- .../models/ReservationSplitProperties.java | 40 +- .../models/ReservationStatusCode.java | 22 +- .../models/ReservationSummary.java | 12 +- .../models/ReservationSwapProperties.java | 41 +- .../reservations/models/ReservationTerm.java | 8 +- .../models/ReservationToExchange.java | 66 +- ...eservationToPurchaseCalculateExchange.java | 44 +- .../models/ReservationToPurchaseExchange.java | 78 +- .../models/ReservationToReturn.java | 10 +- .../ReservationToReturnForExchange.java | 77 +- .../ReservationUtilizationAggregates.java | 12 +- .../reservations/models/Reservations.java | 202 +- .../models/ReservationsProperties.java | 367 +-- .../ReservationsPropertiesUtilization.java | 30 +- .../models/ReservedResourceType.java | 57 +- .../reservations/models/ResourceName.java | 10 +- .../models/ResourceProviders.java | 23 +- .../reservations/models/ResourceType.java | 12 +- .../reservations/models/Returns.java | 2 +- .../models/SavingsPlanPurchaseRequest.java | 16 +- .../reservations/models/SavingsPlanTerm.java | 6 +- ...avingsPlanToPurchaseCalculateExchange.java | 44 +- .../models/SavingsPlanToPurchaseExchange.java | 78 +- .../reservations/models/ScopeProperties.java | 38 +- .../reservations/models/SkuCapability.java | 38 +- .../reservations/models/SkuName.java | 10 +- .../reservations/models/SkuProperty.java | 38 +- .../reservations/models/SkuRestriction.java | 50 +- .../reservations/models/SplitRequest.java | 13 +- .../reservations/models/SubRequest.java | 53 +- .../models/SubscriptionScopeProperties.java | 30 +- .../reservations/models/package-info.java | 6 +- .../reservations/package-info.java | 6 +- .../src/main/java/module-info.java | 3 +- ...resourcemanager-reservations_metadata.json | 1 + .../reflect-config.json | 2 +- ...re-resourcemanager-reservations.properties | 1 + .../CalculateExchangePostSamples.java | 5 +- .../generated/CalculateRefundPostSamples.java | 5 +- .../generated/ExchangePostSamples.java | 5 +- .../generated/OperationListSamples.java | 5 +- .../generated/QuotaCreateOrUpdateSamples.java | 11 +- .../generated/QuotaGetSamples.java | 6 +- .../generated/QuotaListSamples.java | 8 +- .../QuotaRequestStatusGetSamples.java | 11 +- .../QuotaRequestStatusListSamples.java | 6 +- .../generated/QuotaUpdateSamples.java | 5 +- .../generated/ReservationArchiveSamples.java | 5 +- .../ReservationAvailableScopesSamples.java | 5 +- .../generated/ReservationGetSamples.java | 6 +- .../generated/ReservationListAllSamples.java | 5 +- .../ReservationListRevisionsSamples.java | 6 +- .../generated/ReservationListSamples.java | 5 +- .../generated/ReservationMergeSamples.java | 5 +- .../ReservationOrderCalculateSamples.java | 5 +- ...eservationOrderChangeDirectorySamples.java | 5 +- .../generated/ReservationOrderGetSamples.java | 8 +- .../ReservationOrderListSamples.java | 6 +- .../ReservationOrderPurchaseSamples.java | 5 +- .../generated/ReservationSplitSamples.java | 5 +- .../ReservationUnarchiveSamples.java | 5 +- .../generated/ReservationUpdateSamples.java | 5 +- ...viderGetAppliedReservationListSamples.java | 6 +- .../ResourceProviderListSamples.java | 5 +- .../generated/ReturnPostSamples.java | 5 +- .../AppliedReservationListTests.java | 19 +- .../AppliedReservationsInnerTests.java | 19 +- .../AppliedReservationsPropertiesTests.java | 20 +- .../AppliedScopePropertiesTests.java | 34 +- .../AvailableScopePropertiesInnerTests.java | 25 +- .../AvailableScopeRequestPropertiesTests.java | 11 +- .../generated/AvailableScopeRequestTests.java | 12 +- ...CalculateRefundRequestPropertiesTests.java | 20 +- .../CalculateRefundRequestTests.java | 26 +- .../ChangeDirectoryRequestTests.java | 10 +- .../ChangeDirectoryResponseInnerTests.java | 53 +- .../generated/ChangeDirectoryResultTests.java | 25 +- .../CurrentQuotaLimitBaseInnerTests.java | 30 +- .../ExchangeRequestPropertiesTests.java | 10 +- .../generated/ExchangeRequestTests.java | 10 +- .../generated/MergePropertiesTests.java | 14 +- .../generated/MergeRequestTests.java | 11 +- .../generated/OperationDisplayTests.java | 25 +- .../generated/OperationListTests.java | 72 +- .../OperationResponseInnerTests.java | 39 +- .../generated/OperationsListMockTests.java | 22 +- .../generated/PatchModelTests.java | 172 +- .../PatchPropertiesRenewPropertiesTests.java | 106 +- .../generated/PatchPropertiesTests.java | 168 +- ...ertiesReservedResourcePropertiesTests.java | 2 +- .../PurchaseRequestPropertiesTests.java | 82 +- .../generated/PurchaseRequestTests.java | 92 +- .../generated/QuotaLimitsTests.java | 42 +- .../generated/QuotaPropertiesTests.java | 30 +- .../QuotaRequestDetailsInnerTests.java | 36 +- .../QuotaRequestDetailsListTests.java | 76 +- .../QuotaRequestPropertiesTests.java | 38 +- .../QuotaRequestStatusDetailsTests.java | 23 - ...RequestStatusGetWithResponseMockTests.java | 16 +- .../QuotaRequestStatusListMockTests.java | 18 +- ...otaRequestSubmitResponse201InnerTests.java | 23 - .../QuotasCreateOrUpdateMockTests.java | 30 +- .../QuotasGetWithResponseMockTests.java | 18 +- .../generated/QuotasListMockTests.java | 18 +- .../RefundRequestPropertiesTests.java | 32 +- .../generated/RefundRequestTests.java | 34 +- .../ReservationMergePropertiesTests.java | 20 +- ...sChangeDirectoryWithResponseMockTests.java | 28 +- .../ReservationSplitPropertiesTests.java | 24 +- .../generated/ReservationSummaryTests.java | 10 +- .../ReservationSwapPropertiesTests.java | 17 +- .../generated/ReservationToReturnTests.java | 18 +- ...ReservationUtilizationAggregatesTests.java | 11 +- ...ervationsArchiveWithResponseMockTests.java | 8 +- .../ReservationsAvailableScopesMockTests.java | 19 +- ...eservationsPropertiesUtilizationTests.java | 13 +- ...vationsUnarchiveWithResponseMockTests.java | 8 +- .../generated/ResourceNameTests.java | 12 +- ...dReservationListWithResponseMockTests.java | 14 +- .../generated/ScopePropertiesTests.java | 16 +- .../generated/SkuCapabilityTests.java | 16 +- .../reservations/generated/SkuNameTests.java | 10 +- .../generated/SkuPropertyTests.java | 18 +- .../generated/SplitPropertiesTests.java | 19 +- .../generated/SplitRequestTests.java | 19 +- .../generated/SubRequestTests.java | 22 +- .../SubscriptionScopePropertiesTests.java | 21 +- .../tsp-location.yaml | 4 + 303 files changed, 4951 insertions(+), 9938 deletions(-) rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/{AzureReservationApi.java => ReservationsManagementClient.java} (92%) delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestStatusDetails.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestSubmitResponse201Inner.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/RefundResponseInner.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestSubmitResponse201Impl.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/RefundResponseImpl.java rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/{AzureReservationApiBuilder.java => ReservationsManagementClientBuilder.java} (65%) rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/{AzureReservationApiImpl.java => ReservationsManagementClientImpl.java} (89%) rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/{ => implementation}/models/CatalogsResult.java (74%) rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/{ => implementation}/models/OperationList.java (71%) rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/{ => implementation}/models/QuotaLimits.java (63%) rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/{ => implementation}/models/QuotaRequestDetailsList.java (65%) rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/{ => implementation}/models/ReservationList.java (67%) rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/{ => implementation}/models/ReservationOrderList.java (67%) rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/{ => implementation}/models/ReservationsListResult.java (79%) delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestSubmitResponse201.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListHeaders.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListNextHeaders.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListNextResponse.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListResponse.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundResponse.java rename sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/{Kind.java => ReservationResponseKind.java} (54%) create mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/resources/META-INF/azure-resourcemanager-reservations_metadata.json create mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/main/resources/azure-resourcemanager-reservations.properties delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusDetailsTests.java delete mode 100644 sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestSubmitResponse201InnerTests.java create mode 100644 sdk/reservations/azure-resourcemanager-reservations/tsp-location.yaml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 9dafd777faae..4c8735fd99ed 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -436,7 +436,7 @@ com.azure.resourcemanager:azure-resourcemanager-servicenetworking;1.1.0;1.2.0-be com.azure.resourcemanager:azure-resourcemanager-recoveryservicessiterecovery;1.3.0;1.4.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-billingbenefits;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-providerhub;2.1.0;2.2.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-reservations;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-reservations;1.0.0;1.1.0 com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.2.0;1.3.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-storagemover;1.4.0;1.5.0 com.azure.resourcemanager:azure-resourcemanager-graphservices;1.1.0;1.2.0-beta.1 diff --git a/sdk/reservations/azure-resourcemanager-reservations/CHANGELOG.md b/sdk/reservations/azure-resourcemanager-reservations/CHANGELOG.md index 14f32088ffdb..176e90e71b43 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/CHANGELOG.md +++ b/sdk/reservations/azure-resourcemanager-reservations/CHANGELOG.md @@ -1,14 +1,545 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0 (2026-05-09) -### Features Added +- Azure Resource Manager Reservations client library for Java. This package contains Microsoft Azure SDK for Reservations Management SDK. Microsoft Azure Quota Resource Provider. Package api-version Quota: 2020-10-25, Reservations: 2022-11-01. 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.QuotasListResponse` was removed -### Other Changes +#### `models.QuotaLimits` was removed + +#### `models.QuotaRequestSubmitResponse201` was removed + +#### `models.ReservationList` was removed + +#### `models.ReservationsListResult` was removed + +#### `models.QuotasListHeaders` was removed + +#### `models.QuotasListNextHeaders` was removed + +#### `models.RefundResponse` was removed + +#### `models.CatalogsResult` was removed + +#### `models.OperationList` was removed + +#### `models.ReservationOrderList` was removed + +#### `models.QuotasListNextResponse` was removed + +#### `models.QuotaRequestDetailsList` was removed + +#### `models.Kind` was removed + +#### `models.ExchangePolicyError` was modified + +* `ExchangePolicyError()` was changed to private access +* `validate()` was removed +* `withCode(java.lang.String)` was removed +* `withMessage(java.lang.String)` was removed + +#### `models.SkuProperty` was modified + +* `SkuProperty()` was changed to private access +* `withName(java.lang.String)` was removed +* `withValue(java.lang.String)` was removed +* `validate()` was removed + +#### `models.MergeRequest` was modified + +* `validate()` was removed + +#### `models.ResourceName` was modified + +* `validate()` was removed + +#### `models.SavingsPlanPurchaseRequest` was modified + +* `validate()` was removed + +#### `models.ExchangeRequestProperties` was modified + +* `validate()` was removed + +#### `models.ChangeDirectoryResult` was modified + +* `ChangeDirectoryResult()` was changed to private access +* `validate()` was removed +* `withId(java.lang.String)` was removed +* `withIsSucceeded(java.lang.Boolean)` was removed +* `withName(java.lang.String)` was removed +* `withError(java.lang.String)` was removed + +#### `models.ReservationSplitProperties` was modified + +* `ReservationSplitProperties()` was changed to private access +* `withSplitSource(java.lang.String)` was removed +* `validate()` was removed +* `withSplitDestinations(java.util.List)` was removed + +#### `models.ExchangeRequest` was modified + +* `validate()` was removed + +#### `models.ReservationSwapProperties` was modified + +* `ReservationSwapProperties()` was changed to private access +* `withSwapSource(java.lang.String)` was removed +* `validate()` was removed +* `withSwapDestination(java.lang.String)` was removed + +#### `models.CalculateRefundRequest` was modified + +* `validate()` was removed + +#### `models.CalculateExchangeResponseProperties` was modified + +* `CalculateExchangeResponseProperties()` was changed to private access +* `validate()` was removed +* `withNetPayable(models.Price)` was removed +* `withReservationsToPurchase(java.util.List)` was removed +* `withPurchasesTotal(models.Price)` was removed +* `withRefundsTotal(models.Price)` was removed +* `withSavingsPlansToPurchase(java.util.List)` was removed +* `withSessionId(java.lang.String)` was removed +* `withPolicyResult(models.ExchangePolicyErrors)` was removed +* `withReservationsToExchange(java.util.List)` was removed + +#### `models.ReservationSummary` was modified + +* `ReservationSummary()` was changed to private access +* `validate()` was removed + +#### `models.ReservationOrderBillingPlanInformation` was modified + +* `ReservationOrderBillingPlanInformation()` was changed to private access +* `withPricingCurrencyTotal(models.Price)` was removed +* `withTransactions(java.util.List)` was removed +* `withNextPaymentDueDate(java.time.LocalDate)` was removed +* `withStartDate(java.time.LocalDate)` was removed +* `validate()` was removed + +#### `models.ReservationUtilizationAggregates` was modified + +* `ReservationUtilizationAggregates()` was changed to private access +* `validate()` was removed + +#### `models.PatchPropertiesRenewProperties` was modified + +* `validate()` was removed + +#### `models.SubRequest` was modified + +* `SubRequest()` was changed to private access +* `withUnit(java.lang.String)` was removed +* `validate()` was removed +* `withName(models.ResourceName)` was removed +* `withProvisioningState(models.QuotaRequestState)` was removed + +#### `models.SkuRestriction` was modified + +* `SkuRestriction()` was changed to private access +* `validate()` was removed +* `withReasonCode(java.lang.String)` was removed +* `withValues(java.util.List)` was removed +* `withType(java.lang.String)` was removed + +#### `models.CalculateExchangeRequestProperties` was modified + +* `validate()` was removed + +#### `models.RefundPolicyError` was modified + +* `RefundPolicyError()` was changed to private access +* `withCode(models.ErrorResponseCode)` was removed +* `withMessage(java.lang.String)` was removed +* `validate()` was removed + +#### `models.ExchangeResponseProperties` was modified + +* `ExchangeResponseProperties()` was changed to private access +* `withPurchasesTotal(models.Price)` was removed +* `withSavingsPlansToPurchase(java.util.List)` was removed +* `withSessionId(java.lang.String)` was removed +* `withPolicyResult(models.ExchangePolicyErrors)` was removed +* `withNetPayable(models.Price)` was removed +* `withRefundsTotal(models.Price)` was removed +* `withReservationsToPurchase(java.util.List)` was removed +* `validate()` was removed +* `withReservationsToExchange(java.util.List)` was removed + +#### `models.RefundBillingInformation` was modified + +* `RefundBillingInformation()` was changed to private access +* `validate()` was removed +* `withBillingCurrencyProratedAmount(models.Price)` was removed +* `withBillingPlan(models.ReservationBillingPlan)` was removed +* `withCompletedTransactions(java.lang.Integer)` was removed +* `withTotalTransactions(java.lang.Integer)` was removed +* `withBillingCurrencyRemainingCommitmentAmount(models.Price)` was removed +* `withBillingCurrencyTotalPaidAmount(models.Price)` was removed + +#### `models.ExchangePolicyErrors` was modified + +* `ExchangePolicyErrors()` was changed to private access +* `withPolicyErrors(java.util.List)` was removed +* `validate()` was removed + +#### `models.ReservationMergeProperties` was modified + +* `ReservationMergeProperties()` was changed to private access +* `withMergeSources(java.util.List)` was removed +* `withMergeDestination(java.lang.String)` was removed +* `validate()` was removed + +#### `models.PurchaseRequestPropertiesReservedResourceProperties` was modified + +* `validate()` was removed + +#### `models.SavingsPlanToPurchaseExchange` was modified + +* `SavingsPlanToPurchaseExchange()` was changed to private access +* `validate()` was removed +* `withSavingsPlanId(java.lang.String)` was removed +* `withBillingCurrencyTotal(models.Price)` was removed +* `withSavingsPlanOrderId(java.lang.String)` was removed +* `withProperties(models.SavingsPlanPurchaseRequest)` was removed +* `withStatus(models.OperationStatus)` was removed + +#### `models.SplitRequest` was modified + +* `validate()` was removed + +#### `models.AvailableScopeRequest` was modified + +* `validate()` was removed + +#### `models.SavingsPlanToPurchaseCalculateExchange` was modified + +* `SavingsPlanToPurchaseCalculateExchange()` was changed to private access +* `validate()` was removed +* `withProperties(models.SavingsPlanPurchaseRequest)` was removed +* `withBillingCurrencyTotal(models.Price)` was removed + +#### `models.RefundRequest` was modified + +* `validate()` was removed + +#### `models.CalculateExchangeRequest` was modified + +* `validate()` was removed + +#### `models.RefundResponseProperties` was modified + +* `RefundResponseProperties()` was changed to private access +* `withSessionId(java.lang.String)` was removed +* `validate()` was removed +* `withPolicyResult(models.RefundPolicyResult)` was removed +* `withPricingRefundAmount(models.Price)` was removed +* `withBillingInformation(models.RefundBillingInformation)` was removed +* `withBillingRefundAmount(models.Price)` was removed +* `withQuantity(java.lang.Integer)` was removed + +#### `models.CatalogMsrp` was modified + +* `CatalogMsrp()` was changed to private access +* `validate()` was removed +* `withP3Y(models.Price)` was removed +* `withP5Y(models.Price)` was removed +* `withP1Y(models.Price)` was removed + +#### `models.ReservationToExchange` was modified + +* `ReservationToExchange()` was changed to private access +* `withBillingInformation(models.BillingInformation)` was removed +* `withQuantity(java.lang.Integer)` was removed +* `withReservationId(java.lang.String)` was removed +* `validate()` was removed +* `withBillingRefundAmount(models.Price)` was removed + +#### `models.RefundPolicyResult` was modified + +* `RefundPolicyResult()` was changed to private access +* `withProperties(models.RefundPolicyResultProperty)` was removed +* `validate()` was removed + +#### `models.QuotaProperties` was modified + +* `validate()` was removed + +#### `models.Price` was modified + +* `validate()` was removed + +#### `ReservationsManager` was modified + +* `fluent.AzureReservationApi serviceClient()` -> `fluent.ReservationsManagementClient serviceClient()` + +#### `models.ReservationToReturnForExchange` was modified + +* `ReservationToReturnForExchange()` was changed to private access +* `withBillingRefundAmount(models.Price)` was removed +* `validate()` was removed +* `withReservationId(java.lang.String)` was removed +* `withStatus(models.OperationStatus)` was removed +* `withQuantity(java.lang.Integer)` was removed +* `withBillingInformation(models.BillingInformation)` was removed + +#### `models.CalculatePriceResponseProperties` was modified + +* `CalculatePriceResponseProperties()` was changed to private access +* `withGrandTotal(java.lang.Double)` was removed +* `withPricingCurrencyTotal(models.CalculatePriceResponsePropertiesPricingCurrencyTotal)` was removed +* `validate()` was removed +* `withNetTotal(java.lang.Double)` was removed +* `withSkuTitle(java.lang.String)` was removed +* `withReservationOrderId(java.lang.String)` was removed +* `withPaymentSchedule(java.util.List)` was removed +* `withTaxTotal(java.lang.Double)` was removed +* `withIsBillingPartnerManaged(java.lang.Boolean)` was removed +* `withSkuDescription(java.lang.String)` was removed +* `withBillingCurrencyTotal(models.CalculatePriceResponsePropertiesBillingCurrencyTotal)` was removed +* `withIsTaxIncluded(java.lang.Boolean)` was removed + +#### `models.ReservationsProperties` was modified + +* `ReservationsProperties()` was changed to private access +* `withQuantity(java.lang.Integer)` was removed +* `withRenewProperties(models.RenewPropertiesResponse)` was removed +* `validate()` was removed +* `withPurchaseDateTime(java.time.OffsetDateTime)` was removed +* `withTerm(models.ReservationTerm)` was removed +* `withRenewDestination(java.lang.String)` was removed +* `withSplitProperties(models.ReservationSplitProperties)` was removed +* `withExtendedStatusInfo(models.ExtendedStatusInfo)` was removed +* `withReviewDateTime(java.time.OffsetDateTime)` was removed +* `withExpiryDate(java.time.LocalDate)` was removed +* `withBillingScopeId(java.lang.String)` was removed +* `withRenewSource(java.lang.String)` was removed +* `withInstanceFlexibility(models.InstanceFlexibility)` was removed +* `withAppliedScopeType(models.AppliedScopeType)` was removed +* `withBenefitStartTime(java.time.OffsetDateTime)` was removed +* `withPurchaseDate(java.time.LocalDate)` was removed +* `withSkuDescription(java.lang.String)` was removed +* `withRenew(java.lang.Boolean)` was removed +* `withAppliedScopes(java.util.List)` was removed +* `withProvisioningState(models.ProvisioningState)` was removed +* `withSwapProperties(models.ReservationSwapProperties)` was removed +* `withExpiryDateTime(java.time.OffsetDateTime)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withArchived(java.lang.Boolean)` was removed +* `withCapabilities(java.lang.String)` was removed +* `withBillingPlan(models.ReservationBillingPlan)` was removed +* `withReservedResourceType(models.ReservedResourceType)` was removed +* `withMergeProperties(models.ReservationMergeProperties)` was removed +* `withAppliedScopeProperties(models.AppliedScopeProperties)` was removed +* `withEffectiveDateTime(java.time.OffsetDateTime)` was removed + +#### `models.QuotasGetHeaders` was modified + +* `etag()` was removed +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.PurchaseRequest` was modified + +* `validate()` was removed + +#### `models.RenewPropertiesResponse` was modified + +* `RenewPropertiesResponse()` was changed to private access +* `validate()` was removed +* `withBillingCurrencyTotal(models.RenewPropertiesResponseBillingCurrencyTotal)` was removed +* `withPricingCurrencyTotal(models.RenewPropertiesResponsePricingCurrencyTotal)` was removed +* `withPurchaseProperties(models.PurchaseRequest)` was removed + +#### `models.PaymentDetail` was modified + +* `PaymentDetail()` was changed to private access +* `withPaymentDate(java.time.LocalDate)` was removed +* `withDueDate(java.time.LocalDate)` was removed +* `withBillingAccount(java.lang.String)` was removed +* `validate()` was removed +* `withPricingCurrencyTotal(models.Price)` was removed +* `withExtendedStatusInfo(models.ExtendedStatusInfo)` was removed +* `withStatus(models.PaymentStatus)` was removed +* `withBillingCurrencyTotal(models.Price)` was removed + +#### `models.SkuCapability` was modified + +* `SkuCapability()` was changed to private access +* `validate()` was removed +* `withValue(java.lang.String)` was removed +* `withName(java.lang.String)` was removed + +#### `models.ChangeDirectoryRequest` was modified + +* `validate()` was removed + +#### `models.AvailableScopeRequestProperties` was modified + +* `validate()` was removed + +#### `models.ScopeProperties` was modified + +* `ScopeProperties()` was changed to private access +* `withScope(java.lang.String)` was removed +* `validate()` was removed +* `withValid(java.lang.Boolean)` was removed + +#### `models.OperationResultError` was modified + +* `OperationResultError()` was changed to private access +* `validate()` was removed +* `withCode(java.lang.String)` was removed +* `withMessage(java.lang.String)` was removed + +#### `models.RenewPropertiesResponsePricingCurrencyTotal` was modified + +* `RenewPropertiesResponsePricingCurrencyTotal()` was changed to private access +* `withAmount(java.lang.Float)` was removed +* `validate()` was removed +* `withCurrencyCode(java.lang.String)` was removed + +#### `models.RefundPolicyResultProperty` was modified + +* `RefundPolicyResultProperty()` was changed to private access +* `withMaxRefundLimit(models.Price)` was removed +* `withConsumedRefundsTotal(models.Price)` was removed +* `validate()` was removed +* `withPolicyErrors(java.util.List)` was removed + +#### `models.CalculatePriceResponsePropertiesBillingCurrencyTotal` was modified + +* `CalculatePriceResponsePropertiesBillingCurrencyTotal()` was changed to private access +* `validate()` was removed +* `withAmount(java.lang.Double)` was removed +* `withCurrencyCode(java.lang.String)` was removed + +#### `models.RefundRequestProperties` was modified + +* `validate()` was removed + +#### `models.ReservationToPurchaseCalculateExchange` was modified + +* `ReservationToPurchaseCalculateExchange()` was changed to private access +* `validate()` was removed +* `withProperties(models.PurchaseRequest)` was removed +* `withBillingCurrencyTotal(models.Price)` was removed + +#### `models.SubscriptionScopeProperties` was modified + +* `SubscriptionScopeProperties()` was changed to private access +* `withScopes(java.util.List)` was removed +* `validate()` was removed + +#### `models.PatchModel` was modified + +* `validate()` was removed + +#### `models.BillingInformation` was modified + +* `BillingInformation()` was changed to private access +* `withBillingCurrencyProratedAmount(models.Price)` was removed +* `withBillingCurrencyRemainingCommitmentAmount(models.Price)` was removed +* `withBillingCurrencyTotalPaidAmount(models.Price)` was removed +* `validate()` was removed + +#### `models.ExtendedStatusInfo` was modified + +* `ExtendedStatusInfo()` was changed to private access +* `withStatusCode(models.ReservationStatusCode)` was removed +* `validate()` was removed +* `withMessage(java.lang.String)` was removed + +#### `models.ReservationResponse` was modified + +* `models.Kind kind()` -> `models.ReservationResponseKind kind()` + +#### `models.CalculateRefundRequestProperties` was modified + +* `validate()` was removed + +#### `models.ReservationsPropertiesUtilization` was modified + +* `ReservationsPropertiesUtilization()` was changed to private access +* `withAggregates(java.util.List)` was removed +* `validate()` was removed + +#### `models.SkuName` was modified + +* `validate()` was removed + +#### `models.ReservationToPurchaseExchange` was modified + +* `ReservationToPurchaseExchange()` was changed to private access +* `withBillingCurrencyTotal(models.Price)` was removed +* `validate()` was removed +* `withProperties(models.PurchaseRequest)` was removed +* `withStatus(models.OperationStatus)` was removed +* `withReservationOrderId(java.lang.String)` was removed +* `withReservationId(java.lang.String)` was removed + +#### `models.ReservationToReturn` was modified + +* `validate()` was removed + +#### `models.AppliedScopeProperties` was modified + +* `validate()` was removed + +#### `models.AppliedReservationList` was modified + +* `AppliedReservationList()` was changed to private access +* `withNextLink(java.lang.String)` was removed +* `withValue(java.util.List)` was removed +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `withDescription(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed +* `validate()` was removed + +#### `models.CalculatePriceResponsePropertiesPricingCurrencyTotal` was modified + +* `CalculatePriceResponsePropertiesPricingCurrencyTotal()` was changed to private access +* `validate()` was removed +* `withCurrencyCode(java.lang.String)` was removed +* `withAmount(java.lang.Float)` was removed + +#### `models.RenewPropertiesResponseBillingCurrencyTotal` was modified + +* `RenewPropertiesResponseBillingCurrencyTotal()` was changed to private access +* `withAmount(java.lang.Float)` was removed +* `withCurrencyCode(java.lang.String)` was removed +* `validate()` was removed + +#### `models.Commitment` was modified + +* `validate()` was removed + +### Features Added + +* `models.ReservationResponseKind` was added + +#### `models.QuotaRequestDetails` was modified + +* `systemData()` was added + +#### `models.CurrentQuotaLimitBase` was modified + +* `systemData()` was added + +#### `models.QuotasGetHeaders` was modified + +* `eTag()` was added ## 1.0.0 (2024-12-25) diff --git a/sdk/reservations/azure-resourcemanager-reservations/README.md b/sdk/reservations/azure-resourcemanager-reservations/README.md index c157d4c20e95..d058dbe2c515 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/README.md +++ b/sdk/reservations/azure-resourcemanager-reservations/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager reservations client library for Java +# Azure Resource Manager Reservations client library for Java -Azure Resource Manager reservations client library for Java. +Azure Resource Manager Reservations client library for Java. -This package contains Microsoft Azure SDK for reservations Management SDK. This API describe Azure Reservation. Package tag package-2022-11. 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 Reservations Management SDK. Microsoft Azure Quota Resource Provider. Package api-version Quota: 2020-10-25, Reservations: 2022-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-reservations - 1.1.0-beta.1 + 1.1.0 ``` [//]: # ({x-version-update-end}) @@ -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 @@ ReservationsManager manager = ReservationsManager .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/reservations/azure-resourcemanager-reservations/SAMPLE.md b/sdk/reservations/azure-resourcemanager-reservations/SAMPLE.md index 1f8329932c97..cd2f37bbfccb 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/SAMPLE.md +++ b/sdk/reservations/azure-resourcemanager-reservations/SAMPLE.md @@ -84,8 +84,7 @@ import java.util.Arrays; */ public final class CalculateExchangePostSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateExchange.json + * x-ms-original-file: 2022-11-01/CalculateExchange.json */ /** * Sample code: CalculateExchange. @@ -139,8 +138,7 @@ import com.azure.resourcemanager.reservations.models.ReservationToReturn; */ public final class CalculateRefundPostSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateRefund.json + * x-ms-original-file: 2022-11-01/CalculateRefund.json */ /** * Sample code: CalculateRefund. @@ -171,8 +169,7 @@ import com.azure.resourcemanager.reservations.models.ExchangeRequestProperties; */ public final class ExchangePostSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Exchange.json + * x-ms-original-file: 2022-11-01/Exchange.json */ /** * Sample code: Exchange. @@ -197,8 +194,7 @@ public final class ExchangePostSamples { */ public final class OperationListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetOperations.json + * x-ms-original-file: 2022-11-01/GetOperations.json */ /** * Sample code: GetOperations. @@ -223,8 +219,7 @@ import com.azure.resourcemanager.reservations.models.ResourceType; */ public final class QuotaCreateOrUpdateSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * putMachineLearningServicesQuotaRequestDedicated.json + * x-ms-original-file: 2020-10-25/putMachineLearningServicesQuotaRequestDedicated.json */ /** * Sample code: Quotas_Request_PutForMachineLearningServices_DedicatedResource. @@ -244,8 +239,7 @@ public final class QuotaCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * putMachineLearningServicesQuotaRequestLowPriority.json + * x-ms-original-file: 2020-10-25/putMachineLearningServicesQuotaRequestLowPriority.json */ /** * Sample code: Quotas_Request_PutForMachineLearningServices_LowPriorityResource. @@ -265,8 +259,7 @@ public final class QuotaCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * putComputeOneSkuQuotaRequest.json + * x-ms-original-file: 2020-10-25/putComputeOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Request_PutForCompute. @@ -293,9 +286,7 @@ public final class QuotaCreateOrUpdateSamples { */ public final class QuotaGetSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getComputeOneSkuUsages. - * json + * x-ms-original-file: 2020-10-25/getComputeOneSkuUsages.json */ /** * Sample code: Quotas_Request_ForCompute. @@ -318,8 +309,7 @@ public final class QuotaGetSamples { */ public final class QuotaListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getComputeUsages.json + * x-ms-original-file: 2020-10-25/getComputeUsages.json */ /** * Sample code: Quotas_listUsagesForCompute. @@ -333,8 +323,7 @@ public final class QuotaListSamples { } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * getMachineLearningServicesUsages.json + * x-ms-original-file: 2020-10-25/getMachineLearningServicesUsages.json */ /** * Sample code: Quotas_listUsagesMachineLearningServices. @@ -362,8 +351,7 @@ import com.azure.resourcemanager.reservations.models.ResourceName; */ public final class QuotaUpdateSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * patchComputeQuotaRequest.json + * x-ms-original-file: 2020-10-25/patchComputeQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForCompute. @@ -393,8 +381,7 @@ public final class QuotaUpdateSamples { */ public final class QuotaRequestStatusGetSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * getQuotaRequestStatusFailed.json + * x-ms-original-file: 2020-10-25/getQuotaRequestStatusFailed.json */ /** * Sample code: QuotaRequestFailed. @@ -408,8 +395,7 @@ public final class QuotaRequestStatusGetSamples { } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * getQuotaRequestStatusById.json + * x-ms-original-file: 2020-10-25/getQuotaRequestStatusById.json */ /** * Sample code: QuotaRequestStatus. @@ -423,8 +409,7 @@ public final class QuotaRequestStatusGetSamples { } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * getQuotaRequestStatusInProgress.json + * x-ms-original-file: 2020-10-25/getQuotaRequestStatusInProgress.json */ /** * Sample code: QuotaRequestInProgress. @@ -447,9 +432,7 @@ public final class QuotaRequestStatusGetSamples { */ public final class QuotaRequestStatusListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestsHistory - * .json + * x-ms-original-file: 2020-10-25/getQuotaRequestsHistory.json */ /** * Sample code: QuotaRequestHistory. @@ -472,8 +455,7 @@ public final class QuotaRequestStatusListSamples { */ public final class ReservationArchiveSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Archive.json + * x-ms-original-file: 2022-11-01/Archive.json */ /** * Sample code: Archive. @@ -500,8 +482,7 @@ import java.util.Arrays; */ public final class ReservationAvailableScopesSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetAvailableScope.json + * x-ms-original-file: 2022-11-01/GetAvailableScope.json */ /** * Sample code: AvailableScopes. @@ -526,9 +507,7 @@ public final class ReservationAvailableScopesSamples { */ public final class ReservationGetSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationDetails. - * json + * x-ms-original-file: 2022-11-01/GetReservationDetails.json */ /** * Sample code: GetReservation. @@ -551,8 +530,7 @@ public final class ReservationGetSamples { */ public final class ReservationListSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * GetReservationsFromOrder.json + * x-ms-original-file: 2022-11-01/GetReservationsFromOrder.json */ /** * Sample code: ReservationList. @@ -573,8 +551,7 @@ public final class ReservationListSamples { */ public final class ReservationListAllSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservations.json + * x-ms-original-file: 2022-11-01/GetReservations.json */ /** * Sample code: ReservationListAll. @@ -597,9 +574,7 @@ public final class ReservationListAllSamples { */ public final class ReservationListRevisionsSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationRevisions - * .json + * x-ms-original-file: 2022-11-01/GetReservationRevisions.json */ /** * Sample code: ReservationRevisions. @@ -625,8 +600,7 @@ import java.util.Arrays; */ public final class ReservationMergeSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/MergeReservations.json + * x-ms-original-file: 2022-11-01/MergeReservations.json */ /** * Sample code: Merge. @@ -654,8 +628,7 @@ import java.util.Arrays; */ public final class ReservationSplitSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/SplitReservation.json + * x-ms-original-file: 2022-11-01/SplitReservation.json */ /** * Sample code: Split. @@ -680,8 +653,7 @@ public final class ReservationSplitSamples { */ public final class ReservationUnarchiveSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Unarchive.json + * x-ms-original-file: 2022-11-01/Unarchive.json */ /** * Sample code: Unarchive. @@ -708,8 +680,7 @@ import com.azure.resourcemanager.reservations.models.PatchModel; */ public final class ReservationUpdateSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/UpdateReservation.json + * x-ms-original-file: 2022-11-01/UpdateReservation.json */ /** * Sample code: PatchReservation. @@ -743,8 +714,7 @@ import com.azure.resourcemanager.reservations.models.SkuName; */ public final class ReservationOrderCalculateSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * CalculateReservationOrder.json + * x-ms-original-file: 2022-11-01/CalculateReservationOrder.json */ /** * Sample code: CalculatePrice. @@ -779,8 +749,7 @@ import com.azure.resourcemanager.reservations.models.ChangeDirectoryRequest; */ public final class ReservationOrderChangeDirectorySamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * ChangeDirectoryReservationOrder.json + * x-ms-original-file: 2022-11-01/ChangeDirectoryReservationOrder.json */ /** * Sample code: ChangeDirectory. @@ -804,8 +773,7 @@ public final class ReservationOrderChangeDirectorySamples { */ public final class ReservationOrderGetSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * GetReservationOrderDetailsWithExpandPlanInformation.json + * x-ms-original-file: 2022-11-01/GetReservationOrderDetailsWithExpandPlanInformation.json */ /** * Sample code: GetReservationWithExpandPayments. @@ -819,8 +787,7 @@ public final class ReservationOrderGetSamples { } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * GetReservationOrderDetails.json + * x-ms-original-file: 2022-11-01/GetReservationOrderDetails.json */ /** * Sample code: GetReservationOrder. @@ -842,9 +809,7 @@ public final class ReservationOrderGetSamples { */ public final class ReservationOrderListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationOrders. - * json + * x-ms-original-file: 2022-11-01/GetReservationOrders.json */ /** * Sample code: ReservationOrderList. @@ -874,8 +839,7 @@ import com.azure.resourcemanager.reservations.models.SkuName; */ public final class ReservationOrderPurchaseSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * PurchaseReservationOrder.json + * x-ms-original-file: 2022-11-01/PurchaseReservationOrder.json */ /** * Sample code: Purchase. @@ -910,9 +874,7 @@ public final class ReservationOrderPurchaseSamples { */ public final class ResourceProviderGetAppliedReservationListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetAppliedReservations. - * json + * x-ms-original-file: 2022-11-01/GetAppliedReservations.json */ /** * Sample code: AppliedReservationList. @@ -935,8 +897,7 @@ public final class ResourceProviderGetAppliedReservationListSamples { */ public final class ResourceProviderListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetCatalog.json + * x-ms-original-file: 2022-11-01/GetCatalog.json */ /** * Sample code: Catalog. @@ -963,8 +924,7 @@ import com.azure.resourcemanager.reservations.models.ReservationToReturn; */ public final class ReturnPostSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Return.json + * x-ms-original-file: 2022-11-01/Return.json */ /** * Sample code: Return a reservation. diff --git a/sdk/reservations/azure-resourcemanager-reservations/pom.xml b/sdk/reservations/azure-resourcemanager-reservations/pom.xml index e03c845812c9..a9f4d191d0d0 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/pom.xml +++ b/sdk/reservations/azure-resourcemanager-reservations/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-reservations - 1.1.0-beta.1 + 1.1.0 jar - Microsoft Azure SDK for reservations Management - This package contains Microsoft Azure SDK for reservations Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This API describe Azure Reservation. Package tag package-2022-11. + Microsoft Azure SDK for Reservations Management + This package contains Microsoft Azure SDK for Reservations Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Quota Resource Provider. Package api-version Quota: 2020-10-25, Reservations: 2022-11-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + false diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/ReservationsManager.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/ReservationsManager.java index ff2544ef6bcd..aa32a177c43c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/ReservationsManager.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/ReservationsManager.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.reservations; @@ -22,9 +22,9 @@ 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.reservations.fluent.AzureReservationApi; -import com.azure.resourcemanager.reservations.implementation.AzureReservationApiBuilder; +import com.azure.resourcemanager.reservations.fluent.ReservationsManagementClient; import com.azure.resourcemanager.reservations.implementation.CalculateExchangesImpl; import com.azure.resourcemanager.reservations.implementation.CalculateRefundsImpl; import com.azure.resourcemanager.reservations.implementation.ExchangesImpl; @@ -33,6 +33,7 @@ import com.azure.resourcemanager.reservations.implementation.QuotasImpl; import com.azure.resourcemanager.reservations.implementation.ReservationOrdersImpl; import com.azure.resourcemanager.reservations.implementation.ReservationsImpl; +import com.azure.resourcemanager.reservations.implementation.ReservationsManagementClientBuilder; import com.azure.resourcemanager.reservations.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.reservations.implementation.ReturnsImpl; import com.azure.resourcemanager.reservations.models.CalculateExchanges; @@ -49,22 +50,27 @@ 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 ReservationsManager. - * This API describe Azure Reservation. + * Microsoft Azure Quota Resource Provider. */ public final class ReservationsManager { - private Reservations reservations; - private ResourceProviders resourceProviders; - private ReservationOrders reservationOrders; + private QuotaRequestStatus quotaRequestStatus; private Operations operations; + private Quotas quotas; + + private Reservations reservations; + + private ReservationOrders reservationOrders; + private CalculateRefunds calculateRefunds; private Returns returns; @@ -73,27 +79,23 @@ public final class ReservationsManager { private Exchanges exchanges; - private Quotas quotas; - - private QuotaRequestStatus quotaRequestStatus; - - private final AzureReservationApi clientObject; + private final ReservationsManagementClient clientObject; private ReservationsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new AzureReservationApiBuilder().pipeline(httpPipeline) + this.clientObject = new ReservationsManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .defaultPollInterval(defaultPollInterval) .buildClient(); } /** - * Creates an instance of reservations service API entry point. + * Creates an instance of Reservations service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the reservations service API instance. + * @return the Reservations service API instance. */ public static ReservationsManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -102,11 +104,11 @@ public static ReservationsManager authenticate(TokenCredential credential, Azure } /** - * Creates an instance of reservations service API entry point. + * Creates an instance of Reservations service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the reservations service API instance. + * @return the Reservations service API instance. */ public static ReservationsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -128,6 +130,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-reservations.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -225,22 +230,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of reservations service API entry point. + * Creates an instance of Reservations service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the reservations service API instance. + * @return the Reservations service API instance. */ public ReservationsManager 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.reservations") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -286,18 +293,6 @@ public ReservationsManager authenticate(TokenCredential credential, AzureProfile } } - /** - * Gets the resource collection API of Reservations. - * - * @return Resource collection API of Reservations. - */ - public Reservations reservations() { - if (this.reservations == null) { - this.reservations = new ReservationsImpl(clientObject.getReservations(), this); - } - return reservations; - } - /** * Gets the resource collection API of ResourceProviders. * @@ -311,15 +306,15 @@ public ResourceProviders resourceProviders() { } /** - * Gets the resource collection API of ReservationOrders. + * Gets the resource collection API of QuotaRequestStatus. * - * @return Resource collection API of ReservationOrders. + * @return Resource collection API of QuotaRequestStatus. */ - public ReservationOrders reservationOrders() { - if (this.reservationOrders == null) { - this.reservationOrders = new ReservationOrdersImpl(clientObject.getReservationOrders(), this); + public QuotaRequestStatus quotaRequestStatus() { + if (this.quotaRequestStatus == null) { + this.quotaRequestStatus = new QuotaRequestStatusImpl(clientObject.getQuotaRequestStatus(), this); } - return reservationOrders; + return quotaRequestStatus; } /** @@ -334,6 +329,42 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of Quotas. It manages CurrentQuotaLimitBase. + * + * @return Resource collection API of Quotas. + */ + public Quotas quotas() { + if (this.quotas == null) { + this.quotas = new QuotasImpl(clientObject.getQuotas(), this); + } + return quotas; + } + + /** + * Gets the resource collection API of Reservations. + * + * @return Resource collection API of Reservations. + */ + public Reservations reservations() { + if (this.reservations == null) { + this.reservations = new ReservationsImpl(clientObject.getReservations(), this); + } + return reservations; + } + + /** + * Gets the resource collection API of ReservationOrders. + * + * @return Resource collection API of ReservationOrders. + */ + public ReservationOrders reservationOrders() { + if (this.reservationOrders == null) { + this.reservationOrders = new ReservationOrdersImpl(clientObject.getReservationOrders(), this); + } + return reservationOrders; + } + /** * Gets the resource collection API of CalculateRefunds. * @@ -383,36 +414,12 @@ public Exchanges exchanges() { } /** - * Gets the resource collection API of Quotas. It manages CurrentQuotaLimitBase. - * - * @return Resource collection API of Quotas. - */ - public Quotas quotas() { - if (this.quotas == null) { - this.quotas = new QuotasImpl(clientObject.getQuotas(), this); - } - return quotas; - } - - /** - * Gets the resource collection API of QuotaRequestStatus. - * - * @return Resource collection API of QuotaRequestStatus. - */ - public QuotaRequestStatus quotaRequestStatus() { - if (this.quotaRequestStatus == null) { - this.quotaRequestStatus = new QuotaRequestStatusImpl(clientObject.getQuotaRequestStatus(), this); - } - return quotaRequestStatus; - } - - /** - * Gets wrapped service client AzureReservationApi providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets wrapped service client ReservationsManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. * - * @return Wrapped service client AzureReservationApi. + * @return Wrapped service client ReservationsManagementClient. */ - public AzureReservationApi serviceClient() { + public ReservationsManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateExchangesClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateExchangesClient.java index e0fd6bc292e0..1ca5d72c5927 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateExchangesClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateExchangesClient.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.reservations.fluent; @@ -21,11 +21,11 @@ public interface CalculateExchangesClient { * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @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 calculateExchange operation result. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CalculateExchangeOperationResultResponseInner> @@ -36,12 +36,12 @@ public interface CalculateExchangesClient { * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @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 calculateExchange operation result. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CalculateExchangeOperationResultResponseInner> @@ -52,11 +52,11 @@ public interface CalculateExchangesClient { * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @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 calculateExchange operation result. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) CalculateExchangeOperationResultResponseInner post(CalculateExchangeRequest body); @@ -66,12 +66,12 @@ public interface CalculateExchangesClient { * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @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 calculateExchange operation result. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) CalculateExchangeOperationResultResponseInner post(CalculateExchangeRequest body, Context context); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateRefundsClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateRefundsClient.java index d14dcca4ff2e..4740fca57064 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateRefundsClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateRefundsClient.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.reservations.fluent; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ExchangesClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ExchangesClient.java index a4f7d327e4ad..7d65c681baae 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ExchangesClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ExchangesClient.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.reservations.fluent; @@ -21,11 +21,11 @@ public interface ExchangesClient { * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @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 exchange operation result. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExchangeOperationResultResponseInner> @@ -36,12 +36,12 @@ public interface ExchangesClient { * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @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 exchange operation result. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExchangeOperationResultResponseInner> @@ -52,11 +52,11 @@ public interface ExchangesClient { * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @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 exchange operation result. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) ExchangeOperationResultResponseInner post(ExchangeRequest body); @@ -66,12 +66,12 @@ public interface ExchangesClient { * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @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 exchange operation result. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) ExchangeOperationResultResponseInner post(ExchangeRequest body, Context context); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/OperationsClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/OperationsClient.java index 2aef1afa590f..43565be6a419 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/OperationsClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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.reservations.fluent; @@ -21,7 +21,9 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations as paginated response with {@link PagedIterable}. + * @return operations. + * + * List all the operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -35,7 +37,9 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations as paginated response with {@link PagedIterable}. + * @return operations. + * + * List all the operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotaRequestStatusClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotaRequestStatusClient.java index 000e9ee92a4f..9d55255af17e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotaRequestStatusClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotaRequestStatusClient.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.reservations.fluent; @@ -20,7 +20,7 @@ public interface QuotaRequestStatusClient { * ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response * with the requestId parameter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param id Quota Request ID. @@ -39,7 +39,7 @@ Response getWithResponse(String subscriptionId, String * ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response * with the requestId parameter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param id Quota Request ID. @@ -55,7 +55,7 @@ Response getWithResponse(String subscriptionId, String * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -70,7 +70,7 @@ Response getWithResponse(String subscriptionId, String * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param filter | Field | Supported operators | diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotasClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotasClient.java index 0863fb1fac79..88353fdbedde 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotasClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotasClient.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.reservations.fluent; @@ -21,7 +21,7 @@ public interface QuotasClient { * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to * submit quota update request. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -40,7 +40,7 @@ QuotasGetResponse getWithResponse(String subscriptionId, String providerId, Stri * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to * submit quota update request. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -61,7 +61,7 @@ QuotasGetResponse getWithResponse(String subscriptionId, String providerId, Stri * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -85,7 +85,7 @@ SyncPoller, CurrentQuotaLimitBaseInner> b * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -110,7 +110,7 @@ SyncPoller, CurrentQuotaLimitBaseInner> b * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -133,7 +133,7 @@ CurrentQuotaLimitBaseInner createOrUpdate(String subscriptionId, String provider * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -156,7 +156,7 @@ CurrentQuotaLimitBaseInner createOrUpdate(String subscriptionId, String provider * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -178,7 +178,7 @@ SyncPoller, CurrentQuotaLimitBaseInner> b * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -202,7 +202,7 @@ SyncPoller, CurrentQuotaLimitBaseInner> b * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -224,7 +224,7 @@ CurrentQuotaLimitBaseInner update(String subscriptionId, String providerId, Stri * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -244,7 +244,7 @@ CurrentQuotaLimitBaseInner update(String subscriptionId, String providerId, Stri * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -260,7 +260,7 @@ CurrentQuotaLimitBaseInner update(String subscriptionId, String providerId, Stri * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param context The context to associate with this operation. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationOrdersClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationOrdersClient.java index 2f767f8e6eed..1a6c6eabc05f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationOrdersClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationOrdersClient.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.reservations.fluent; @@ -22,59 +22,38 @@ */ public interface ReservationOrdersClient { /** - * Calculate price for a `ReservationOrder`. + * Get a specific `ReservationOrder`. * - * Calculate price for placing a `ReservationOrder`. + * Get the details of the `ReservationOrder`. * - * @param body Information needed for calculate or purchase reservation. + * @param reservationOrderId Order Id of the reservation. + * @param expand May be used to expand the planInformation. * @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 calculate price for reservation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response calculateWithResponse(PurchaseRequest body, Context context); - - /** - * Calculate price for a `ReservationOrder`. - * - * Calculate price for placing a `ReservationOrder`. + * @return a specific `ReservationOrder`. * - * @param body Information needed for calculate or purchase reservation. - * @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 calculate price for reservation. + * Get the details of the `ReservationOrder` along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CalculatePriceResponseInner calculate(PurchaseRequest body); - - /** - * Get all `ReservationOrder`s. - * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. - * - * @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 list of `ReservationOrder`s as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + Response getWithResponse(String reservationOrderId, String expand, Context context); /** - * Get all `ReservationOrder`s. + * Get a specific `ReservationOrder`. * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. + * Get the details of the `ReservationOrder`. * - * @param context The context to associate with this operation. + * @param reservationOrderId Order Id of the reservation. * @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 list of `ReservationOrder`s as paginated response with {@link PagedIterable}. + * @return a specific `ReservationOrder`. + * + * Get the details of the `ReservationOrder`. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ReservationOrderResponseInner get(String reservationOrderId); /** * Purchase `ReservationOrder` @@ -141,34 +120,36 @@ public interface ReservationOrdersClient { ReservationOrderResponseInner purchase(String reservationOrderId, PurchaseRequest body, Context context); /** - * Get a specific `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Get the details of the `ReservationOrder`. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. - * @param expand May be used to expand the planInformation. - * @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 details of the `ReservationOrder` along with {@link Response}. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String reservationOrderId, String expand, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Get a specific `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Get the details of the `ReservationOrder`. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. + * @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 details of the `ReservationOrder`. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ReservationOrderResponseInner get(String reservationOrderId); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** * Change directory of `ReservationOrder`. @@ -201,4 +182,33 @@ Response changeDirectoryWithResponse(String reserv */ @ServiceMethod(returns = ReturnType.SINGLE) ChangeDirectoryResponseInner changeDirectory(String reservationOrderId, ChangeDirectoryRequest body); + + /** + * Calculate price for a `ReservationOrder`. + * + * Calculate price for placing a `ReservationOrder`. + * + * @param body The request body. + * @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 calculate price for reservation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response calculateWithResponse(PurchaseRequest body, Context context); + + /** + * Calculate price for a `ReservationOrder`. + * + * Calculate price for placing a `ReservationOrder`. + * + * @param body The request body. + * @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 calculate price for reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CalculatePriceResponseInner calculate(PurchaseRequest body); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsClient.java index 950930bb4f1a..31d8d92823b3 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsClient.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.reservations.fluent; @@ -24,431 +24,449 @@ */ public interface ReservationsClient { /** - * Get Available Scopes for `Reservation`. + * Get `Reservation` details. * - * Check whether the scopes from request is valid for `Reservation`. + * Get specific `Reservation` details. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. + * @param expand Supported value of this query is renewProperties. + * @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 response of available scope api containing scopes and their - * eligibilities. + * @return `Reservation` details. + * + * Get specific `Reservation` details along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AvailableScopePropertiesInner> - beginAvailableScopes(String reservationOrderId, String reservationId, AvailableScopeRequest body); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String reservationOrderId, String reservationId, String expand, + Context context); /** - * Get Available Scopes for `Reservation`. + * Get `Reservation` details. * - * Check whether the scopes from request is valid for `Reservation`. + * Get specific `Reservation` details. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. - * @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 response of available scope api containing scopes and their - * eligibilities. + * @return `Reservation` details. + * + * Get specific `Reservation` details. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AvailableScopePropertiesInner> beginAvailableScopes( - String reservationOrderId, String reservationId, AvailableScopeRequest body, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ReservationResponseInner get(String reservationOrderId, String reservationId); /** - * Get Available Scopes for `Reservation`. + * Updates a `Reservation`. * - * Check whether the scopes from request is valid for `Reservation`. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. + * @param parameters Information needed to patch a reservation item. * @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 available scope api containing scopes and their eligibilities. + * @return the {@link SyncPoller} for polling of the definition of the reservation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailableScopePropertiesInner availableScopes(String reservationOrderId, String reservationId, - AvailableScopeRequest body); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReservationResponseInner> beginUpdate(String reservationOrderId, + String reservationId, PatchModel parameters); /** - * Get Available Scopes for `Reservation`. + * Updates a `Reservation`. * - * Check whether the scopes from request is valid for `Reservation`. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. + * @param parameters Information needed to patch a reservation item. * @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 available scope api containing scopes and their eligibilities. + * @return the {@link SyncPoller} for polling of the definition of the reservation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailableScopePropertiesInner availableScopes(String reservationOrderId, String reservationId, - AvailableScopeRequest body, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReservationResponseInner> beginUpdate(String reservationOrderId, + String reservationId, PatchModel parameters, Context context); /** - * Split the `Reservation`. + * Updates a `Reservation`. * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. + * @param reservationId Id of the reservation item. + * @param parameters Information needed to patch a reservation item. * @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 array of ReservationResponse. + * @return the definition of the reservation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller>, List> - beginSplit(String reservationOrderId, SplitRequest body); + @ServiceMethod(returns = ReturnType.SINGLE) + ReservationResponseInner update(String reservationOrderId, String reservationId, PatchModel parameters); /** - * Split the `Reservation`. + * Updates a `Reservation`. * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. + * @param reservationId Id of the reservation item. + * @param parameters Information needed to patch a reservation item. * @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 array of ReservationResponse. + * @return the definition of the reservation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller>, List> - beginSplit(String reservationOrderId, SplitRequest body, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ReservationResponseInner update(String reservationOrderId, String reservationId, PatchModel parameters, + Context context); /** - * Split the `Reservation`. + * Get `Reservation`s in a given reservation Order * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. * @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 array of ReservationResponse. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - List split(String reservationOrderId, SplitRequest body); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String reservationOrderId); /** - * Split the `Reservation`. + * Get `Reservation`s in a given reservation Order * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. * @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 array of ReservationResponse. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - List split(String reservationOrderId, SplitRequest body, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String reservationOrderId, Context context); /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @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 array of ReservationResponse. + * @return the {@link SyncPoller} for polling of available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller>, List> - beginMerge(String reservationOrderId, MergeRequest body); + SyncPoller, AvailableScopePropertiesInner> + beginAvailableScopes(String reservationOrderId, String reservationId, AvailableScopeRequest body); /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @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 array of ReservationResponse. + * @return the {@link SyncPoller} for polling of available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller>, List> - beginMerge(String reservationOrderId, MergeRequest body, Context context); + SyncPoller, AvailableScopePropertiesInner> beginAvailableScopes( + String reservationOrderId, String reservationId, AvailableScopeRequest body, Context context); /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @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 array of ReservationResponse. + * @return available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ @ServiceMethod(returns = ReturnType.SINGLE) - List merge(String reservationOrderId, MergeRequest body); + AvailableScopePropertiesInner availableScopes(String reservationOrderId, String reservationId, + AvailableScopeRequest body); /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @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 array of ReservationResponse. + * @return available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ @ServiceMethod(returns = ReturnType.SINGLE) - List merge(String reservationOrderId, MergeRequest body, Context context); + AvailableScopePropertiesInner availableScopes(String reservationOrderId, String reservationId, + AvailableScopeRequest body, Context context); /** - * Get `Reservation`s in a given reservation Order + * Archive a `Reservation`. * - * List `Reservation`s within a single `ReservationOrder`. + * Archiving a `Reservation` moves it to `Archived` state. * * @param reservationOrderId Order Id of the reservation. + * @param reservationId Id of the reservation item. + * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String reservationOrderId); + @ServiceMethod(returns = ReturnType.SINGLE) + Response archiveWithResponse(String reservationOrderId, String reservationId, Context context); /** - * Get `Reservation`s in a given reservation Order + * Archive a `Reservation`. * - * List `Reservation`s within a single `ReservationOrder`. + * Archiving a `Reservation` moves it to `Archived` state. * * @param reservationOrderId Order Id of the reservation. - * @param context The context to associate with this operation. + * @param reservationId Id of the reservation item. * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String reservationOrderId, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void archive(String reservationOrderId, String reservationId); /** - * Get `Reservation` details. + * Unarchive a `Reservation`. * - * Get specific `Reservation` details. + * Restores a `Reservation` to the state it was before archiving. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param expand Supported value of this query is renewProperties. * @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 specific `Reservation` details along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String reservationOrderId, String reservationId, String expand, - Context context); + Response unarchiveWithResponse(String reservationOrderId, String reservationId, Context context); /** - * Get `Reservation` details. + * Unarchive a `Reservation`. * - * Get specific `Reservation` details. + * Restores a `Reservation` to the state it was before archiving. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. * @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 specific `Reservation` details. */ @ServiceMethod(returns = ReturnType.SINGLE) - ReservationResponseInner get(String reservationOrderId, String reservationId); + void unarchive(String reservationOrderId, String reservationId); /** - * Updates a `Reservation`. + * Get `Reservation` revisions. * - * Updates the applied scopes of the `Reservation`. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. * @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 definition of the reservation. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReservationResponseInner> beginUpdate(String reservationOrderId, - String reservationId, PatchModel parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String reservationOrderId, String reservationId); /** - * Updates a `Reservation`. + * Get `Reservation` revisions. * - * Updates the applied scopes of the `Reservation`. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. * @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 definition of the reservation. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReservationResponseInner> beginUpdate(String reservationOrderId, - String reservationId, PatchModel parameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String reservationOrderId, String reservationId, + Context context); /** - * Updates a `Reservation`. + * Split the `Reservation`. * - * Updates the applied scopes of the `Reservation`. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. + * @param body Information needed to Split a reservation item. * @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 definition of the reservation. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ReservationResponseInner update(String reservationOrderId, String reservationId, PatchModel parameters); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>, List> + beginSplit(String reservationOrderId, SplitRequest body); /** - * Updates a `Reservation`. + * Split the `Reservation`. * - * Updates the applied scopes of the `Reservation`. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. + * @param body Information needed to Split a reservation item. * @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 definition of the reservation. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ReservationResponseInner update(String reservationOrderId, String reservationId, PatchModel parameters, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>, List> + beginSplit(String reservationOrderId, SplitRequest body, Context context); /** - * Archive a `Reservation`. + * Split the `Reservation`. * - * Archiving a `Reservation` moves it to `Archived` state. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param context The context to associate with this operation. + * @param body Information needed to Split a reservation item. * @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}. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response archiveWithResponse(String reservationOrderId, String reservationId, Context context); + List split(String reservationOrderId, SplitRequest body); /** - * Archive a `Reservation`. + * Split the `Reservation`. * - * Archiving a `Reservation` moves it to `Archived` state. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed to Split a reservation item. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - void archive(String reservationOrderId, String reservationId); + List split(String reservationOrderId, SplitRequest body, Context context); /** - * Unarchive a `Reservation`. + * Merges two `Reservation`s. * - * Restores a `Reservation` to the state it was before archiving. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param context The context to associate with this operation. + * @param body Information needed for commercial request for a reservation. * @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}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response unarchiveWithResponse(String reservationOrderId, String reservationId, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>, List> + beginMerge(String reservationOrderId, MergeRequest body); /** - * Unarchive a `Reservation`. + * Merges two `Reservation`s. * - * Restores a `Reservation` to the state it was before archiving. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void unarchive(String reservationOrderId, String reservationId); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>, List> + beginMerge(String reservationOrderId, MergeRequest body, Context context); /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRevisions(String reservationOrderId, String reservationId); + @ServiceMethod(returns = ReturnType.SINGLE) + List merge(String reservationOrderId, MergeRequest body); /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRevisions(String reservationOrderId, String reservationId, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + List merge(String reservationOrderId, MergeRequest body, Context context); /** * List the reservations and the roll up counts of reservations group by provisioning states that the user has diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/AzureReservationApi.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsManagementClient.java similarity index 92% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/AzureReservationApi.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsManagementClient.java index d943e9dfc83b..5993aaca2795 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/AzureReservationApi.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsManagementClient.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.reservations.fluent; @@ -8,11 +8,11 @@ import java.time.Duration; /** - * The interface for AzureReservationApi class. + * The interface for ReservationsManagementClient class. */ -public interface AzureReservationApi { +public interface ReservationsManagementClient { /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -32,13 +32,6 @@ public interface AzureReservationApi { */ Duration getDefaultPollInterval(); - /** - * Gets the ReservationsClient object to access its operations. - * - * @return the ReservationsClient object. - */ - ReservationsClient getReservations(); - /** * Gets the ResourceProvidersClient object to access its operations. * @@ -47,11 +40,11 @@ public interface AzureReservationApi { ResourceProvidersClient getResourceProviders(); /** - * Gets the ReservationOrdersClient object to access its operations. + * Gets the QuotaRequestStatusClient object to access its operations. * - * @return the ReservationOrdersClient object. + * @return the QuotaRequestStatusClient object. */ - ReservationOrdersClient getReservationOrders(); + QuotaRequestStatusClient getQuotaRequestStatus(); /** * Gets the OperationsClient object to access its operations. @@ -60,6 +53,27 @@ public interface AzureReservationApi { */ OperationsClient getOperations(); + /** + * Gets the QuotasClient object to access its operations. + * + * @return the QuotasClient object. + */ + QuotasClient getQuotas(); + + /** + * Gets the ReservationsClient object to access its operations. + * + * @return the ReservationsClient object. + */ + ReservationsClient getReservations(); + + /** + * Gets the ReservationOrdersClient object to access its operations. + * + * @return the ReservationOrdersClient object. + */ + ReservationOrdersClient getReservationOrders(); + /** * Gets the CalculateRefundsClient object to access its operations. * @@ -87,18 +101,4 @@ public interface AzureReservationApi { * @return the ExchangesClient object. */ ExchangesClient getExchanges(); - - /** - * Gets the QuotasClient object to access its operations. - * - * @return the QuotasClient object. - */ - QuotasClient getQuotas(); - - /** - * Gets the QuotaRequestStatusClient object to access its operations. - * - * @return the QuotaRequestStatusClient object. - */ - QuotaRequestStatusClient getQuotaRequestStatus(); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ResourceProvidersClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ResourceProvidersClient.java index 40e1d9e00636..b039adad18aa 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ResourceProvidersClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ResourceProvidersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.fluent; @@ -19,7 +19,7 @@ public interface ResourceProvidersClient { /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @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. @@ -32,9 +32,9 @@ public interface ResourceProvidersClient { /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param reservedResourceType The type of the resource for which the skus should be provided. - * @param location Filters the skus based on the location specified in this parameter. This can be an Azure region + * @param location Filters the skus based on the location specified in this parameter. This can be an azure region * or global. * @param publisherId Publisher id used to get the third party products. * @param offerId Offer id used to get the third party products. @@ -58,13 +58,15 @@ PagedIterable list(String subscriptionId, String reservedResourceT * * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @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 applicable `Reservation`s that are applied to this subscription or a resource group under this - * subscription along with {@link Response}. + * @return list of applicable `Reservation`s. + * + * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAppliedReservationListWithResponse(String subscriptionId, Context context); @@ -74,12 +76,13 @@ PagedIterable list(String subscriptionId, String reservedResourceT * * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @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 applicable `Reservation`s that are applied to this subscription or a resource group under this - * subscription. + * @return list of applicable `Reservation`s. + * + * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) AppliedReservationsInner getAppliedReservationList(String subscriptionId); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReturnsClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReturnsClient.java index c25c313b8d20..616aa635bba7 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReturnsClient.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReturnsClient.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.reservations.fluent; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsInner.java index 1a1b32fa777e..078a11d31223 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsInner.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsInner.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.reservations.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 @@ /** * The response for applied reservations api. */ -@Fluent +@Immutable public final class AppliedReservationsInner implements JsonSerializable { /* * Identifier of the applied reservations @@ -40,7 +40,7 @@ public final class AppliedReservationsInner implements JsonSerializable { /* * Paginated list of applied reservations @@ -25,7 +25,7 @@ public final class AppliedReservationsProperties implements JsonSerializable { /* * The scopes checked by the available scope api. @@ -25,7 +25,7 @@ public final class AvailableScopePropertiesInner implements JsonSerializable { /* @@ -48,7 +48,7 @@ public final class CalculateExchangeOperationResultResponseInner /** * Creates an instance of CalculateExchangeOperationResultResponseInner class. */ - public CalculateExchangeOperationResultResponseInner() { + private CalculateExchangeOperationResultResponseInner() { } /** @@ -60,17 +60,6 @@ public String id() { return this.id; } - /** - * Set the id property: It should match what is used to GET the operation result. - * - * @param id the id value to set. - * @return the CalculateExchangeOperationResultResponseInner object itself. - */ - public CalculateExchangeOperationResultResponseInner withId(String id) { - this.id = id; - return this; - } - /** * Get the name property: It must match the last segment of the id field, and will typically be a GUID / system * generated value. @@ -81,18 +70,6 @@ public String name() { return this.name; } - /** - * Set the name property: It must match the last segment of the id field, and will typically be a GUID / system - * generated value. - * - * @param name the name value to set. - * @return the CalculateExchangeOperationResultResponseInner object itself. - */ - public CalculateExchangeOperationResultResponseInner withName(String name) { - this.name = name; - return this; - } - /** * Get the status property: Status of the operation. * @@ -102,17 +79,6 @@ public CalculateExchangeOperationResultStatus status() { return this.status; } - /** - * Set the status property: Status of the operation. - * - * @param status the status value to set. - * @return the CalculateExchangeOperationResultResponseInner object itself. - */ - public CalculateExchangeOperationResultResponseInner withStatus(CalculateExchangeOperationResultStatus status) { - this.status = status; - return this; - } - /** * Get the properties property: CalculateExchange response properties. * @@ -122,18 +88,6 @@ public CalculateExchangeResponseProperties properties() { return this.properties; } - /** - * Set the properties property: CalculateExchange response properties. - * - * @param properties the properties value to set. - * @return the CalculateExchangeOperationResultResponseInner object itself. - */ - public CalculateExchangeOperationResultResponseInner - withProperties(CalculateExchangeResponseProperties properties) { - this.properties = properties; - return this; - } - /** * Get the error property: Required if status == failed or status == canceled. * @@ -143,31 +97,6 @@ public OperationResultError error() { return this.error; } - /** - * Set the error property: Required if status == failed or status == canceled. - * - * @param error the error value to set. - * @return the CalculateExchangeOperationResultResponseInner object itself. - */ - public CalculateExchangeOperationResultResponseInner withError(OperationResultError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (error() != null) { - error().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculatePriceResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculatePriceResponseInner.java index 0e74184af90c..e842f2103fce 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculatePriceResponseInner.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculatePriceResponseInner.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.reservations.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 @@ /** * The response of calculate price for reservation. */ -@Fluent +@Immutable public final class CalculatePriceResponseInner implements JsonSerializable { /* * Properties for calculate price response @@ -25,7 +25,7 @@ public final class CalculatePriceResponseInner implements JsonSerializable { /* * Fully qualified identifier of the reservation being returned @@ -30,7 +30,7 @@ public final class CalculateRefundResponseInner implements JsonSerializable { /* * The type of resource the sku applies to. @@ -82,7 +82,7 @@ public final class CatalogInner implements JsonSerializable { /** * Creates an instance of CatalogInner class. */ - public CatalogInner() { + private CatalogInner() { } /** @@ -112,17 +112,6 @@ public Map> billingPlans() { return this.billingPlans; } - /** - * Set the billingPlans property: The billing plan options available for this sku. - * - * @param billingPlans the billingPlans value to set. - * @return the CatalogInner object itself. - */ - public CatalogInner withBillingPlans(Map> billingPlans) { - this.billingPlans = billingPlans; - return this; - } - /** * Get the terms property: Available reservation terms for this resource. * @@ -195,26 +184,6 @@ public List capabilities() { return this.capabilities; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (skuProperties() != null) { - skuProperties().forEach(e -> e.validate()); - } - if (msrp() != null) { - msrp().validate(); - } - if (restrictions() != null) { - restrictions().forEach(e -> e.validate()); - } - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ChangeDirectoryResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ChangeDirectoryResponseInner.java index 8a3f1f49124f..ec2798240458 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ChangeDirectoryResponseInner.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ChangeDirectoryResponseInner.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.reservations.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; @@ -16,7 +16,7 @@ /** * Change directory response. */ -@Fluent +@Immutable public final class ChangeDirectoryResponseInner implements JsonSerializable { /* * Change directory result for reservation order or reservation @@ -31,7 +31,7 @@ public final class ChangeDirectoryResponseInner implements JsonSerializable reservations() { return this.reservations; } - /** - * Set the reservations property: The reservations property. - * - * @param reservations the reservations value to set. - * @return the ChangeDirectoryResponseInner object itself. - */ - public ChangeDirectoryResponseInner withReservations(List reservations) { - this.reservations = reservations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (reservationOrder() != null) { - reservationOrder().validate(); - } - if (reservations() != null) { - reservations().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CurrentQuotaLimitBaseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CurrentQuotaLimitBaseInner.java index 4cbeced805ca..f9297a993cca 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CurrentQuotaLimitBaseInner.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CurrentQuotaLimitBaseInner.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.reservations.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -22,6 +23,11 @@ public final class CurrentQuotaLimitBaseInner extends ProxyResource { */ private QuotaProperties properties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -63,6 +69,15 @@ public CurrentQuotaLimitBaseInner withProperties(QuotaProperties properties) { return this; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -93,17 +108,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @@ -138,6 +142,8 @@ public static CurrentQuotaLimitBaseInner fromJson(JsonReader jsonReader) throws deserializedCurrentQuotaLimitBaseInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedCurrentQuotaLimitBaseInner.properties = QuotaProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCurrentQuotaLimitBaseInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ExchangeOperationResultResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ExchangeOperationResultResponseInner.java index cf5e36c49069..1c92497e051e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ExchangeOperationResultResponseInner.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ExchangeOperationResultResponseInner.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.reservations.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; @@ -17,7 +17,7 @@ /** * Exchange operation result. */ -@Fluent +@Immutable public final class ExchangeOperationResultResponseInner implements JsonSerializable { /* @@ -48,7 +48,7 @@ public final class ExchangeOperationResultResponseInner /** * Creates an instance of ExchangeOperationResultResponseInner class. */ - public ExchangeOperationResultResponseInner() { + private ExchangeOperationResultResponseInner() { } /** @@ -60,17 +60,6 @@ public String id() { return this.id; } - /** - * Set the id property: It should match what is used to GET the operation result. - * - * @param id the id value to set. - * @return the ExchangeOperationResultResponseInner object itself. - */ - public ExchangeOperationResultResponseInner withId(String id) { - this.id = id; - return this; - } - /** * Get the name property: It must match the last segment of the id field, and will typically be a GUID / system * generated value. @@ -81,18 +70,6 @@ public String name() { return this.name; } - /** - * Set the name property: It must match the last segment of the id field, and will typically be a GUID / system - * generated value. - * - * @param name the name value to set. - * @return the ExchangeOperationResultResponseInner object itself. - */ - public ExchangeOperationResultResponseInner withName(String name) { - this.name = name; - return this; - } - /** * Get the status property: Status of the operation. * @@ -102,17 +79,6 @@ public ExchangeOperationResultStatus status() { return this.status; } - /** - * Set the status property: Status of the operation. - * - * @param status the status value to set. - * @return the ExchangeOperationResultResponseInner object itself. - */ - public ExchangeOperationResultResponseInner withStatus(ExchangeOperationResultStatus status) { - this.status = status; - return this; - } - /** * Get the properties property: Exchange response properties. * @@ -122,17 +88,6 @@ public ExchangeResponseProperties properties() { return this.properties; } - /** - * Set the properties property: Exchange response properties. - * - * @param properties the properties value to set. - * @return the ExchangeOperationResultResponseInner object itself. - */ - public ExchangeOperationResultResponseInner withProperties(ExchangeResponseProperties properties) { - this.properties = properties; - return this; - } - /** * Get the error property: Required if status == failed or status == canceled. * @@ -142,31 +97,6 @@ public OperationResultError error() { return this.error; } - /** - * Set the error property: Required if status == failed or status == canceled. - * - * @param error the error value to set. - * @return the ExchangeOperationResultResponseInner object itself. - */ - public ExchangeOperationResultResponseInner withError(OperationResultError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (error() != null) { - error().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/MergeProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/MergeProperties.java index 711269e77a0a..ec0d54caba32 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/MergeProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/MergeProperties.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.reservations.fluent.models; @@ -51,14 +51,6 @@ public MergeProperties withSources(List sources) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/OperationResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/OperationResponseInner.java index 40363a7e1720..8eb9a028a24e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/OperationResponseInner.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/OperationResponseInner.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.reservations.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 @@ /** * The response containing operation information. */ -@Fluent +@Immutable public final class OperationResponseInner implements JsonSerializable { /* * Name of the operation @@ -45,7 +45,7 @@ public final class OperationResponseInner implements JsonSerializable { /* - * The type of the resource that is being reserved. + * The type of the resource that is being reserved. In addition to below types we have also added the following: + * OpenAIPTU, MDC, Sentinel. */ private ReservedResourceType reservedResourceType; @@ -95,7 +96,8 @@ public PurchaseRequestProperties() { } /** - * Get the reservedResourceType property: The type of the resource that is being reserved. + * Get the reservedResourceType property: The type of the resource that is being reserved. In addition to below + * types we have also added the following: OpenAIPTU, MDC, Sentinel. * * @return the reservedResourceType value. */ @@ -104,7 +106,8 @@ public ReservedResourceType reservedResourceType() { } /** - * Set the reservedResourceType property: The type of the resource that is being reserved. + * Set the reservedResourceType property: The type of the resource that is being reserved. In addition to below + * types we have also added the following: OpenAIPTU, MDC, Sentinel. * * @param reservedResourceType the reservedResourceType value to set. * @return the PurchaseRequestProperties object itself. @@ -345,20 +348,6 @@ public PurchaseRequestProperties withReviewDateTime(OffsetDateTime reviewDateTim return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (appliedScopeProperties() != null) { - appliedScopeProperties().validate(); - } - if (reservedResourceProperties() != null) { - reservedResourceProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestDetailsInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestDetailsInner.java index b7a2c3ffd04a..f93c44469119 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestDetailsInner.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestDetailsInner.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.reservations.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -18,13 +19,18 @@ /** * Quota request details. */ -@Fluent +@Immutable public final class QuotaRequestDetailsInner extends ProxyResource { /* * Quota request details. */ private QuotaRequestProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -43,7 +49,7 @@ public final class QuotaRequestDetailsInner extends ProxyResource { /** * Creates an instance of QuotaRequestDetailsInner class. */ - public QuotaRequestDetailsInner() { + private QuotaRequestDetailsInner() { } /** @@ -55,6 +61,15 @@ private QuotaRequestProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -94,20 +109,6 @@ public QuotaRequestState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } - /** - * Set the provisioningState property: The quota request status. - * - * @param provisioningState the provisioningState value to set. - * @return the QuotaRequestDetailsInner object itself. - */ - public QuotaRequestDetailsInner withProvisioningState(QuotaRequestState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new QuotaRequestProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - /** * Get the message property: User friendly status message. * @@ -136,31 +137,6 @@ public List value() { return this.innerProperties() == null ? null : this.innerProperties().value(); } - /** - * Set the value property: The quotaRequests. - * - * @param value the value value to set. - * @return the QuotaRequestDetailsInner object itself. - */ - public QuotaRequestDetailsInner withValue(List value) { - if (this.innerProperties() == null) { - this.innerProperties = new QuotaRequestProperties(); - } - this.innerProperties().withValue(value); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -195,6 +171,8 @@ public static QuotaRequestDetailsInner fromJson(JsonReader jsonReader) throws IO deserializedQuotaRequestDetailsInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedQuotaRequestDetailsInner.innerProperties = QuotaRequestProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedQuotaRequestDetailsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestProperties.java index 10441b78ce05..41c8a6bbab03 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestProperties.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.reservations.fluent.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; @@ -19,7 +19,7 @@ /** * The details of quota request. */ -@Fluent +@Immutable public final class QuotaRequestProperties implements JsonSerializable { /* * The quota request status. @@ -45,7 +45,7 @@ public final class QuotaRequestProperties implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The quotaRequests. - * - * @param value the value value to set. - * @return the QuotaRequestProperties object itself. - */ - public QuotaRequestProperties 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) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestStatusDetails.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestStatusDetails.java deleted file mode 100644 index 6d1751644600..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestStatusDetails.java +++ /dev/null @@ -1,99 +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.reservations.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import java.io.IOException; - -/** - * Quota request status details. - */ -@Immutable -public final class QuotaRequestStatusDetails implements JsonSerializable { - /* - * The details of the quota request status. - */ - private QuotaRequestState provisioningState; - - /* - * A user friendly message. - */ - private String message; - - /** - * Creates an instance of QuotaRequestStatusDetails class. - */ - public QuotaRequestStatusDetails() { - } - - /** - * Get the provisioningState property: The details of the quota request status. - * - * @return the provisioningState value. - */ - public QuotaRequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the message property: A user friendly message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaRequestStatusDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaRequestStatusDetails 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 QuotaRequestStatusDetails. - */ - public static QuotaRequestStatusDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaRequestStatusDetails deserializedQuotaRequestStatusDetails = new QuotaRequestStatusDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedQuotaRequestStatusDetails.provisioningState - = QuotaRequestState.fromString(reader.getString()); - } else if ("message".equals(fieldName)) { - deserializedQuotaRequestStatusDetails.message = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaRequestStatusDetails; - }); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestSubmitResponse201Inner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestSubmitResponse201Inner.java deleted file mode 100644 index 824670fef10c..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestSubmitResponse201Inner.java +++ /dev/null @@ -1,154 +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.reservations.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import java.io.IOException; - -/** - * Response with request ID that the quota request was accepted. - */ -@Immutable -public final class QuotaRequestSubmitResponse201Inner implements JsonSerializable { - /* - * The quota request ID. Use the requestId parameter to check the request status. - */ - private String id; - - /* - * Operation ID - */ - private String name; - - /* - * Resource type - */ - private String type; - - /* - * Quota request status. - */ - private QuotaRequestStatusDetails innerProperties; - - /** - * Creates an instance of QuotaRequestSubmitResponse201Inner class. - */ - public QuotaRequestSubmitResponse201Inner() { - } - - /** - * Get the id property: The quota request ID. Use the requestId parameter to check the request status. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: Operation ID. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the innerProperties property: Quota request status. - * - * @return the innerProperties value. - */ - private QuotaRequestStatusDetails innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: The details of the quota request status. - * - * @return the provisioningState value. - */ - public QuotaRequestState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the message property: A user friendly message. - * - * @return the message value. - */ - public String message() { - return this.innerProperties() == null ? null : this.innerProperties().message(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaRequestSubmitResponse201Inner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaRequestSubmitResponse201Inner 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 QuotaRequestSubmitResponse201Inner. - */ - public static QuotaRequestSubmitResponse201Inner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaRequestSubmitResponse201Inner deserializedQuotaRequestSubmitResponse201Inner - = new QuotaRequestSubmitResponse201Inner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedQuotaRequestSubmitResponse201Inner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedQuotaRequestSubmitResponse201Inner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedQuotaRequestSubmitResponse201Inner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedQuotaRequestSubmitResponse201Inner.innerProperties - = QuotaRequestStatusDetails.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaRequestSubmitResponse201Inner; - }); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/RefundResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/RefundResponseInner.java deleted file mode 100644 index 40de8496f969..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/RefundResponseInner.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.reservations.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.reservations.models.RefundResponseProperties; -import java.io.IOException; - -/** - * The response of refund request containing refund information of reservation. - */ -@Fluent -public final class RefundResponseInner implements JsonSerializable { - /* - * Fully qualified identifier of the reservation being returned - */ - private String id; - - /* - * The refund properties of reservation - */ - private RefundResponseProperties properties; - - /** - * Creates an instance of RefundResponseInner class. - */ - public RefundResponseInner() { - } - - /** - * Get the id property: Fully qualified identifier of the reservation being returned. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Fully qualified identifier of the reservation being returned. - * - * @param id the id value to set. - * @return the RefundResponseInner object itself. - */ - public RefundResponseInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the properties property: The refund properties of reservation. - * - * @return the properties value. - */ - public RefundResponseProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The refund properties of reservation. - * - * @param properties the properties value to set. - * @return the RefundResponseInner object itself. - */ - public RefundResponseInner withProperties(RefundResponseProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RefundResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RefundResponseInner 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 RefundResponseInner. - */ - public static RefundResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RefundResponseInner deserializedRefundResponseInner = new RefundResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRefundResponseInner.id = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRefundResponseInner.properties = RefundResponseProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRefundResponseInner; - }); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderProperties.java index 91019b744830..3820cdbd4364 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderProperties.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.reservations.fluent.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; @@ -24,7 +24,7 @@ /** * Properties of a reservation order. */ -@Fluent +@Immutable public final class ReservationOrderProperties implements JsonSerializable { /* * Friendly name for user to easily identified the reservation. @@ -94,7 +94,7 @@ public final class ReservationOrderProperties implements JsonSerializable reservations() { return this.reservations; } - /** - * Set the reservations property: The reservations property. - * - * @param reservations the reservations value to set. - * @return the ReservationOrderProperties object itself. - */ - public ReservationOrderProperties withReservations(List reservations) { - this.reservations = reservations; - return this; - } - /** * Get the reviewDateTime property: This is the date-time when the Azure Hybrid Benefit needs to be reviewed. * @@ -346,31 +214,6 @@ public OffsetDateTime reviewDateTime() { return this.reviewDateTime; } - /** - * Set the reviewDateTime property: This is the date-time when the Azure Hybrid Benefit needs to be reviewed. - * - * @param reviewDateTime the reviewDateTime value to set. - * @return the ReservationOrderProperties object itself. - */ - public ReservationOrderProperties withReviewDateTime(OffsetDateTime reviewDateTime) { - this.reviewDateTime = reviewDateTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (planInformation() != null) { - planInformation().validate(); - } - if (reservations() != null) { - reservations().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderResponseInner.java index 622e2a744aaa..53053091e0f8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderResponseInner.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderResponseInner.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.reservations.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -22,20 +22,20 @@ /** * Details of a reservation order being returned. */ -@Fluent +@Immutable public final class ReservationOrderResponseInner extends ProxyResource { /* - * The etag property. + * Properties of a reservation order. */ - private Integer etag; + private ReservationOrderProperties innerProperties; /* - * Properties of a reservation order. + * The etag property. */ - private ReservationOrderProperties innerProperties; + private Integer etag; /* - * Metadata pertaining to creation and last modification of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -57,40 +57,29 @@ public final class ReservationOrderResponseInner extends ProxyResource { /** * Creates an instance of ReservationOrderResponseInner class. */ - public ReservationOrderResponseInner() { + private ReservationOrderResponseInner() { } /** - * Get the etag property: The etag property. - * - * @return the etag value. - */ - public Integer etag() { - return this.etag; - } - - /** - * Set the etag property: The etag property. + * Get the innerProperties property: Properties of a reservation order. * - * @param etag the etag value to set. - * @return the ReservationOrderResponseInner object itself. + * @return the innerProperties value. */ - public ReservationOrderResponseInner withEtag(Integer etag) { - this.etag = etag; - return this; + private ReservationOrderProperties innerProperties() { + return this.innerProperties; } /** - * Get the innerProperties property: Properties of a reservation order. + * Get the etag property: The etag property. * - * @return the innerProperties value. + * @return the etag value. */ - private ReservationOrderProperties innerProperties() { - return this.innerProperties; + public Integer etag() { + return this.etag; } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -137,20 +126,6 @@ public String displayName() { return this.innerProperties() == null ? null : this.innerProperties().displayName(); } - /** - * Set the displayName property: Friendly name for user to easily identified the reservation. - * - * @param displayName the displayName value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - /** * Get the requestDateTime property: This is the DateTime when the reservation was initially requested for purchase. * @@ -160,20 +135,6 @@ public OffsetDateTime requestDateTime() { return this.innerProperties() == null ? null : this.innerProperties().requestDateTime(); } - /** - * Set the requestDateTime property: This is the DateTime when the reservation was initially requested for purchase. - * - * @param requestDateTime the requestDateTime value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withRequestDateTime(OffsetDateTime requestDateTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withRequestDateTime(requestDateTime); - return this; - } - /** * Get the createdDateTime property: This is the DateTime when the reservation was created. * @@ -183,20 +144,6 @@ public OffsetDateTime createdDateTime() { return this.innerProperties() == null ? null : this.innerProperties().createdDateTime(); } - /** - * Set the createdDateTime property: This is the DateTime when the reservation was created. - * - * @param createdDateTime the createdDateTime value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withCreatedDateTime(OffsetDateTime createdDateTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withCreatedDateTime(createdDateTime); - return this; - } - /** * Get the expiryDate property: This is the date when the reservation will expire. * @@ -206,20 +153,6 @@ public LocalDate expiryDate() { return this.innerProperties() == null ? null : this.innerProperties().expiryDate(); } - /** - * Set the expiryDate property: This is the date when the reservation will expire. - * - * @param expiryDate the expiryDate value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withExpiryDate(LocalDate expiryDate) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withExpiryDate(expiryDate); - return this; - } - /** * Get the expiryDateTime property: This is the date-time when the reservation will expire. * @@ -229,20 +162,6 @@ public OffsetDateTime expiryDateTime() { return this.innerProperties() == null ? null : this.innerProperties().expiryDateTime(); } - /** - * Set the expiryDateTime property: This is the date-time when the reservation will expire. - * - * @param expiryDateTime the expiryDateTime value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withExpiryDateTime(OffsetDateTime expiryDateTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withExpiryDateTime(expiryDateTime); - return this; - } - /** * Get the benefitStartTime property: This is the DateTime when the reservation benefit started. * @@ -252,20 +171,6 @@ public OffsetDateTime benefitStartTime() { return this.innerProperties() == null ? null : this.innerProperties().benefitStartTime(); } - /** - * Set the benefitStartTime property: This is the DateTime when the reservation benefit started. - * - * @param benefitStartTime the benefitStartTime value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withBenefitStartTime(OffsetDateTime benefitStartTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withBenefitStartTime(benefitStartTime); - return this; - } - /** * Get the originalQuantity property: Total Quantity of the skus purchased in the reservation. * @@ -275,20 +180,6 @@ public Integer originalQuantity() { return this.innerProperties() == null ? null : this.innerProperties().originalQuantity(); } - /** - * Set the originalQuantity property: Total Quantity of the skus purchased in the reservation. - * - * @param originalQuantity the originalQuantity value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withOriginalQuantity(Integer originalQuantity) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withOriginalQuantity(originalQuantity); - return this; - } - /** * Get the term property: Represent the term of reservation. * @@ -298,20 +189,6 @@ public ReservationTerm term() { return this.innerProperties() == null ? null : this.innerProperties().term(); } - /** - * Set the term property: Represent the term of reservation. - * - * @param term the term value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withTerm(ReservationTerm term) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withTerm(term); - return this; - } - /** * Get the provisioningState property: Current state of the reservation. * @@ -321,20 +198,6 @@ public ProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } - /** - * Set the provisioningState property: Current state of the reservation. - * - * @param provisioningState the provisioningState value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - /** * Get the billingPlan property: Represent the billing plans. * @@ -344,20 +207,6 @@ public ReservationBillingPlan billingPlan() { return this.innerProperties() == null ? null : this.innerProperties().billingPlan(); } - /** - * Set the billingPlan property: Represent the billing plans. - * - * @param billingPlan the billingPlan value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withBillingPlan(ReservationBillingPlan billingPlan) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withBillingPlan(billingPlan); - return this; - } - /** * Get the planInformation property: Information describing the type of billing plan for this reservation. * @@ -367,20 +216,6 @@ public ReservationOrderBillingPlanInformation planInformation() { return this.innerProperties() == null ? null : this.innerProperties().planInformation(); } - /** - * Set the planInformation property: Information describing the type of billing plan for this reservation. - * - * @param planInformation the planInformation value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withPlanInformation(ReservationOrderBillingPlanInformation planInformation) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withPlanInformation(planInformation); - return this; - } - /** * Get the reservations property: The reservations property. * @@ -390,20 +225,6 @@ public List reservations() { return this.innerProperties() == null ? null : this.innerProperties().reservations(); } - /** - * Set the reservations property: The reservations property. - * - * @param reservations the reservations value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withReservations(List reservations) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withReservations(reservations); - return this; - } - /** * Get the reviewDateTime property: This is the date-time when the Azure Hybrid Benefit needs to be reviewed. * @@ -413,39 +234,14 @@ public OffsetDateTime reviewDateTime() { return this.innerProperties() == null ? null : this.innerProperties().reviewDateTime(); } - /** - * Set the reviewDateTime property: This is the date-time when the Azure Hybrid Benefit needs to be reviewed. - * - * @param reviewDateTime the reviewDateTime value to set. - * @return the ReservationOrderResponseInner object itself. - */ - public ReservationOrderResponseInner withReviewDateTime(OffsetDateTime reviewDateTime) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationOrderProperties(); - } - this.innerProperties().withReviewDateTime(reviewDateTime); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("etag", this.etag); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeNumberField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -472,11 +268,11 @@ public static ReservationOrderResponseInner fromJson(JsonReader jsonReader) thro deserializedReservationOrderResponseInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedReservationOrderResponseInner.type = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedReservationOrderResponseInner.etag = reader.getNullable(JsonReader::getInt); } else if ("properties".equals(fieldName)) { deserializedReservationOrderResponseInner.innerProperties = ReservationOrderProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedReservationOrderResponseInner.etag = reader.getNullable(JsonReader::getInt); } else if ("systemData".equals(fieldName)) { deserializedReservationOrderResponseInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationResponseInner.java index 30fb40096a7d..43ad92edcd60 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationResponseInner.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationResponseInner.java @@ -1,16 +1,16 @@ // 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.reservations.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.reservations.models.Kind; +import com.azure.resourcemanager.reservations.models.ReservationResponseKind; import com.azure.resourcemanager.reservations.models.ReservationsProperties; import com.azure.resourcemanager.reservations.models.SkuName; import java.io.IOException; @@ -18,8 +18,13 @@ /** * The definition of the reservation. */ -@Fluent +@Immutable public final class ReservationResponseInner extends ProxyResource { + /* + * The properties associated to this reservation + */ + private ReservationsProperties properties; + /* * The Azure region where the reserved resource lives. */ @@ -35,15 +40,10 @@ public final class ReservationResponseInner extends ProxyResource { */ private SkuName sku; - /* - * The properties associated to this reservation - */ - private ReservationsProperties properties; - /* * Resource Provider type to be reserved. */ - private Kind kind; + private ReservationResponseKind kind; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -68,27 +68,25 @@ public final class ReservationResponseInner extends ProxyResource { /** * Creates an instance of ReservationResponseInner class. */ - public ReservationResponseInner() { + private ReservationResponseInner() { } /** - * Get the location property: The Azure region where the reserved resource lives. + * Get the properties property: The properties associated to this reservation. * - * @return the location value. + * @return the properties value. */ - public String location() { - return this.location; + public ReservationsProperties properties() { + return this.properties; } /** - * Set the location property: The Azure region where the reserved resource lives. + * Get the location property: The Azure region where the reserved resource lives. * - * @param location the location value to set. - * @return the ReservationResponseInner object itself. + * @return the location value. */ - public ReservationResponseInner withLocation(String location) { - this.location = location; - return this; + public String location() { + return this.location; } /** @@ -100,17 +98,6 @@ public Integer etag() { return this.etag; } - /** - * Set the etag property: The etag property. - * - * @param etag the etag value to set. - * @return the ReservationResponseInner object itself. - */ - public ReservationResponseInner withEtag(Integer etag) { - this.etag = etag; - return this; - } - /** * Get the sku property: The sku information associated to this reservation. * @@ -120,57 +107,15 @@ public SkuName sku() { return this.sku; } - /** - * Set the sku property: The sku information associated to this reservation. - * - * @param sku the sku value to set. - * @return the ReservationResponseInner object itself. - */ - public ReservationResponseInner withSku(SkuName sku) { - this.sku = sku; - return this; - } - - /** - * Get the properties property: The properties associated to this reservation. - * - * @return the properties value. - */ - public ReservationsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The properties associated to this reservation. - * - * @param properties the properties value to set. - * @return the ReservationResponseInner object itself. - */ - public ReservationResponseInner withProperties(ReservationsProperties properties) { - this.properties = properties; - return this; - } - /** * Get the kind property: Resource Provider type to be reserved. * * @return the kind value. */ - public Kind kind() { + public ReservationResponseKind kind() { return this.kind; } - /** - * Set the kind property: Resource Provider type to be reserved. - * - * @param kind the kind value to set. - * @return the ReservationResponseInner object itself. - */ - public ReservationResponseInner withKind(Kind kind) { - this.kind = kind; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -210,30 +155,16 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeStringField("location", this.location); jsonWriter.writeNumberField("etag", this.etag); jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); } @@ -260,16 +191,16 @@ public static ReservationResponseInner fromJson(JsonReader jsonReader) throws IO deserializedReservationResponseInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedReservationResponseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedReservationResponseInner.properties = ReservationsProperties.fromJson(reader); } else if ("location".equals(fieldName)) { deserializedReservationResponseInner.location = reader.getString(); } else if ("etag".equals(fieldName)) { deserializedReservationResponseInner.etag = reader.getNullable(JsonReader::getInt); } else if ("sku".equals(fieldName)) { deserializedReservationResponseInner.sku = SkuName.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedReservationResponseInner.properties = ReservationsProperties.fromJson(reader); } else if ("kind".equals(fieldName)) { - deserializedReservationResponseInner.kind = Kind.fromString(reader.getString()); + deserializedReservationResponseInner.kind = ReservationResponseKind.fromString(reader.getString()); } else if ("systemData".equals(fieldName)) { deserializedReservationResponseInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SavingsPlanPurchaseRequestProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SavingsPlanPurchaseRequestProperties.java index ca2a030e63e6..c55c6cb9f0b8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SavingsPlanPurchaseRequestProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SavingsPlanPurchaseRequestProperties.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.reservations.fluent.models; @@ -209,20 +209,6 @@ public SavingsPlanPurchaseRequestProperties withCommitment(Commitment commitment return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (appliedScopeProperties() != null) { - appliedScopeProperties().validate(); - } - if (commitment() != null) { - commitment().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SplitProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SplitProperties.java index c494f307785a..629349af0e9b 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SplitProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SplitProperties.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.reservations.fluent.models; @@ -76,14 +76,6 @@ public SplitProperties withReservationId(String reservationId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/package-info.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/package-info.java index ea789c978fbe..6afef6adb72d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/package-info.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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 AzureReservationApi. - * This API describe Azure Reservation. + * Package containing the inner data models for ReservationsManagementClient. + * Microsoft Azure Quota Resource Provider. */ package com.azure.resourcemanager.reservations.fluent.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/package-info.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/package-info.java index cd08bf54dca6..fddf9a67608f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/package-info.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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 AzureReservationApi. - * This API describe Azure Reservation. + * Package containing the service clients for ReservationsManagementClient. + * Microsoft Azure Quota Resource Provider. */ package com.azure.resourcemanager.reservations.fluent; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AppliedReservationsImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AppliedReservationsImpl.java index 64d253e54771..22f38db1c118 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AppliedReservationsImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AppliedReservationsImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AvailableScopePropertiesImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AvailableScopePropertiesImpl.java index e4ab64558f26..98e5da222b01 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AvailableScopePropertiesImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AvailableScopePropertiesImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangeOperationResultResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangeOperationResultResponseImpl.java index 0377db2c06e5..060dede44f20 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangeOperationResultResponseImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangeOperationResultResponseImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesClientImpl.java index 92d78de46744..24a0051d909c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesClientImpl.java @@ -1,13 +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.reservations.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; 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.Post; @@ -20,6 +19,7 @@ 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; @@ -43,33 +43,41 @@ public final class CalculateExchangesClientImpl implements CalculateExchangesCli /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of CalculateExchangesClientImpl. * * @param client the instance of the service client containing this operation class. */ - CalculateExchangesClientImpl(AzureReservationApiImpl client) { + CalculateExchangesClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(CalculateExchangesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiCalculateExchanges to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for ReservationsManagementClientCalculateExchanges to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiC") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientCalculateExchanges") public interface CalculateExchangesService { - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Capacity/calculateExchange") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> post(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") CalculateExchangeRequest body, - @HeaderParam("Accept") String accept, Context context); + Mono>> post(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CalculateExchangeRequest body, + Context context); + + @Post("/providers/Microsoft.Capacity/calculateExchange") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response postSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CalculateExchangeRequest body, + Context context); } /** @@ -77,27 +85,20 @@ Mono>> post(@HostParam("$host") String endpoint, * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculateExchange operation result along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> postWithResponseAsync(CalculateExchangeRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.post(this.client.getEndpoint(), apiVersion, body, accept, context)) + .withContext( + context -> service.post(this.client.getEndpoint(), apiVersion, contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -106,28 +107,18 @@ private Mono>> postWithResponseAsync(CalculateExchange * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. - * @param context The context to associate with this operation. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculateExchange operation result along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> postWithResponseAsync(CalculateExchangeRequest body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } + private Response postWithResponse(CalculateExchangeRequest body) { final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.post(this.client.getEndpoint(), apiVersion, body, accept, context); + return service.postSync(this.client.getEndpoint(), apiVersion, contentType, accept, body, Context.NONE); } /** @@ -135,21 +126,19 @@ private Mono>> postWithResponseAsync(CalculateExchange * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. + * @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 calculateExchange operation result. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, CalculateExchangeOperationResultResponseInner> - beginPostAsync(CalculateExchangeRequest body) { - Mono>> mono = postWithResponseAsync(body); - return this.client - .getLroResult( - mono, this.client.getHttpPipeline(), CalculateExchangeOperationResultResponseInner.class, - CalculateExchangeOperationResultResponseInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response postWithResponse(CalculateExchangeRequest body, Context context) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.postSync(this.client.getEndpoint(), apiVersion, contentType, accept, body, context); } /** @@ -157,23 +146,21 @@ private Mono>> postWithResponseAsync(CalculateExchange * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. - * @param context The context to associate with this operation. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 calculateExchange operation result. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CalculateExchangeOperationResultResponseInner> - beginPostAsync(CalculateExchangeRequest body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = postWithResponseAsync(body, context); + beginPostAsync(CalculateExchangeRequest body) { + Mono>> mono = postWithResponseAsync(body); return this.client .getLroResult( mono, this.client.getHttpPipeline(), CalculateExchangeOperationResultResponseInner.class, - CalculateExchangeOperationResultResponseInner.class, context); + CalculateExchangeOperationResultResponseInner.class, this.client.getContext()); } /** @@ -181,17 +168,21 @@ private Mono>> postWithResponseAsync(CalculateExchange * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 calculateExchange operation result. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CalculateExchangeOperationResultResponseInner> beginPost(CalculateExchangeRequest body) { - return this.beginPostAsync(body).getSyncPoller(); + Response response = postWithResponse(body); + return this.client + .getLroResult( + response, CalculateExchangeOperationResultResponseInner.class, + CalculateExchangeOperationResultResponseInner.class, Context.NONE); } /** @@ -199,18 +190,22 @@ private Mono>> postWithResponseAsync(CalculateExchange * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @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 calculateExchange operation result. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CalculateExchangeOperationResultResponseInner> beginPost(CalculateExchangeRequest body, Context context) { - return this.beginPostAsync(body, context).getSyncPoller(); + Response response = postWithResponse(body, context); + return this.client + .getLroResult( + response, CalculateExchangeOperationResultResponseInner.class, + CalculateExchangeOperationResultResponseInner.class, context); } /** @@ -218,11 +213,11 @@ private Mono>> postWithResponseAsync(CalculateExchange * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculateExchange operation result on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono postAsync(CalculateExchangeRequest body) { @@ -234,33 +229,15 @@ private Mono postAsync(CalculateE * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. - * @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 calculateExchange operation result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono postAsync(CalculateExchangeRequest body, - Context context) { - return beginPostAsync(body, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Calculates the refund amounts and price of the new purchases. - * - * Calculates price for exchanging `Reservations` if there are no policy errors. - * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculateExchange operation result. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public CalculateExchangeOperationResultResponseInner post(CalculateExchangeRequest body) { - return postAsync(body).block(); + return beginPost(body).getFinalResult(); } /** @@ -268,15 +245,15 @@ public CalculateExchangeOperationResultResponseInner post(CalculateExchangeReque * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @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 calculateExchange operation result. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public CalculateExchangeOperationResultResponseInner post(CalculateExchangeRequest body, Context context) { - return postAsync(body, context).block(); + return beginPost(body, context).getFinalResult(); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesImpl.java index f3432d0df634..2bccffcf9a8d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculatePriceResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculatePriceResponseImpl.java index 1761404cd10e..ec361c5cfd77 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculatePriceResponseImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculatePriceResponseImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundResponseImpl.java index 12f8b0eafc1c..35bab533b937 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundResponseImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundResponseImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsClientImpl.java index 42470e0b90ae..dca82c3a8d9e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsClientImpl.java @@ -1,13 +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.reservations.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; 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; @@ -39,34 +38,41 @@ public final class CalculateRefundsClientImpl implements CalculateRefundsClient /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of CalculateRefundsClientImpl. * * @param client the instance of the service client containing this operation class. */ - CalculateRefundsClientImpl(AzureReservationApiImpl client) { + CalculateRefundsClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(CalculateRefundsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiCalculateRefunds to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for ReservationsManagementClientCalculateRefunds to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiC") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientCalculateRefunds") public interface CalculateRefundsService { - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> post(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CalculateRefundRequest body, @HeaderParam("Accept") String accept, - Context context); + Mono> post(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CalculateRefundRequest body, Context context); + + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response postSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CalculateRefundRequest body, Context context); } /** @@ -85,62 +91,15 @@ Mono> post(@HostParam("$host") String end @ServiceMethod(returns = ReturnType.SINGLE) private Mono> postWithResponseAsync(String reservationOrderId, CalculateRefundRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, context)) + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, + accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Calculate the refund amount of a reservation order. - * - * Calculate price for returning `Reservations` if there are no policy errors. - * - * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for calculating refund of a reservation. - * @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 calculate refund containing refund information of reservation along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> postWithResponseAsync(String reservationOrderId, - CalculateRefundRequest body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.post(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, context); - } - /** * Calculate the refund amount of a reservation order. * @@ -176,7 +135,11 @@ private Mono postAsync(String reservationOrderId, @ServiceMethod(returns = ReturnType.SINGLE) public Response postWithResponse(String reservationOrderId, CalculateRefundRequest body, Context context) { - return postWithResponseAsync(reservationOrderId, body, context).block(); + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.postSync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, accept, body, + context); } /** diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsImpl.java index c18b72a413fd..08cfcc4de367 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsImpl.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.reservations.implementation; @@ -31,12 +31,8 @@ public Response postWithResponse(String reservationOrde Context context) { Response inner = this.serviceClient().postWithResponse(reservationOrderId, body, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CalculateRefundResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CalculateRefundResponseImpl(inner.getValue(), this.manager())); } public CalculateRefundResponse post(String reservationOrderId, CalculateRefundRequest body) { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CatalogImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CatalogImpl.java index 5945c5f8ed2b..446b2fe66411 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CatalogImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CatalogImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ChangeDirectoryResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ChangeDirectoryResponseImpl.java index b1023ac26072..f86309a45062 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ChangeDirectoryResponseImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ChangeDirectoryResponseImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CurrentQuotaLimitBaseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CurrentQuotaLimitBaseImpl.java index 3cd38b7d6b6a..e5c8127aa85b 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CurrentQuotaLimitBaseImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CurrentQuotaLimitBaseImpl.java @@ -1,9 +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.reservations.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.reservations.fluent.models.CurrentQuotaLimitBaseInner; import com.azure.resourcemanager.reservations.models.CurrentQuotaLimitBase; @@ -31,6 +32,10 @@ public QuotaProperties properties() { return this.innerModel().properties(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public CurrentQuotaLimitBaseInner innerModel() { return this.innerObject; } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangeOperationResultResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangeOperationResultResponseImpl.java index 131b6cc966fa..e91b7ed167b8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangeOperationResultResponseImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangeOperationResultResponseImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesClientImpl.java index 58563b86e3f5..2ee281e7e5e4 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesClientImpl.java @@ -1,13 +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.reservations.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; 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.Post; @@ -20,6 +19,7 @@ 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; @@ -43,33 +43,39 @@ public final class ExchangesClientImpl implements ExchangesClient { /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of ExchangesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ExchangesClientImpl(AzureReservationApiImpl client) { + ExchangesClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(ExchangesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiExchanges to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for ReservationsManagementClientExchanges to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiE") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientExchanges") public interface ExchangesService { - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Capacity/exchange") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> post(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ExchangeRequest body, - @HeaderParam("Accept") String accept, Context context); + Mono>> post(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ExchangeRequest body, Context context); + + @Post("/providers/Microsoft.Capacity/exchange") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response postSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ExchangeRequest body, Context context); } /** @@ -77,27 +83,20 @@ Mono>> post(@HostParam("$host") String endpoint, * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return exchange operation result along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> postWithResponseAsync(ExchangeRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.post(this.client.getEndpoint(), apiVersion, body, accept, context)) + .withContext( + context -> service.post(this.client.getEndpoint(), apiVersion, contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -106,28 +105,18 @@ private Mono>> postWithResponseAsync(ExchangeRequest b * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. - * @param context The context to associate with this operation. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return exchange operation result along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> postWithResponseAsync(ExchangeRequest body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } + private Response postWithResponse(ExchangeRequest body) { final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.post(this.client.getEndpoint(), apiVersion, body, accept, context); + return service.postSync(this.client.getEndpoint(), apiVersion, contentType, accept, body, Context.NONE); } /** @@ -135,19 +124,19 @@ private Mono>> postWithResponseAsync(ExchangeRequest b * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. + * @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 exchange operation result. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExchangeOperationResultResponseInner> - beginPostAsync(ExchangeRequest body) { - Mono>> mono = postWithResponseAsync(body); - return this.client.getLroResult( - mono, this.client.getHttpPipeline(), ExchangeOperationResultResponseInner.class, - ExchangeOperationResultResponseInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response postWithResponse(ExchangeRequest body, Context context) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.postSync(this.client.getEndpoint(), apiVersion, contentType, accept, body, context); } /** @@ -155,21 +144,19 @@ private Mono>> postWithResponseAsync(ExchangeRequest b * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. - * @param context The context to associate with this operation. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 exchange operation result. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExchangeOperationResultResponseInner> - beginPostAsync(ExchangeRequest body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = postWithResponseAsync(body, context); + beginPostAsync(ExchangeRequest body) { + Mono>> mono = postWithResponseAsync(body); return this.client.getLroResult( mono, this.client.getHttpPipeline(), ExchangeOperationResultResponseInner.class, - ExchangeOperationResultResponseInner.class, context); + ExchangeOperationResultResponseInner.class, this.client.getContext()); } /** @@ -177,16 +164,19 @@ private Mono>> postWithResponseAsync(ExchangeRequest b * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 exchange operation result. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExchangeOperationResultResponseInner> beginPost(ExchangeRequest body) { - return this.beginPostAsync(body).getSyncPoller(); + Response response = postWithResponse(body); + return this.client.getLroResult( + response, ExchangeOperationResultResponseInner.class, ExchangeOperationResultResponseInner.class, + Context.NONE); } /** @@ -194,17 +184,19 @@ private Mono>> postWithResponseAsync(ExchangeRequest b * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @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 exchange operation result. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExchangeOperationResultResponseInner> beginPost(ExchangeRequest body, Context context) { - return this.beginPostAsync(body, context).getSyncPoller(); + Response response = postWithResponse(body, context); + return this.client.getLroResult( + response, ExchangeOperationResultResponseInner.class, ExchangeOperationResultResponseInner.class, context); } /** @@ -212,11 +204,11 @@ private Mono>> postWithResponseAsync(ExchangeRequest b * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return exchange operation result on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono postAsync(ExchangeRequest body) { @@ -228,32 +220,15 @@ private Mono postAsync(ExchangeRequest bod * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. - * @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 exchange operation result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono postAsync(ExchangeRequest body, Context context) { - return beginPostAsync(body, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Exchange Reservation(s) - * - * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. - * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return exchange operation result. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public ExchangeOperationResultResponseInner post(ExchangeRequest body) { - return postAsync(body).block(); + return beginPost(body).getFinalResult(); } /** @@ -261,15 +236,15 @@ public ExchangeOperationResultResponseInner post(ExchangeRequest body) { * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @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 exchange operation result. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public ExchangeOperationResultResponseInner post(ExchangeRequest body, Context context) { - return postAsync(body, context).block(); + return beginPost(body, context).getFinalResult(); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesImpl.java index 7482606be063..7c1bb73ab5d9 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationResponseImpl.java index 8617b309aefb..d7e894dc7d6a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationResponseImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationResponseImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsClientImpl.java index aca823ee2a4b..2a7287c7e274 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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.reservations.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.reservations.fluent.OperationsClient; import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.reservations.models.OperationList; +import com.azure.resourcemanager.reservations.implementation.models.OperationList; import reactor.core.publisher.Mono; /** @@ -42,31 +42,38 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(AzureReservationApiImpl client) { + OperationsClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiOperations to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for ReservationsManagementClientOperations to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiO") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Capacity/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.Capacity/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" }) @@ -74,7 +81,14 @@ Mono> list(@HostParam("$host") String endpoint, @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); } /** @@ -84,14 +98,12 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return operations. + * + * List all the operations 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 apiVersion = "2022-11-01"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) @@ -105,24 +117,15 @@ private Mono> listSinglePageAsync() { * * List all the operations. * - * @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 paginated list of operations along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return operations. + * + * List all the operations 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 apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, 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)); } /** @@ -132,11 +135,17 @@ private Mono> listSinglePageAsync(Context * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations as paginated response with {@link PagedFlux}. + * @return operations. + * + * List all the operations 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 apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), apiVersion, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -148,12 +157,17 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations as paginated response with {@link PagedFlux}. + * @return operations. + * + * List all the operations 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 apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), apiVersion, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -163,11 +177,13 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations as paginated response with {@link PagedIterable}. + * @return operations. + * + * List all the operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -179,31 +195,30 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations as paginated response with {@link PagedIterable}. + * @return operations. + * + * List all the operations 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)); } /** + * Get operations. + * * 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 paginated list of operations along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return operations. + * + * List all the operations 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(), @@ -212,6 +227,29 @@ private Mono> listNextSinglePageAsync(Stri } /** + * Get operations. + * + * 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 operations. + * + * List all the operations 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 operations. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -219,21 +257,15 @@ private Mono> listNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return operations. + * + * List all the operations 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/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsImpl.java index 79406c6491b4..73c7b6654bb0 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestDetailsImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestDetailsImpl.java index 861f2bd3e2a0..68faf3d62c4f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestDetailsImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestDetailsImpl.java @@ -1,9 +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.reservations.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner; import com.azure.resourcemanager.reservations.models.QuotaRequestDetails; import com.azure.resourcemanager.reservations.models.QuotaRequestState; @@ -35,6 +36,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public QuotaRequestState provisioningState() { return this.innerModel().provisioningState(); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusClientImpl.java index bfd44eb16d39..deb445f9ee8f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusClientImpl.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.reservations.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.reservations.fluent.QuotaRequestStatusClient; import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner; -import com.azure.resourcemanager.reservations.models.QuotaRequestDetailsList; +import com.azure.resourcemanager.reservations.implementation.models.QuotaRequestDetailsList; import reactor.core.publisher.Mono; /** @@ -42,41 +42,60 @@ public final class QuotaRequestStatusClientImpl implements QuotaRequestStatusCli /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of QuotaRequestStatusClientImpl. * * @param client the instance of the service client containing this operation class. */ - QuotaRequestStatusClientImpl(AzureReservationApiImpl client) { + QuotaRequestStatusClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(QuotaRequestStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiQuotaRequestStatus to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for ReservationsManagementClientQuotaRequestStatus to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiQ") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientQuotaRequestStatus") public interface QuotaRequestStatusService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("providerId") String providerId, @PathParam("location") String location, @PathParam("id") String id, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerId") String providerId, @PathParam("location") String location, + @PathParam("id") String id, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerId") String providerId, @PathParam("location") String location, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$skiptoken") String skiptoken, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("providerId") String providerId, @PathParam("location") String location, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$skiptoken") String skiptoken, @HeaderParam("Accept") String accept, Context context); @@ -86,7 +105,14 @@ Mono> list(@HostParam("$host") String endpoint @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); } /** @@ -94,7 +120,7 @@ Mono> listNext(@PathParam(value = "nextLink", * ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response * with the requestId parameter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param id Quota Request ID. @@ -106,26 +132,10 @@ Mono> listNext(@PathParam(value = "nextLink", @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String subscriptionId, String providerId, String location, String id) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } final String apiVersion = "2020-10-25"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), subscriptionId, apiVersion, providerId, + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, location, id, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -135,48 +145,7 @@ private Mono> getWithResponseAsync(String sub * ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response * with the requestId parameter. * - * @param subscriptionId Azure subscription ID. - * @param providerId Azure resource provider ID. - * @param location Azure region. - * @param id Quota Request ID. - * @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 quota request details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String subscriptionId, String providerId, - String location, String id, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - final String apiVersion = "2020-10-25"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), subscriptionId, apiVersion, providerId, location, id, accept, - context); - } - - /** - * For the specified Azure region (location), get the details and status of the quota request by the quota request - * ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response - * with the requestId parameter. - * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param id Quota Request ID. @@ -197,7 +166,7 @@ private Mono getAsync(String subscriptionId, String pr * ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response * with the requestId parameter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param id Quota Request ID. @@ -210,7 +179,10 @@ private Mono getAsync(String subscriptionId, String pr @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String subscriptionId, String providerId, String location, String id, Context context) { - return getWithResponseAsync(subscriptionId, providerId, location, id, context).block(); + final String apiVersion = "2020-10-25"; + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, location, id, accept, + context); } /** @@ -218,7 +190,7 @@ public Response getWithResponse(String subscriptionId, * ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response * with the requestId parameter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param id Quota Request ID. @@ -236,7 +208,7 @@ public QuotaRequestDetailsInner get(String subscriptionId, String providerId, St * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param filter | Field | Supported operators | @@ -254,23 +226,10 @@ public QuotaRequestDetailsInner get(String subscriptionId, String providerId, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String subscriptionId, String providerId, String location, String filter, Integer top, String skiptoken) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String apiVersion = "2020-10-25"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), subscriptionId, apiVersion, providerId, + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, location, filter, top, skiptoken, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -281,7 +240,7 @@ private Mono> listSinglePageAsync(String * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param filter | Field | Supported operators | @@ -291,60 +250,35 @@ private Mono> listSinglePageAsync(String * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response * contains a nextLink element, the value of the nextLink element includes a skiptoken parameter that specifies a * starting point to use for subsequent calls. - * @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 quota request details along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return quota request details as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String subscriptionId, String providerId, - String location, String filter, Integer top, String skiptoken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String apiVersion = "2020-10-25"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), subscriptionId, apiVersion, providerId, location, filter, top, skiptoken, - 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 subscriptionId, String providerId, String location, + String filter, Integer top, String skiptoken) { + return new PagedFlux<>(() -> listSinglePageAsync(subscriptionId, providerId, location, filter, top, skiptoken), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. - * @param filter | Field | Supported operators | - * |---------------------|------------------------| - * |requestSubmitTime | ge, le, eq, gt, lt |. - * @param top Number of records to return. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element includes a skiptoken parameter that specifies a - * starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return quota request details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String subscriptionId, String providerId, String location, - String filter, Integer top, String skiptoken) { + private PagedFlux listAsync(String subscriptionId, String providerId, String location) { + final String filter = null; + final Integer top = null; + final String skiptoken = null; return new PagedFlux<>(() -> listSinglePageAsync(subscriptionId, providerId, location, filter, top, skiptoken), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -353,28 +287,37 @@ private PagedFlux listAsync(String subscriptionId, Str * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. + * @param filter | Field | Supported operators | + * |---------------------|------------------------| + * |requestSubmitTime | ge, le, eq, gt, lt |. + * @param top Number of records to return. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element includes a skiptoken parameter that specifies a + * starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request details as paginated response with {@link PagedFlux}. + * @return quota request details along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String subscriptionId, String providerId, String location) { - final String filter = null; - final Integer top = null; - final String skiptoken = null; - return new PagedFlux<>(() -> listSinglePageAsync(subscriptionId, providerId, location, filter, top, skiptoken), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String subscriptionId, String providerId, + String location, String filter, Integer top, String skiptoken) { + final String apiVersion = "2020-10-25"; + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), apiVersion, subscriptionId, + providerId, location, filter, top, skiptoken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param filter | Field | Supported operators | @@ -388,21 +331,24 @@ private PagedFlux listAsync(String subscriptionId, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request details as paginated response with {@link PagedFlux}. + * @return quota request details along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String subscriptionId, String providerId, String location, - String filter, Integer top, String skiptoken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(subscriptionId, providerId, location, filter, top, skiptoken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String subscriptionId, String providerId, + String location, String filter, Integer top, String skiptoken, Context context) { + final String apiVersion = "2020-10-25"; + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), apiVersion, subscriptionId, + providerId, location, filter, top, skiptoken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -415,14 +361,15 @@ public PagedIterable list(String subscriptionId, Strin final String filter = null; final Integer top = null; final String skiptoken = null; - return new PagedIterable<>(listAsync(subscriptionId, providerId, location, filter, top, skiptoken)); + return new PagedIterable<>(() -> listSinglePage(subscriptionId, providerId, location, filter, top, skiptoken), + nextLink -> listNextSinglePage(nextLink)); } /** * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param filter | Field | Supported operators | @@ -441,7 +388,9 @@ public PagedIterable list(String subscriptionId, Strin @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String subscriptionId, String providerId, String location, String filter, Integer top, String skiptoken, Context context) { - return new PagedIterable<>(listAsync(subscriptionId, providerId, location, filter, top, skiptoken, context)); + return new PagedIterable<>( + () -> listSinglePage(subscriptionId, providerId, location, filter, top, skiptoken, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -455,13 +404,6 @@ public PagedIterable list(String subscriptionId, Strin */ @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(), @@ -469,6 +411,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 quota request details 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. * @@ -477,21 +437,14 @@ 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 quota request details along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return quota request details 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/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusImpl.java index 5714d609fee3..a18fec4da508 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusImpl.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.reservations.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String subscriptionId, Stri String id, Context context) { Response inner = this.serviceClient().getWithResponse(subscriptionId, providerId, location, id, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QuotaRequestDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QuotaRequestDetailsImpl(inner.getValue(), this.manager())); } public QuotaRequestDetails get(String subscriptionId, String providerId, String location, String id) { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestSubmitResponse201Impl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestSubmitResponse201Impl.java deleted file mode 100644 index 92707c06b46a..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestSubmitResponse201Impl.java +++ /dev/null @@ -1,49 +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.reservations.implementation; - -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestSubmitResponse201Inner; -import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import com.azure.resourcemanager.reservations.models.QuotaRequestSubmitResponse201; - -public final class QuotaRequestSubmitResponse201Impl implements QuotaRequestSubmitResponse201 { - private QuotaRequestSubmitResponse201Inner innerObject; - - private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager; - - QuotaRequestSubmitResponse201Impl(QuotaRequestSubmitResponse201Inner innerObject, - com.azure.resourcemanager.reservations.ReservationsManager 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 QuotaRequestState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String message() { - return this.innerModel().message(); - } - - public QuotaRequestSubmitResponse201Inner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.reservations.ReservationsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasClientImpl.java index f9254bfb7990..8e49ec464577 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasClientImpl.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.reservations.implementation; @@ -27,15 +27,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.reservations.fluent.QuotasClient; import com.azure.resourcemanager.reservations.fluent.models.CurrentQuotaLimitBaseInner; +import com.azure.resourcemanager.reservations.implementation.models.QuotaLimits; import com.azure.resourcemanager.reservations.models.QuotasGetResponse; -import com.azure.resourcemanager.reservations.models.QuotasListNextResponse; -import com.azure.resourcemanager.reservations.models.QuotasListResponse; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,78 +52,121 @@ public final class QuotasClientImpl implements QuotasClient { /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of QuotasClientImpl. * * @param client the instance of the service client containing this operation class. */ - QuotasClientImpl(AzureReservationApiImpl client) { + QuotasClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(QuotasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiQuotas to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for ReservationsManagementClientQuotas to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiQ") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientQuotas") public interface QuotasService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @PathParam("providerId") String providerId, - @PathParam("location") String location, @QueryParam("api-version") String apiVersion, + Mono get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerId") String providerId, @PathParam("location") String location, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + QuotasGetResponse getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("providerId") String providerId, @PathParam("location") String location, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerId") String providerId, @PathParam("location") String location, + @PathParam("resourceName") String resourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, Context context); + + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerId") String providerId, @PathParam("location") String location, + @PathParam("resourceName") String resourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, Context context); + @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @PathParam("providerId") String providerId, - @PathParam("location") String location, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerId") String providerId, @PathParam("location") String location, + @PathParam("resourceName") String resourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, Context context); + + @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerId") String providerId, @PathParam("location") String location, + @PathParam("resourceName") String resourceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerId") String providerId, @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @PathParam("providerId") String providerId, - @PathParam("location") String location, @QueryParam("api-version") String apiVersion, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("providerId") String providerId, @PathParam("location") String location, @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); } /** * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to * submit quota update request. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -136,27 +179,11 @@ Mono listNext(@PathParam(value = "nextLink", encoded = t @ServiceMethod(returns = ReturnType.SINGLE) private Mono getWithResponseAsync(String subscriptionId, String providerId, String location, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } final String apiVersion = "2020-10-25"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), subscriptionId, providerId, location, - apiVersion, resourceName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, + location, resourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -164,48 +191,7 @@ private Mono getWithResponseAsync(String subscriptionId, Stri * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to * submit quota update request. * - * @param subscriptionId Azure subscription ID. - * @param providerId Azure resource provider ID. - * @param location Azure region. - * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or - * TotalLowPriorityCores for Microsoft.MachineLearningServices. - * @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 current quota (service limit) and usage of a resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWithResponseAsync(String subscriptionId, String providerId, String location, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-10-25"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), subscriptionId, providerId, location, apiVersion, resourceName, - accept, context); - } - - /** - * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to - * submit quota update request. - * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -226,7 +212,7 @@ private Mono getAsync(String subscriptionId, String * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to * submit quota update request. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -240,14 +226,17 @@ private Mono getAsync(String subscriptionId, String @ServiceMethod(returns = ReturnType.SINGLE) public QuotasGetResponse getWithResponse(String subscriptionId, String providerId, String location, String resourceName, Context context) { - return getWithResponseAsync(subscriptionId, providerId, location, resourceName, context).block(); + final String apiVersion = "2020-10-25"; + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, location, + resourceName, accept, context); } /** * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to * submit quota update request. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -271,7 +260,7 @@ public CurrentQuotaLimitBaseInner get(String subscriptionId, String providerId, * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -285,33 +274,12 @@ public CurrentQuotaLimitBaseInner get(String subscriptionId, String providerId, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (createQuotaRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter createQuotaRequest is required and cannot be null.")); - } else { - createQuotaRequest.validate(); - } final String apiVersion = "2020-10-25"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), subscriptionId, providerId, - location, resourceName, apiVersion, createQuotaRequest, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, subscriptionId, + providerId, location, resourceName, contentType, accept, createQuotaRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -323,48 +291,25 @@ private Mono>> createOrUpdateWithResponseAsync(String * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or * TotalLowPriorityCores for Microsoft.MachineLearningServices. * @param createQuotaRequest Quota requests payload. - * @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 quota properties along with {@link Response} on successful completion of {@link Mono}. + * @return quota properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String subscriptionId, String providerId, - String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (createQuotaRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter createQuotaRequest is required and cannot be null.")); - } else { - createQuotaRequest.validate(); - } + private Response createOrUpdateWithResponse(String subscriptionId, String providerId, String location, + String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest) { final String apiVersion = "2020-10-25"; + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), subscriptionId, providerId, location, resourceName, - apiVersion, createQuotaRequest, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, location, + resourceName, contentType, accept, createQuotaRequest, Context.NONE); } /** @@ -375,26 +320,26 @@ private Mono>> createOrUpdateWithResponseAsync(String * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or * TotalLowPriorityCores for Microsoft.MachineLearningServices. * @param createQuotaRequest Quota requests payload. + * @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 quota properties. + * @return quota properties along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CurrentQuotaLimitBaseInner> beginCreateOrUpdateAsync( - String subscriptionId, String providerId, String location, String resourceName, - CurrentQuotaLimitBaseInner createQuotaRequest) { - Mono>> mono - = createOrUpdateWithResponseAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String subscriptionId, String providerId, String location, + String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { + final String apiVersion = "2020-10-25"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, location, + resourceName, contentType, accept, createQuotaRequest, context); } /** @@ -405,13 +350,12 @@ private PollerFlux, CurrentQuotaLimitBase * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or * TotalLowPriorityCores for Microsoft.MachineLearningServices. * @param createQuotaRequest Quota requests payload. - * @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. @@ -420,12 +364,12 @@ private PollerFlux, CurrentQuotaLimitBase @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CurrentQuotaLimitBaseInner> beginCreateOrUpdateAsync( String subscriptionId, String providerId, String location, String resourceName, - CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(subscriptionId, providerId, location, - resourceName, createQuotaRequest, context); + CurrentQuotaLimitBaseInner createQuotaRequest) { + Mono>> mono + = createOrUpdateWithResponseAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, context); + this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, + this.client.getContext()); } /** @@ -436,7 +380,7 @@ private PollerFlux, CurrentQuotaLimitBase * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -451,8 +395,10 @@ private PollerFlux, CurrentQuotaLimitBase public SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate( String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest) { - return this.beginCreateOrUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(subscriptionId, providerId, location, resourceName, createQuotaRequest); + return this.client.getLroResult(response, + CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, Context.NONE); } /** @@ -463,7 +409,7 @@ public SyncPoller, CurrentQuotaLimitBaseI * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -479,9 +425,10 @@ public SyncPoller, CurrentQuotaLimitBaseI public SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate( String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return this - .beginCreateOrUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(subscriptionId, providerId, location, resourceName, + createQuotaRequest, context); + return this.client.getLroResult(response, + CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, context); } /** @@ -492,7 +439,7 @@ public SyncPoller, CurrentQuotaLimitBaseI * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -518,35 +465,7 @@ private Mono createOrUpdateAsync(String subscription * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. - * @param providerId Azure resource provider ID. - * @param location Azure region. - * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or - * TotalLowPriorityCores for Microsoft.MachineLearningServices. - * @param createQuotaRequest Quota requests payload. - * @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 quota properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String subscriptionId, String providerId, - String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return beginCreateOrUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update the quota (service limits) of a resource to the requested value. - * Steps: - * 1. Make the Get request to get the quota information for specific resource. - * 2. To increase the quota, update the limit field in the response from Get request to new value. - * 3. Submit the JSON to the quota request API to update the quota. - * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. - * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -560,7 +479,8 @@ private Mono createOrUpdateAsync(String subscription @ServiceMethod(returns = ReturnType.SINGLE) public CurrentQuotaLimitBaseInner createOrUpdate(String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest) { - return createOrUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest).block(); + return beginCreateOrUpdate(subscriptionId, providerId, location, resourceName, createQuotaRequest) + .getFinalResult(); } /** @@ -571,7 +491,7 @@ public CurrentQuotaLimitBaseInner createOrUpdate(String subscriptionId, String p * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update the quota. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -586,8 +506,8 @@ public CurrentQuotaLimitBaseInner createOrUpdate(String subscriptionId, String p @ServiceMethod(returns = ReturnType.SINGLE) public CurrentQuotaLimitBaseInner createOrUpdate(String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return createOrUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, context) - .block(); + return beginCreateOrUpdate(subscriptionId, providerId, location, resourceName, createQuotaRequest, context) + .getFinalResult(); } /** @@ -597,7 +517,7 @@ public CurrentQuotaLimitBaseInner createOrUpdate(String subscriptionId, String p * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -611,33 +531,12 @@ public CurrentQuotaLimitBaseInner createOrUpdate(String subscriptionId, String p @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (createQuotaRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter createQuotaRequest is required and cannot be null.")); - } else { - createQuotaRequest.validate(); - } final String apiVersion = "2020-10-25"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), subscriptionId, providerId, location, - resourceName, apiVersion, createQuotaRequest, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, + location, resourceName, contentType, accept, createQuotaRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -648,48 +547,25 @@ private Mono>> updateWithResponseAsync(String subscrip * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or * TotalLowPriorityCores for Microsoft.MachineLearningServices. * @param createQuotaRequest Payload for the quota 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 quota properties along with {@link Response} on successful completion of {@link Mono}. + * @return quota properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String subscriptionId, String providerId, - String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (createQuotaRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter createQuotaRequest is required and cannot be null.")); - } else { - createQuotaRequest.validate(); - } + private Response updateWithResponse(String subscriptionId, String providerId, String location, + String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest) { final String apiVersion = "2020-10-25"; + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), subscriptionId, providerId, location, resourceName, apiVersion, - createQuotaRequest, accept, context); + return service.updateSync(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, location, + resourceName, contentType, accept, createQuotaRequest, Context.NONE); } /** @@ -699,26 +575,26 @@ private Mono>> updateWithResponseAsync(String subscrip * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or * TotalLowPriorityCores for Microsoft.MachineLearningServices. * @param createQuotaRequest Payload for the quota 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 the {@link PollerFlux} for polling of quota properties. + * @return quota properties along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CurrentQuotaLimitBaseInner> beginUpdateAsync( - String subscriptionId, String providerId, String location, String resourceName, - CurrentQuotaLimitBaseInner createQuotaRequest) { - Mono>> mono - = updateWithResponseAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String subscriptionId, String providerId, String location, + String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { + final String apiVersion = "2020-10-25"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, location, + resourceName, contentType, accept, createQuotaRequest, context); } /** @@ -728,13 +604,12 @@ private PollerFlux, CurrentQuotaLimitBase * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or * TotalLowPriorityCores for Microsoft.MachineLearningServices. * @param createQuotaRequest Payload for the quota 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. @@ -743,12 +618,12 @@ private PollerFlux, CurrentQuotaLimitBase @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CurrentQuotaLimitBaseInner> beginUpdateAsync( String subscriptionId, String providerId, String location, String resourceName, - CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - context = this.client.mergeContext(context); + CurrentQuotaLimitBaseInner createQuotaRequest) { Mono>> mono - = updateWithResponseAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, context); + = updateWithResponseAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, context); + this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, + this.client.getContext()); } /** @@ -758,7 +633,7 @@ private PollerFlux, CurrentQuotaLimitBase * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -773,8 +648,10 @@ private PollerFlux, CurrentQuotaLimitBase public SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate( String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest) { - return this.beginUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest) - .getSyncPoller(); + Response response + = updateWithResponse(subscriptionId, providerId, location, resourceName, createQuotaRequest); + return this.client.getLroResult(response, + CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, Context.NONE); } /** @@ -784,7 +661,7 @@ public SyncPoller, CurrentQuotaLimitBaseI * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -800,8 +677,10 @@ public SyncPoller, CurrentQuotaLimitBaseI public SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate( String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return this.beginUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, context) - .getSyncPoller(); + Response response + = updateWithResponse(subscriptionId, providerId, location, resourceName, createQuotaRequest, context); + return this.client.getLroResult(response, + CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, context); } /** @@ -811,7 +690,7 @@ public SyncPoller, CurrentQuotaLimitBaseI * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -836,33 +715,7 @@ private Mono updateAsync(String subscriptionId, Stri * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. - * @param providerId Azure resource provider ID. - * @param location Azure region. - * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or - * TotalLowPriorityCores for Microsoft.MachineLearningServices. - * @param createQuotaRequest Payload for the quota 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 quota properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String subscriptionId, String providerId, String location, - String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return beginUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the quota (service limits) of this resource to the requested value. - * • To get the quota information for specific resource, send a GET request. - * • To increase the quota, update the limit field from the GET response to a new value. - * • To update the quota value, submit the JSON response to the quota request API to update the quota. - * • To update the quota. use the PATCH operation. - * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -876,7 +729,7 @@ private Mono updateAsync(String subscriptionId, Stri @ServiceMethod(returns = ReturnType.SINGLE) public CurrentQuotaLimitBaseInner update(String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest) { - return updateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest).block(); + return beginUpdate(subscriptionId, providerId, location, resourceName, createQuotaRequest).getFinalResult(); } /** @@ -886,7 +739,7 @@ public CurrentQuotaLimitBaseInner update(String subscriptionId, String providerI * • To update the quota value, submit the JSON response to the quota request API to update the quota. * • To update the quota. use the PATCH operation. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -901,14 +754,15 @@ public CurrentQuotaLimitBaseInner update(String subscriptionId, String providerI @ServiceMethod(returns = ReturnType.SINGLE) public CurrentQuotaLimitBaseInner update(String subscriptionId, String providerId, String location, String resourceName, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return updateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest, context).block(); + return beginUpdate(subscriptionId, providerId, location, resourceName, createQuotaRequest, context) + .getFinalResult(); } /** * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -920,27 +774,13 @@ public CurrentQuotaLimitBaseInner update(String subscriptionId, String providerI @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String subscriptionId, String providerId, String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String apiVersion = "2020-10-25"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), subscriptionId, providerId, location, - apiVersion, accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), res.getDeserializedHeaders())) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, + location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -948,86 +788,73 @@ private Mono> listSinglePageAsync(Stri * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quotas (service limits) and usage for all resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of current quotas (service limits) and usage for all resources as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String subscriptionId, - String providerId, String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (providerId == null) { - return Mono.error(new IllegalArgumentException("Parameter providerId is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String apiVersion = "2020-10-25"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), subscriptionId, providerId, location, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), res.getDeserializedHeaders())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String subscriptionId, String providerId, String location) { + return new PagedFlux<>(() -> listSinglePageAsync(subscriptionId, providerId, location), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quotas (service limits) and usage for all resources as paginated response with - * {@link PagedFlux}. + * @return a list of current quotas (service limits) and usage for all resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String subscriptionId, String providerId, String location) { - return new PagedFlux<>(() -> listSinglePageAsync(subscriptionId, providerId, location), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String subscriptionId, String providerId, + String location) { + final String apiVersion = "2020-10-25"; + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, + location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quotas (service limits) and usage for all resources as paginated response with - * {@link PagedFlux}. + * @return a list of current quotas (service limits) and usage for all resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String subscriptionId, String providerId, String location, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(subscriptionId, providerId, location, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String subscriptionId, String providerId, + String location, Context context) { + final String apiVersion = "2020-10-25"; + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), apiVersion, subscriptionId, providerId, + location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1038,14 +865,15 @@ private PagedFlux listAsync(String subscriptionId, S */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String subscriptionId, String providerId, String location) { - return new PagedIterable<>(listAsync(subscriptionId, providerId, location)); + return new PagedIterable<>(() -> listSinglePage(subscriptionId, providerId, location), + nextLink -> listNextSinglePage(nextLink)); } /** * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param context The context to associate with this operation. @@ -1058,7 +886,8 @@ public PagedIterable list(String subscriptionId, Str @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String subscriptionId, String providerId, String location, Context context) { - return new PagedIterable<>(listAsync(subscriptionId, providerId, location, context)); + return new PagedIterable<>(() -> listSinglePage(subscriptionId, providerId, location, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1068,25 +897,35 @@ public PagedIterable list(String subscriptionId, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limits along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of current quotas (service limits) and usage for all resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), res.getDeserializedHeaders())) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of current quotas (service limits) and usage for all resources 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. * @@ -1095,21 +934,13 @@ private Mono> listNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limits along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of current quotas (service limits) and usage for all resources 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(), res.getDeserializedHeaders())); + 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/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasImpl.java index a47282904b5c..c864e0e77d0c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/RefundResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/RefundResponseImpl.java deleted file mode 100644 index 778c591e1391..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/RefundResponseImpl.java +++ /dev/null @@ -1,37 +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.reservations.implementation; - -import com.azure.resourcemanager.reservations.fluent.models.RefundResponseInner; -import com.azure.resourcemanager.reservations.models.RefundResponse; -import com.azure.resourcemanager.reservations.models.RefundResponseProperties; - -public final class RefundResponseImpl implements RefundResponse { - private RefundResponseInner innerObject; - - private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager; - - RefundResponseImpl(RefundResponseInner innerObject, - com.azure.resourcemanager.reservations.ReservationsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public RefundResponseProperties properties() { - return this.innerModel().properties(); - } - - public RefundResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.reservations.ReservationsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrderResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrderResponseImpl.java index d25cd6769e1f..54ac7dd12c68 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrderResponseImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrderResponseImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersClientImpl.java index ce125be0f52f..ad550baa444c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersClientImpl.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.reservations.implementation; @@ -27,6 +27,7 @@ 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; @@ -35,9 +36,9 @@ import com.azure.resourcemanager.reservations.fluent.models.CalculatePriceResponseInner; import com.azure.resourcemanager.reservations.fluent.models.ChangeDirectoryResponseInner; import com.azure.resourcemanager.reservations.fluent.models.ReservationOrderResponseInner; +import com.azure.resourcemanager.reservations.implementation.models.ReservationOrderList; import com.azure.resourcemanager.reservations.models.ChangeDirectoryRequest; import com.azure.resourcemanager.reservations.models.PurchaseRequest; -import com.azure.resourcemanager.reservations.models.ReservationOrderList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -54,291 +55,200 @@ public final class ReservationOrdersClientImpl implements ReservationOrdersClien /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of ReservationOrdersClientImpl. * * @param client the instance of the service client containing this operation class. */ - ReservationOrdersClientImpl(AzureReservationApiImpl client) { + ReservationOrdersClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(ReservationOrdersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiReservationOrders to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for ReservationsManagementClientReservationOrders to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiR") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientReservationOrders") public interface ReservationOrdersService { @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Capacity/calculatePrice") + @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> calculate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PurchaseRequest body, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Capacity/reservationOrders") + @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + + @Put("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purchase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PurchaseRequest body, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> purchase(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PurchaseRequest body, @HeaderParam("Accept") String accept, Context context); + Response purchaseSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PurchaseRequest body, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}") + @Get("/providers/Microsoft.Capacity/reservationOrders") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + 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.Capacity/reservationOrders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> changeDirectory(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ChangeDirectoryRequest body, Context context); + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> changeDirectory(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ChangeDirectoryRequest body, @HeaderParam("Accept") String accept, - Context context); + Response changeDirectorySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ChangeDirectoryRequest body, Context context); + + @Post("/providers/Microsoft.Capacity/calculatePrice") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> calculate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PurchaseRequest body, Context context); + + @Post("/providers/Microsoft.Capacity/calculatePrice") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response calculateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PurchaseRequest body, 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); } /** - * Calculate price for a `ReservationOrder`. + * Get a specific `ReservationOrder`. * - * Calculate price for placing a `ReservationOrder`. + * Get the details of the `ReservationOrder`. * - * @param body Information needed for calculate or purchase reservation. + * @param reservationOrderId Order Id of the reservation. + * @param expand May be used to expand the planInformation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 calculate price for reservation along with {@link Response} on successful completion of - * {@link Mono}. + * @return a specific `ReservationOrder`. + * + * Get the details of the `ReservationOrder` along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> calculateWithResponseAsync(PurchaseRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } + private Mono> getWithResponseAsync(String reservationOrderId, + String expand) { final String apiVersion = "2022-11-01"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.calculate(this.client.getEndpoint(), apiVersion, body, accept, context)) + return FluxUtil.withContext( + context -> service.get(this.client.getEndpoint(), apiVersion, reservationOrderId, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Calculate price for a `ReservationOrder`. + * Get a specific `ReservationOrder`. * - * Calculate price for placing a `ReservationOrder`. + * Get the details of the `ReservationOrder`. * - * @param body Information needed for calculate or purchase reservation. - * @param context The context to associate with this operation. + * @param reservationOrderId Order Id of the reservation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 calculate price for reservation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> calculateWithResponseAsync(PurchaseRequest body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.calculate(this.client.getEndpoint(), apiVersion, body, accept, context); - } - - /** - * Calculate price for a `ReservationOrder`. + * @return a specific `ReservationOrder`. * - * Calculate price for placing a `ReservationOrder`. - * - * @param body Information needed for calculate or purchase reservation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 calculate price for reservation on successful completion of {@link Mono}. + * Get the details of the `ReservationOrder` on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono calculateAsync(PurchaseRequest body) { - return calculateWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String reservationOrderId) { + final String expand = null; + return getWithResponseAsync(reservationOrderId, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Calculate price for a `ReservationOrder`. + * Get a specific `ReservationOrder`. * - * Calculate price for placing a `ReservationOrder`. + * Get the details of the `ReservationOrder`. * - * @param body Information needed for calculate or purchase reservation. + * @param reservationOrderId Order Id of the reservation. + * @param expand May be used to expand the planInformation. * @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 calculate price for reservation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response calculateWithResponse(PurchaseRequest body, Context context) { - return calculateWithResponseAsync(body, context).block(); - } - - /** - * Calculate price for a `ReservationOrder`. - * - * Calculate price for placing a `ReservationOrder`. + * @return a specific `ReservationOrder`. * - * @param body Information needed for calculate or purchase reservation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 calculate price for reservation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CalculatePriceResponseInner calculate(PurchaseRequest body) { - return calculateWithResponse(body, Context.NONE).getValue(); - } - - /** - * Get all `ReservationOrder`s. - * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `ReservationOrder`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * Get the details of the `ReservationOrder` along with {@link Response}. */ @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 apiVersion = "2022-11-01"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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 all `ReservationOrder`s. - * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. - * - * @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 list of `ReservationOrder`s along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + public Response getWithResponse(String reservationOrderId, String expand, + Context context) { final String apiVersion = "2022-11-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.getSync(this.client.getEndpoint(), apiVersion, reservationOrderId, expand, accept, context); } /** - * Get all `ReservationOrder`s. - * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `ReservationOrder`s as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all `ReservationOrder`s. + * Get a specific `ReservationOrder`. * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. + * Get the details of the `ReservationOrder`. * - * @param context The context to associate with this operation. + * @param reservationOrderId Order Id of the reservation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `ReservationOrder`s as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all `ReservationOrder`s. - * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `ReservationOrder`s as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get all `ReservationOrder`s. + * @return a specific `ReservationOrder`. * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. - * - * @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 list of `ReservationOrder`s as paginated response with {@link PagedIterable}. + * Get the details of the `ReservationOrder`. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ReservationOrderResponseInner get(String reservationOrderId) { + final String expand = null; + return getWithResponse(reservationOrderId, expand, Context.NONE).getValue(); } /** @@ -357,24 +267,12 @@ public PagedIterable list(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> purchaseWithResponseAsync(String reservationOrderId, PurchaseRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.purchase(this.client.getEndpoint(), reservationOrderId, apiVersion, body, - accept, context)) + .withContext(context -> service.purchase(this.client.getEndpoint(), apiVersion, reservationOrderId, + contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -385,33 +283,18 @@ private Mono>> purchaseWithResponseAsync(String reserv * * @param reservationOrderId Order Id of the reservation. * @param body Information needed for calculate or purchase reservation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a reservation order being returned along with {@link Response} on successful completion of - * {@link Mono}. + * @return details of a reservation order being returned along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> purchaseWithResponseAsync(String reservationOrderId, PurchaseRequest body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } + private Response purchaseWithResponse(String reservationOrderId, PurchaseRequest body) { final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.purchase(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, context); + return service.purchaseSync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, accept, + body, Context.NONE); } /** @@ -421,18 +304,20 @@ private Mono>> purchaseWithResponseAsync(String reserv * * @param reservationOrderId Order Id of the reservation. * @param body Information needed for calculate or purchase reservation. + * @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 details of a reservation order being returned. + * @return details of a reservation order being returned along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReservationOrderResponseInner> - beginPurchaseAsync(String reservationOrderId, PurchaseRequest body) { - Mono>> mono = purchaseWithResponseAsync(reservationOrderId, body); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ReservationOrderResponseInner.class, ReservationOrderResponseInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response purchaseWithResponse(String reservationOrderId, PurchaseRequest body, + Context context) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.purchaseSync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, accept, + body, context); } /** @@ -442,7 +327,6 @@ private Mono>> purchaseWithResponseAsync(String reserv * * @param reservationOrderId Order Id of the reservation. * @param body Information needed for calculate or purchase reservation. - * @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. @@ -450,12 +334,11 @@ private Mono>> purchaseWithResponseAsync(String reserv */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ReservationOrderResponseInner> - beginPurchaseAsync(String reservationOrderId, PurchaseRequest body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = purchaseWithResponseAsync(reservationOrderId, body, context); + beginPurchaseAsync(String reservationOrderId, PurchaseRequest body) { + Mono>> mono = purchaseWithResponseAsync(reservationOrderId, body); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ReservationOrderResponseInner.class, ReservationOrderResponseInner.class, - context); + this.client.getContext()); } /** @@ -473,7 +356,9 @@ private Mono>> purchaseWithResponseAsync(String reserv @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ReservationOrderResponseInner> beginPurchase(String reservationOrderId, PurchaseRequest body) { - return this.beginPurchaseAsync(reservationOrderId, body).getSyncPoller(); + Response response = purchaseWithResponse(reservationOrderId, body); + return this.client.getLroResult(response, + ReservationOrderResponseInner.class, ReservationOrderResponseInner.class, Context.NONE); } /** @@ -492,7 +377,9 @@ private Mono>> purchaseWithResponseAsync(String reserv @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ReservationOrderResponseInner> beginPurchase(String reservationOrderId, PurchaseRequest body, Context context) { - return this.beginPurchaseAsync(reservationOrderId, body, context).getSyncPoller(); + Response response = purchaseWithResponse(reservationOrderId, body, context); + return this.client.getLroResult(response, + ReservationOrderResponseInner.class, ReservationOrderResponseInner.class, context); } /** @@ -512,26 +399,6 @@ private Mono purchaseAsync(String reservationOrde return beginPurchaseAsync(reservationOrderId, body).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Purchase `ReservationOrder` - * - * Purchase `ReservationOrder` and create resource under the specified URI. - * - * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for calculate or purchase reservation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a reservation order being returned on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono purchaseAsync(String reservationOrderId, PurchaseRequest body, - Context context) { - return beginPurchaseAsync(reservationOrderId, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Purchase `ReservationOrder` * @@ -546,7 +413,7 @@ private Mono purchaseAsync(String reservationOrde */ @ServiceMethod(returns = ReturnType.SINGLE) public ReservationOrderResponseInner purchase(String reservationOrderId, PurchaseRequest body) { - return purchaseAsync(reservationOrderId, body).block(); + return beginPurchase(reservationOrderId, body).getFinalResult(); } /** @@ -564,158 +431,127 @@ public ReservationOrderResponseInner purchase(String reservationOrderId, Purchas */ @ServiceMethod(returns = ReturnType.SINGLE) public ReservationOrderResponseInner purchase(String reservationOrderId, PurchaseRequest body, Context context) { - return purchaseAsync(reservationOrderId, body, context).block(); + return beginPurchase(reservationOrderId, body, context).getFinalResult(); } /** - * Get a specific `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Get the details of the `ReservationOrder`. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. - * @param expand May be used to expand the planInformation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 details of the `ReservationOrder` along with {@link Response} on successful completion of - * {@link Mono}. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String reservationOrderId, - String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } + private Mono> listSinglePageAsync() { final String apiVersion = "2022-11-01"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get(this.client.getEndpoint(), reservationOrderId, apiVersion, expand, accept, context)) + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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 a specific `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Get the details of the `ReservationOrder`. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. - * @param expand May be used to expand the planInformation. - * @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 details of the `ReservationOrder` along with {@link Response} on successful completion of - * {@link Mono}. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String reservationOrderId, String expand, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), reservationOrderId, apiVersion, expand, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get a specific `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Get the details of the `ReservationOrder`. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 details of the `ReservationOrder` on successful completion of {@link Mono}. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String reservationOrderId) { - final String expand = null; - return getWithResponseAsync(reservationOrderId, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage() { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), apiVersion, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get a specific `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Get the details of the `ReservationOrder`. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. - * @param expand May be used to expand the planInformation. * @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 details of the `ReservationOrder` along with {@link Response}. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String reservationOrderId, String expand, - Context context) { - return getWithResponseAsync(reservationOrderId, expand, context).block(); + private PagedResponse listSinglePage(Context context) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), apiVersion, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get a specific `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Get the details of the `ReservationOrder`. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 details of the `ReservationOrder`. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ReservationOrderResponseInner get(String reservationOrderId) { - final String expand = null; - return getWithResponse(reservationOrderId, expand, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Change directory of `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to change directory of reservation order. + * @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 change directory response along with {@link Response} on successful completion of {@link Mono}. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> changeDirectoryWithResponseAsync(String reservationOrderId, - ChangeDirectoryRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.changeDirectory(this.client.getEndpoint(), reservationOrderId, apiVersion, - body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -725,7 +561,6 @@ private Mono> changeDirectoryWithResponse * * @param reservationOrderId Order Id of the reservation. * @param body Information needed to change directory of reservation order. - * @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. @@ -733,25 +568,14 @@ private Mono> changeDirectoryWithResponse */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> changeDirectoryWithResponseAsync(String reservationOrderId, - ChangeDirectoryRequest body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } + ChangeDirectoryRequest body) { final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.changeDirectory(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, - context); + return FluxUtil + .withContext(context -> service.changeDirectory(this.client.getEndpoint(), apiVersion, reservationOrderId, + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -789,7 +613,11 @@ private Mono changeDirectoryAsync(String reservati @ServiceMethod(returns = ReturnType.SINGLE) public Response changeDirectoryWithResponse(String reservationOrderId, ChangeDirectoryRequest body, Context context) { - return changeDirectoryWithResponseAsync(reservationOrderId, body, context).block(); + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.changeDirectorySync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, + accept, body, context); } /** @@ -810,23 +638,96 @@ public ChangeDirectoryResponseInner changeDirectory(String reservationOrderId, C } /** + * Calculate price for a `ReservationOrder`. + * + * Calculate price for placing a `ReservationOrder`. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 calculate price for reservation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> calculateWithResponseAsync(PurchaseRequest body) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.calculate(this.client.getEndpoint(), apiVersion, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Calculate price for a `ReservationOrder`. + * + * Calculate price for placing a `ReservationOrder`. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 calculate price for reservation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono calculateAsync(PurchaseRequest body) { + return calculateWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Calculate price for a `ReservationOrder`. + * + * Calculate price for placing a `ReservationOrder`. + * + * @param body The request body. + * @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 calculate price for reservation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response calculateWithResponse(PurchaseRequest body, Context context) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.calculateSync(this.client.getEndpoint(), apiVersion, contentType, accept, body, context); + } + + /** + * Calculate price for a `ReservationOrder`. + * + * Calculate price for placing a `ReservationOrder`. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 calculate price for reservation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CalculatePriceResponseInner calculate(PurchaseRequest body) { + return calculateWithResponse(body, Context.NONE).getValue(); + } + + /** + * Get all `ReservationOrder`s. + * * 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 list of `ReservationOrder`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant 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(), @@ -835,6 +736,31 @@ private Mono> listNextSinglePageAsy } /** + * Get all `ReservationOrder`s. + * + * 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 all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant 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 all `ReservationOrder`s. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -842,22 +768,16 @@ private Mono> listNextSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `ReservationOrder`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant 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/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersImpl.java index 5a5bd9265e13..5750394c3712 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersImpl.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.reservations.implementation; @@ -33,35 +33,23 @@ public ReservationOrdersImpl(ReservationOrdersClient innerClient, this.serviceManager = serviceManager; } - public Response calculateWithResponse(PurchaseRequest body, Context context) { - Response inner = this.serviceClient().calculateWithResponse(body, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CalculatePriceResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getWithResponse(String reservationOrderId, String expand, + Context context) { + Response inner + = this.serviceClient().getWithResponse(reservationOrderId, expand, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ReservationOrderResponseImpl(inner.getValue(), this.manager())); } - public CalculatePriceResponse calculate(PurchaseRequest body) { - CalculatePriceResponseInner inner = this.serviceClient().calculate(body); + public ReservationOrderResponse get(String reservationOrderId) { + ReservationOrderResponseInner inner = this.serviceClient().get(reservationOrderId); if (inner != null) { - return new CalculatePriceResponseImpl(inner, this.manager()); + return new ReservationOrderResponseImpl(inner, this.manager()); } else { return null; } } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationOrderResponseImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationOrderResponseImpl(inner1, this.manager())); - } - public ReservationOrderResponse purchase(String reservationOrderId, PurchaseRequest body) { ReservationOrderResponseInner inner = this.serviceClient().purchase(reservationOrderId, body); if (inner != null) { @@ -80,43 +68,43 @@ public ReservationOrderResponse purchase(String reservationOrderId, PurchaseRequ } } - public Response getWithResponse(String reservationOrderId, String expand, - Context context) { - Response inner - = this.serviceClient().getWithResponse(reservationOrderId, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ReservationOrderResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationOrderResponseImpl(inner1, this.manager())); } - public ReservationOrderResponse get(String reservationOrderId) { - ReservationOrderResponseInner inner = this.serviceClient().get(reservationOrderId); - if (inner != null) { - return new ReservationOrderResponseImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationOrderResponseImpl(inner1, this.manager())); } public Response changeDirectoryWithResponse(String reservationOrderId, ChangeDirectoryRequest body, Context context) { Response inner = this.serviceClient().changeDirectoryWithResponse(reservationOrderId, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ChangeDirectoryResponseImpl(inner.getValue(), this.manager())); + } + + public ChangeDirectoryResponse changeDirectory(String reservationOrderId, ChangeDirectoryRequest body) { + ChangeDirectoryResponseInner inner = this.serviceClient().changeDirectory(reservationOrderId, body); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ChangeDirectoryResponseImpl(inner.getValue(), this.manager())); + return new ChangeDirectoryResponseImpl(inner, this.manager()); } else { return null; } } - public ChangeDirectoryResponse changeDirectory(String reservationOrderId, ChangeDirectoryRequest body) { - ChangeDirectoryResponseInner inner = this.serviceClient().changeDirectory(reservationOrderId, body); + public Response calculateWithResponse(PurchaseRequest body, Context context) { + Response inner = this.serviceClient().calculateWithResponse(body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CalculatePriceResponseImpl(inner.getValue(), this.manager())); + } + + public CalculatePriceResponse calculate(PurchaseRequest body) { + CalculatePriceResponseInner inner = this.serviceClient().calculate(body); if (inner != null) { - return new ChangeDirectoryResponseImpl(inner, this.manager()); + return new CalculatePriceResponseImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationResponseImpl.java index 298acdd03437..e91842424d9a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationResponseImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationResponseImpl.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.implementation; import com.azure.core.management.SystemData; import com.azure.resourcemanager.reservations.fluent.models.ReservationResponseInner; -import com.azure.resourcemanager.reservations.models.Kind; import com.azure.resourcemanager.reservations.models.ReservationResponse; +import com.azure.resourcemanager.reservations.models.ReservationResponseKind; import com.azure.resourcemanager.reservations.models.ReservationsProperties; import com.azure.resourcemanager.reservations.models.SkuName; @@ -34,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public ReservationsProperties properties() { + return this.innerModel().properties(); + } + public String location() { return this.innerModel().location(); } @@ -46,11 +50,7 @@ public SkuName sku() { return this.innerModel().sku(); } - public ReservationsProperties properties() { - return this.innerModel().properties(); - } - - public Kind kind() { + public ReservationResponseKind kind() { return this.innerModel().kind(); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsClientImpl.java index d9f1a52ae090..19eb0da40344 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsClientImpl.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.reservations.implementation; @@ -27,6 +27,7 @@ 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; @@ -35,11 +36,11 @@ import com.azure.resourcemanager.reservations.fluent.ReservationsClient; import com.azure.resourcemanager.reservations.fluent.models.AvailableScopePropertiesInner; import com.azure.resourcemanager.reservations.fluent.models.ReservationResponseInner; +import com.azure.resourcemanager.reservations.implementation.models.ReservationList; +import com.azure.resourcemanager.reservations.implementation.models.ReservationsListResult; import com.azure.resourcemanager.reservations.models.AvailableScopeRequest; import com.azure.resourcemanager.reservations.models.MergeRequest; import com.azure.resourcemanager.reservations.models.PatchModel; -import com.azure.resourcemanager.reservations.models.ReservationList; -import com.azure.resourcemanager.reservations.models.ReservationsListResult; import com.azure.resourcemanager.reservations.models.SplitRequest; import java.nio.ByteBuffer; import java.util.List; @@ -58,111 +59,191 @@ public final class ReservationsClientImpl implements ReservationsClient { /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of ReservationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ReservationsClientImpl(AzureReservationApiImpl client) { + ReservationsClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(ReservationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiReservations to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for ReservationsManagementClientReservations to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiR") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientReservations") public interface ReservationsService { @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes") + @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> availableScopes(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, - @PathParam("reservationId") String reservationId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AvailableScopeRequest body, @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split") + @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); + + @Patch("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> split(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SplitRequest body, @HeaderParam("Accept") String accept, Context context); + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchModel parameters, + Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge") + @Patch("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> merge(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MergeRequest body, @HeaderParam("Accept") String accept, Context context); + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchModel parameters, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}") + @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, - @PathParam("reservationId") String reservationId, @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}") - @ExpectedResponses({ 200, 202 }) + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, - @PathParam("reservationId") String reservationId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PatchModel parameters, @HeaderParam("Accept") String accept, + Mono>> availableScopes(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AvailableScopeRequest body, Context context); - @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response availableScopesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AvailableScopeRequest body, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/archive") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> archive(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/archive") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> archive(@HostParam("$host") String endpoint, + Response archiveSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, - @PathParam("reservationId") String reservationId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("reservationId") String reservationId, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/unarchive") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> unarchive(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, - @PathParam("reservationId") String reservationId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> unarchive(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/unarchive") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response unarchiveSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/revisions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listRevisions(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, - @PathParam("reservationId") String reservationId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> listRevisions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/revisions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listRevisionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> split(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SplitRequest body, Context context); + + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response splitSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SplitRequest body, Context context); + + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> merge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MergeRequest body, Context context); + + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response mergeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MergeRequest body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Capacity/reservations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAll(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, @QueryParam("refreshSummary") String refreshSummary, + @QueryParam("$skiptoken") Float skiptoken, @QueryParam("selectedState") String selectedState, + @QueryParam("take") Float take, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Capacity/reservations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAll(@HostParam("$host") String endpoint, + Response listAllSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, @QueryParam("refreshSummary") String refreshSummary, @QueryParam("$skiptoken") Float skiptoken, @QueryParam("selectedState") String selectedState, @@ -173,1618 +254,1343 @@ Mono> listAll(@HostParam("$host") String endpoi @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); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listRevisionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listRevisionsNextSync(@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> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAllNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get Available Scopes for `Reservation`. + * Get `Reservation` details. * - * Check whether the scopes from request is valid for `Reservation`. + * Get specific `Reservation` details. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. + * @param expand Supported value of this query is renewProperties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 available scope api containing scopes and their eligibilities along with {@link Response} - * on successful completion of {@link Mono}. + * @return `Reservation` details. + * + * Get specific `Reservation` details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> availableScopesWithResponseAsync(String reservationOrderId, - String reservationId, AvailableScopeRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } + private Mono> getWithResponseAsync(String reservationOrderId, + String reservationId, String expand) { final String apiVersion = "2022-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.availableScopes(this.client.getEndpoint(), reservationOrderId, - reservationId, apiVersion, body, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, reservationOrderId, + reservationId, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get Available Scopes for `Reservation`. + * Get `Reservation` details. * - * Check whether the scopes from request is valid for `Reservation`. + * Get specific `Reservation` details. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. - * @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 available scope api containing scopes and their eligibilities along with {@link Response} - * on successful completion of {@link Mono}. + * @return `Reservation` details. + * + * Get specific `Reservation` details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> availableScopesWithResponseAsync(String reservationOrderId, - String reservationId, AvailableScopeRequest body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.availableScopes(this.client.getEndpoint(), reservationOrderId, reservationId, apiVersion, body, - accept, context); + private Mono getAsync(String reservationOrderId, String reservationId) { + final String expand = null; + return getWithResponseAsync(reservationOrderId, reservationId, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get Available Scopes for `Reservation`. + * Get `Reservation` details. * - * Check whether the scopes from request is valid for `Reservation`. + * Get specific `Reservation` details. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. + * @param expand Supported value of this query is renewProperties. + * @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 response of available scope api containing scopes and their - * eligibilities. + * @return `Reservation` details. + * + * Get specific `Reservation` details along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AvailableScopePropertiesInner> - beginAvailableScopesAsync(String reservationOrderId, String reservationId, AvailableScopeRequest body) { - Mono>> mono - = availableScopesWithResponseAsync(reservationOrderId, reservationId, body); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AvailableScopePropertiesInner.class, AvailableScopePropertiesInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String reservationOrderId, String reservationId, + String expand, Context context) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), apiVersion, reservationOrderId, reservationId, expand, accept, + context); } /** - * Get Available Scopes for `Reservation`. + * Get `Reservation` details. * - * Check whether the scopes from request is valid for `Reservation`. + * Get specific `Reservation` details. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. - * @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 response of available scope api containing scopes and their - * eligibilities. + * @return `Reservation` details. + * + * Get specific `Reservation` details. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AvailableScopePropertiesInner> - beginAvailableScopesAsync(String reservationOrderId, String reservationId, AvailableScopeRequest body, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = availableScopesWithResponseAsync(reservationOrderId, reservationId, body, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AvailableScopePropertiesInner.class, AvailableScopePropertiesInner.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + public ReservationResponseInner get(String reservationOrderId, String reservationId) { + final String expand = null; + return getWithResponse(reservationOrderId, reservationId, expand, Context.NONE).getValue(); } /** - * Get Available Scopes for `Reservation`. + * Updates a `Reservation`. * - * Check whether the scopes from request is valid for `Reservation`. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. + * @param parameters Information needed to patch a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 response of available scope api containing scopes and their - * eligibilities. + * @return the definition of the reservation along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AvailableScopePropertiesInner> - beginAvailableScopes(String reservationOrderId, String reservationId, AvailableScopeRequest body) { - return this.beginAvailableScopesAsync(reservationOrderId, reservationId, body).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String reservationOrderId, String reservationId, + PatchModel parameters) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, reservationOrderId, + reservationId, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get Available Scopes for `Reservation`. + * Updates a `Reservation`. * - * Check whether the scopes from request is valid for `Reservation`. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. - * @param context The context to associate with this operation. + * @param parameters Information needed to patch a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 response of available scope api containing scopes and their - * eligibilities. + * @return the definition of the reservation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AvailableScopePropertiesInner> beginAvailableScopes( - String reservationOrderId, String reservationId, AvailableScopeRequest body, Context context) { - return this.beginAvailableScopesAsync(reservationOrderId, reservationId, body, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String reservationOrderId, String reservationId, + PatchModel parameters) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), apiVersion, reservationOrderId, reservationId, contentType, + accept, parameters, Context.NONE); } /** - * Get Available Scopes for `Reservation`. + * Updates a `Reservation`. * - * Check whether the scopes from request is valid for `Reservation`. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. + * @param parameters Information needed to patch a reservation item. + * @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 available scope api containing scopes and their eligibilities on successful completion of - * {@link Mono}. + * @return the definition of the reservation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono availableScopesAsync(String reservationOrderId, String reservationId, - AvailableScopeRequest body) { - return beginAvailableScopesAsync(reservationOrderId, reservationId, body).last() - .flatMap(this.client::getLroFinalResultOrError); + private Response updateWithResponse(String reservationOrderId, String reservationId, + PatchModel parameters, Context context) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), apiVersion, reservationOrderId, reservationId, contentType, + accept, parameters, context); } /** - * Get Available Scopes for `Reservation`. + * Updates a `Reservation`. * - * Check whether the scopes from request is valid for `Reservation`. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. - * @param context The context to associate with this operation. + * @param parameters Information needed to patch a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 available scope api containing scopes and their eligibilities on successful completion of - * {@link Mono}. + * @return the {@link PollerFlux} for polling of the definition of the reservation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono availableScopesAsync(String reservationOrderId, String reservationId, - AvailableScopeRequest body, Context context) { - return beginAvailableScopesAsync(reservationOrderId, reservationId, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReservationResponseInner> + beginUpdateAsync(String reservationOrderId, String reservationId, PatchModel parameters) { + Mono>> mono = updateWithResponseAsync(reservationOrderId, reservationId, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ReservationResponseInner.class, ReservationResponseInner.class, + this.client.getContext()); } /** - * Get Available Scopes for `Reservation`. + * Updates a `Reservation`. * - * Check whether the scopes from request is valid for `Reservation`. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. + * @param parameters Information needed to patch a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 available scope api containing scopes and their eligibilities. + * @return the {@link SyncPoller} for polling of the definition of the reservation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailableScopePropertiesInner availableScopes(String reservationOrderId, String reservationId, - AvailableScopeRequest body) { - return availableScopesAsync(reservationOrderId, reservationId, body).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReservationResponseInner> + beginUpdate(String reservationOrderId, String reservationId, PatchModel parameters) { + Response response = updateWithResponse(reservationOrderId, reservationId, parameters); + return this.client.getLroResult(response, + ReservationResponseInner.class, ReservationResponseInner.class, Context.NONE); } /** - * Get Available Scopes for `Reservation`. + * Updates a `Reservation`. * - * Check whether the scopes from request is valid for `Reservation`. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. + * @param parameters Information needed to patch a reservation item. * @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 available scope api containing scopes and their eligibilities. + * @return the {@link SyncPoller} for polling of the definition of the reservation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailableScopePropertiesInner availableScopes(String reservationOrderId, String reservationId, - AvailableScopeRequest body, Context context) { - return availableScopesAsync(reservationOrderId, reservationId, body, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReservationResponseInner> + beginUpdate(String reservationOrderId, String reservationId, PatchModel parameters, Context context) { + Response response = updateWithResponse(reservationOrderId, reservationId, parameters, context); + return this.client.getLroResult(response, + ReservationResponseInner.class, ReservationResponseInner.class, context); } /** - * Split the `Reservation`. + * Updates a `Reservation`. * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. + * @param reservationId Id of the reservation item. + * @param parameters Information needed to patch a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of ReservationResponse along with {@link Response} on successful completion of {@link Mono}. + * @return the definition of the reservation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> splitWithResponseAsync(String reservationOrderId, SplitRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.split(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono updateAsync(String reservationOrderId, String reservationId, + PatchModel parameters) { + return beginUpdateAsync(reservationOrderId, reservationId, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Split the `Reservation`. + * Updates a `Reservation`. * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. - * @param context The context to associate with this operation. + * @param reservationId Id of the reservation item. + * @param parameters Information needed to patch a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of ReservationResponse along with {@link Response} on successful completion of {@link Mono}. + * @return the definition of the reservation. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> splitWithResponseAsync(String reservationOrderId, SplitRequest body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.split(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, context); - } - - /** - * Split the `Reservation`. - * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. - * - * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 array of ReservationResponse. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux>, List> - beginSplitAsync(String reservationOrderId, SplitRequest body) { - Mono>> mono = splitWithResponseAsync(reservationOrderId, body); - return this.client., List>getLroResult(mono, - this.client.getHttpPipeline(), new TypeReference>() { - }.getJavaType(), new TypeReference>() { - }.getJavaType(), this.client.getContext()); + public ReservationResponseInner update(String reservationOrderId, String reservationId, PatchModel parameters) { + return beginUpdate(reservationOrderId, reservationId, parameters).getFinalResult(); } /** - * Split the `Reservation`. + * Updates a `Reservation`. * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. + * @param reservationId Id of the reservation item. + * @param parameters Information needed to patch a reservation item. * @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 array of ReservationResponse. + * @return the definition of the reservation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux>, List> - beginSplitAsync(String reservationOrderId, SplitRequest body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = splitWithResponseAsync(reservationOrderId, body, context); - return this.client., List>getLroResult(mono, - this.client.getHttpPipeline(), new TypeReference>() { - }.getJavaType(), new TypeReference>() { - }.getJavaType(), context); + @ServiceMethod(returns = ReturnType.SINGLE) + public ReservationResponseInner update(String reservationOrderId, String reservationId, PatchModel parameters, + Context context) { + return beginUpdate(reservationOrderId, reservationId, parameters, context).getFinalResult(); } /** - * Split the `Reservation`. + * Get `Reservation`s in a given reservation Order * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of ReservationResponse. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller>, List> - beginSplit(String reservationOrderId, SplitRequest body) { - return this.beginSplitAsync(reservationOrderId, body).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String reservationOrderId) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), apiVersion, reservationOrderId, 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())); } /** - * Split the `Reservation`. + * Get `Reservation`s in a given reservation Order * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. - * @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 array of ReservationResponse. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller>, List> - beginSplit(String reservationOrderId, SplitRequest body, Context context) { - return this.beginSplitAsync(reservationOrderId, body, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String reservationOrderId) { + return new PagedFlux<>(() -> listSinglePageAsync(reservationOrderId), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Split the `Reservation`. + * Get `Reservation`s in a given reservation Order * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of ReservationResponse on successful completion of {@link Mono}. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> splitAsync(String reservationOrderId, SplitRequest body) { - return beginSplitAsync(reservationOrderId, body).last().flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage(String reservationOrderId) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), apiVersion, reservationOrderId, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Split the `Reservation`. + * Get `Reservation`s in a given reservation Order * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. * @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 array of ReservationResponse on successful completion of {@link Mono}. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> splitAsync(String reservationOrderId, SplitRequest body, - Context context) { - return beginSplitAsync(reservationOrderId, body, context).last().flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage(String reservationOrderId, Context context) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), apiVersion, reservationOrderId, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Split the `Reservation`. + * Get `Reservation`s in a given reservation Order * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of ReservationResponse. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List split(String reservationOrderId, SplitRequest body) { - return splitAsync(reservationOrderId, body).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String reservationOrderId) { + return new PagedIterable<>(() -> listSinglePage(reservationOrderId), nextLink -> listNextSinglePage(nextLink)); } /** - * Split the `Reservation`. + * Get `Reservation`s in a given reservation Order * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. * @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 array of ReservationResponse. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List split(String reservationOrderId, SplitRequest body, Context context) { - return splitAsync(reservationOrderId, body, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String reservationOrderId, Context context) { + return new PagedIterable<>(() -> listSinglePage(reservationOrderId, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of ReservationResponse along with {@link Response} on successful completion of {@link Mono}. + * @return available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation` along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> mergeWithResponseAsync(String reservationOrderId, MergeRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } + private Mono>> availableScopesWithResponseAsync(String reservationOrderId, + String reservationId, AvailableScopeRequest body) { final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.merge(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, context)) + return FluxUtil + .withContext(context -> service.availableScopes(this.client.getEndpoint(), apiVersion, reservationOrderId, + reservationId, contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. - * @param context The context to associate with this operation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of ReservationResponse along with {@link Response} on successful completion of {@link Mono}. + * @return available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation` along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> mergeWithResponseAsync(String reservationOrderId, MergeRequest body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } + private Response availableScopesWithResponse(String reservationOrderId, String reservationId, + AvailableScopeRequest body) { final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.merge(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, context); + return service.availableScopesSync(this.client.getEndpoint(), apiVersion, reservationOrderId, reservationId, + contentType, accept, body, Context.NONE); } /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. + * @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 array of ReservationResponse. + * @return available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation` along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux>, List> - beginMergeAsync(String reservationOrderId, MergeRequest body) { - Mono>> mono = mergeWithResponseAsync(reservationOrderId, body); - return this.client., List>getLroResult(mono, - this.client.getHttpPipeline(), new TypeReference>() { - }.getJavaType(), new TypeReference>() { - }.getJavaType(), this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response availableScopesWithResponse(String reservationOrderId, String reservationId, + AvailableScopeRequest body, Context context) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.availableScopesSync(this.client.getEndpoint(), apiVersion, reservationOrderId, reservationId, + contentType, accept, body, context); } /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. - * @param context The context to associate with this operation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of ReservationResponse. + * @return the {@link PollerFlux} for polling of available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux>, List> - beginMergeAsync(String reservationOrderId, MergeRequest body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = mergeWithResponseAsync(reservationOrderId, body, context); - return this.client., List>getLroResult(mono, - this.client.getHttpPipeline(), new TypeReference>() { - }.getJavaType(), new TypeReference>() { - }.getJavaType(), context); + private PollerFlux, AvailableScopePropertiesInner> + beginAvailableScopesAsync(String reservationOrderId, String reservationId, AvailableScopeRequest body) { + Mono>> mono + = availableScopesWithResponseAsync(reservationOrderId, reservationId, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AvailableScopePropertiesInner.class, AvailableScopePropertiesInner.class, + this.client.getContext()); } /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of ReservationResponse. + * @return the {@link SyncPoller} for polling of available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller>, List> - beginMerge(String reservationOrderId, MergeRequest body) { - return this.beginMergeAsync(reservationOrderId, body).getSyncPoller(); + public SyncPoller, AvailableScopePropertiesInner> + beginAvailableScopes(String reservationOrderId, String reservationId, AvailableScopeRequest body) { + Response response = availableScopesWithResponse(reservationOrderId, reservationId, body); + return this.client.getLroResult(response, + AvailableScopePropertiesInner.class, AvailableScopePropertiesInner.class, Context.NONE); } /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @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 array of ReservationResponse. + * @return the {@link SyncPoller} for polling of available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller>, List> - beginMerge(String reservationOrderId, MergeRequest body, Context context) { - return this.beginMergeAsync(reservationOrderId, body, context).getSyncPoller(); + public SyncPoller, AvailableScopePropertiesInner> beginAvailableScopes( + String reservationOrderId, String reservationId, AvailableScopeRequest body, Context context) { + Response response = availableScopesWithResponse(reservationOrderId, reservationId, body, context); + return this.client.getLroResult(response, + AvailableScopePropertiesInner.class, AvailableScopePropertiesInner.class, context); } /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of ReservationResponse on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> mergeAsync(String reservationOrderId, MergeRequest body) { - return beginMergeAsync(reservationOrderId, body).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Merges two `Reservation`s. + * @return available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. - * - * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. - * @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 array of ReservationResponse on successful completion of {@link Mono}. + * Check whether the scopes from request is valid for `Reservation` on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> mergeAsync(String reservationOrderId, MergeRequest body, - Context context) { - return beginMergeAsync(reservationOrderId, body, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono availableScopesAsync(String reservationOrderId, String reservationId, + AvailableScopeRequest body) { + return beginAvailableScopesAsync(reservationOrderId, reservationId, body).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of ReservationResponse. + * @return available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ @ServiceMethod(returns = ReturnType.SINGLE) - public List merge(String reservationOrderId, MergeRequest body) { - return mergeAsync(reservationOrderId, body).block(); + public AvailableScopePropertiesInner availableScopes(String reservationOrderId, String reservationId, + AvailableScopeRequest body) { + return beginAvailableScopes(reservationOrderId, reservationId, body).getFinalResult(); } /** - * Merges two `Reservation`s. + * Get Available Scopes for `Reservation`. * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @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 array of ReservationResponse. + * @return available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ @ServiceMethod(returns = ReturnType.SINGLE) - public List merge(String reservationOrderId, MergeRequest body, Context context) { - return mergeAsync(reservationOrderId, body, context).block(); + public AvailableScopePropertiesInner availableScopes(String reservationOrderId, String reservationId, + AvailableScopeRequest body, Context context) { + return beginAvailableScopes(reservationOrderId, reservationId, body, context).getFinalResult(); } /** - * Get `Reservation`s in a given reservation Order + * Archive a `Reservation`. * - * List `Reservation`s within a single `ReservationOrder`. + * Archiving a `Reservation` moves it to `Archived` state. * * @param reservationOrderId Order Id of the reservation. + * @param reservationId Id of the reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `Reservation`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String reservationOrderId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } + private Mono> archiveWithResponseAsync(String reservationOrderId, String reservationId) { final String apiVersion = "2022-11-01"; - final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), reservationOrderId, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.archive(this.client.getEndpoint(), apiVersion, reservationOrderId, + reservationId, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get `Reservation`s in a given reservation Order - * - * List `Reservation`s within a single `ReservationOrder`. - * - * @param reservationOrderId Order Id of the reservation. - * @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 list of `Reservation`s along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String reservationOrderId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), reservationOrderId, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get `Reservation`s in a given reservation Order - * - * List `Reservation`s within a single `ReservationOrder`. - * - * @param reservationOrderId Order Id of the reservation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `Reservation`s as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String reservationOrderId) { - return new PagedFlux<>(() -> listSinglePageAsync(reservationOrderId), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get `Reservation`s in a given reservation Order - * - * List `Reservation`s within a single `ReservationOrder`. - * - * @param reservationOrderId Order Id of the reservation. - * @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 list of `Reservation`s as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String reservationOrderId, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(reservationOrderId, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get `Reservation`s in a given reservation Order - * - * List `Reservation`s within a single `ReservationOrder`. - * - * @param reservationOrderId Order Id of the reservation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `Reservation`s as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String reservationOrderId) { - return new PagedIterable<>(listAsync(reservationOrderId)); - } - - /** - * Get `Reservation`s in a given reservation Order - * - * List `Reservation`s within a single `ReservationOrder`. - * - * @param reservationOrderId Order Id of the reservation. - * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String reservationOrderId, Context context) { - return new PagedIterable<>(listAsync(reservationOrderId, context)); - } - - /** - * Get `Reservation` details. + * Archive a `Reservation`. * - * Get specific `Reservation` details. + * Archiving a `Reservation` moves it to `Archived` state. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param expand Supported value of this query is renewProperties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific `Reservation` details along with {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String reservationOrderId, - String reservationId, String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), reservationOrderId, reservationId, - apiVersion, expand, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono archiveAsync(String reservationOrderId, String reservationId) { + return archiveWithResponseAsync(reservationOrderId, reservationId).flatMap(ignored -> Mono.empty()); } /** - * Get `Reservation` details. + * Archive a `Reservation`. * - * Get specific `Reservation` details. + * Archiving a `Reservation` moves it to `Archived` state. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param expand Supported value of this query is renewProperties. * @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 specific `Reservation` details along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String reservationOrderId, - String reservationId, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } + public Response archiveWithResponse(String reservationOrderId, String reservationId, Context context) { final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), reservationOrderId, reservationId, apiVersion, expand, accept, - context); + return service.archiveSync(this.client.getEndpoint(), apiVersion, reservationOrderId, reservationId, context); } /** - * Get `Reservation` details. + * Archive a `Reservation`. * - * Get specific `Reservation` details. + * Archiving a `Reservation` moves it to `Archived` state. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific `Reservation` details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String reservationOrderId, String reservationId) { - final String expand = null; - return getWithResponseAsync(reservationOrderId, reservationId, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public void archive(String reservationOrderId, String reservationId) { + archiveWithResponse(reservationOrderId, reservationId, Context.NONE); } /** - * Get `Reservation` details. + * Unarchive a `Reservation`. * - * Get specific `Reservation` details. + * Restores a `Reservation` to the state it was before archiving. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param expand Supported value of this query is renewProperties. - * @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 specific `Reservation` details along with {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String reservationOrderId, String reservationId, - String expand, Context context) { - return getWithResponseAsync(reservationOrderId, reservationId, expand, context).block(); + private Mono> unarchiveWithResponseAsync(String reservationOrderId, String reservationId) { + final String apiVersion = "2022-11-01"; + return FluxUtil + .withContext(context -> service.unarchive(this.client.getEndpoint(), apiVersion, reservationOrderId, + reservationId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get `Reservation` details. + * Unarchive a `Reservation`. * - * Get specific `Reservation` details. + * Restores a `Reservation` to the state it was before archiving. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific `Reservation` details. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ReservationResponseInner get(String reservationOrderId, String reservationId) { - final String expand = null; - return getWithResponse(reservationOrderId, reservationId, expand, Context.NONE).getValue(); + private Mono unarchiveAsync(String reservationOrderId, String reservationId) { + return unarchiveWithResponseAsync(reservationOrderId, reservationId).flatMap(ignored -> Mono.empty()); } /** - * Updates a `Reservation`. + * Unarchive a `Reservation`. * - * Updates the applied scopes of the `Reservation`. + * Restores a `Reservation` to the state it was before archiving. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. + * @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 definition of the reservation along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String reservationOrderId, String reservationId, - PatchModel parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + public Response unarchiveWithResponse(String reservationOrderId, String reservationId, Context context) { final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), reservationOrderId, reservationId, - apiVersion, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.unarchiveSync(this.client.getEndpoint(), apiVersion, reservationOrderId, reservationId, context); } /** - * Updates a `Reservation`. + * Unarchive a `Reservation`. * - * Updates the applied scopes of the `Reservation`. + * Restores a `Reservation` to the state it was before archiving. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. - * @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 definition of the reservation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String reservationOrderId, String reservationId, - PatchModel parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), reservationOrderId, reservationId, apiVersion, parameters, - accept, context); + public void unarchive(String reservationOrderId, String reservationId) { + unarchiveWithResponse(reservationOrderId, reservationId, Context.NONE); } /** - * Updates a `Reservation`. + * Get `Reservation` revisions. * - * Updates the applied scopes of the `Reservation`. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 definition of the reservation. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReservationResponseInner> - beginUpdateAsync(String reservationOrderId, String reservationId, PatchModel parameters) { - Mono>> mono = updateWithResponseAsync(reservationOrderId, reservationId, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ReservationResponseInner.class, ReservationResponseInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsSinglePageAsync(String reservationOrderId, + String reservationId) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRevisions(this.client.getEndpoint(), apiVersion, reservationOrderId, + reservationId, 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())); } /** - * Updates a `Reservation`. + * Get `Reservation` revisions. * - * Updates the applied scopes of the `Reservation`. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. - * @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 definition of the reservation. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReservationResponseInner> - beginUpdateAsync(String reservationOrderId, String reservationId, PatchModel parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(reservationOrderId, reservationId, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ReservationResponseInner.class, ReservationResponseInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRevisionsAsync(String reservationOrderId, String reservationId) { + return new PagedFlux<>(() -> listRevisionsSinglePageAsync(reservationOrderId, reservationId), + nextLink -> listRevisionsNextSinglePageAsync(nextLink)); } /** - * Updates a `Reservation`. + * Get `Reservation` revisions. * - * Updates the applied scopes of the `Reservation`. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 definition of the reservation. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReservationResponseInner> - beginUpdate(String reservationOrderId, String reservationId, PatchModel parameters) { - return this.beginUpdateAsync(reservationOrderId, reservationId, parameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listRevisionsSinglePage(String reservationOrderId, + String reservationId) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res = service.listRevisionsSync(this.client.getEndpoint(), apiVersion, + reservationOrderId, reservationId, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Updates a `Reservation`. + * Get `Reservation` revisions. * - * Updates the applied scopes of the `Reservation`. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. * @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 definition of the reservation. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReservationResponseInner> - beginUpdate(String reservationOrderId, String reservationId, PatchModel parameters, Context context) { - return this.beginUpdateAsync(reservationOrderId, reservationId, parameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listRevisionsSinglePage(String reservationOrderId, + String reservationId, Context context) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res = service.listRevisionsSync(this.client.getEndpoint(), apiVersion, + reservationOrderId, reservationId, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Updates a `Reservation`. + * Get `Reservation` revisions. * - * Updates the applied scopes of the `Reservation`. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 definition of the reservation on successful completion of {@link Mono}. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String reservationOrderId, String reservationId, - PatchModel parameters) { - return beginUpdateAsync(reservationOrderId, reservationId, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRevisions(String reservationOrderId, String reservationId) { + return new PagedIterable<>(() -> listRevisionsSinglePage(reservationOrderId, reservationId), + nextLink -> listRevisionsNextSinglePage(nextLink)); } /** - * Updates a `Reservation`. + * Get `Reservation` revisions. * - * Updates the applied scopes of the `Reservation`. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. * @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 definition of the reservation on successful completion of {@link Mono}. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String reservationOrderId, String reservationId, - PatchModel parameters, Context context) { - return beginUpdateAsync(reservationOrderId, reservationId, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRevisions(String reservationOrderId, String reservationId, + Context context) { + return new PagedIterable<>(() -> listRevisionsSinglePage(reservationOrderId, reservationId, context), + nextLink -> listRevisionsNextSinglePage(nextLink, context)); } /** - * Updates a `Reservation`. + * Split the `Reservation`. * - * Updates the applied scopes of the `Reservation`. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. + * @param body Information needed to Split a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 definition of the reservation. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ReservationResponseInner update(String reservationOrderId, String reservationId, PatchModel parameters) { - return updateAsync(reservationOrderId, reservationId, parameters).block(); + private Mono>> splitWithResponseAsync(String reservationOrderId, SplitRequest body) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.split(this.client.getEndpoint(), apiVersion, reservationOrderId, + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a `Reservation`. + * Split the `Reservation`. * - * Updates the applied scopes of the `Reservation`. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. - * @param context The context to associate with this operation. + * @param body Information needed to Split a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 definition of the reservation. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ReservationResponseInner update(String reservationOrderId, String reservationId, PatchModel parameters, - Context context) { - return updateAsync(reservationOrderId, reservationId, parameters, context).block(); + private Response splitWithResponse(String reservationOrderId, SplitRequest body) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.splitSync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, accept, body, + Context.NONE); } /** - * Archive a `Reservation`. + * Split the `Reservation`. * - * Archiving a `Reservation` moves it to `Archived` state. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed to Split a reservation item. + * @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> archiveWithResponseAsync(String reservationOrderId, String reservationId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } + private Response splitWithResponse(String reservationOrderId, SplitRequest body, Context context) { final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.archive(this.client.getEndpoint(), reservationOrderId, reservationId, - apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.splitSync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, accept, body, + context); } /** - * Archive a `Reservation`. + * Split the `Reservation`. * - * Archiving a `Reservation` moves it to `Archived` state. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param context The context to associate with this operation. + * @param body Information needed to Split a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> archiveWithResponseAsync(String reservationOrderId, String reservationId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.archive(this.client.getEndpoint(), reservationOrderId, reservationId, apiVersion, accept, - context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux>, List> + beginSplitAsync(String reservationOrderId, SplitRequest body) { + Mono>> mono = splitWithResponseAsync(reservationOrderId, body); + return this.client., List>getLroResult(mono, + this.client.getHttpPipeline(), new TypeReference>() { + }.getJavaType(), new TypeReference>() { + }.getJavaType(), this.client.getContext()); } /** - * Archive a `Reservation`. + * Split the `Reservation`. * - * Archiving a `Reservation` moves it to `Archived` state. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed to Split a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono archiveAsync(String reservationOrderId, String reservationId) { - return archiveWithResponseAsync(reservationOrderId, reservationId).flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>, List> + beginSplit(String reservationOrderId, SplitRequest body) { + Response response = splitWithResponse(reservationOrderId, body); + return this.client., List>getLroResult(response, + new TypeReference>() { + }.getJavaType(), new TypeReference>() { + }.getJavaType(), Context.NONE); } /** - * Archive a `Reservation`. + * Split the `Reservation`. * - * Archiving a `Reservation` moves it to `Archived` state. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed to Split a reservation item. * @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}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response archiveWithResponse(String reservationOrderId, String reservationId, Context context) { - return archiveWithResponseAsync(reservationOrderId, reservationId, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>, List> + beginSplit(String reservationOrderId, SplitRequest body, Context context) { + Response response = splitWithResponse(reservationOrderId, body, context); + return this.client., List>getLroResult(response, + new TypeReference>() { + }.getJavaType(), new TypeReference>() { + }.getJavaType(), context); } /** - * Archive a `Reservation`. + * Split the `Reservation`. * - * Archiving a `Reservation` moves it to `Archived` state. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed to Split a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void archive(String reservationOrderId, String reservationId) { - archiveWithResponse(reservationOrderId, reservationId, Context.NONE); + private Mono> splitAsync(String reservationOrderId, SplitRequest body) { + return beginSplitAsync(reservationOrderId, body).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Unarchive a `Reservation`. + * Split the `Reservation`. * - * Restores a `Reservation` to the state it was before archiving. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed to Split a reservation item. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> unarchiveWithResponseAsync(String reservationOrderId, String reservationId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.unarchive(this.client.getEndpoint(), reservationOrderId, reservationId, - apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public List split(String reservationOrderId, SplitRequest body) { + return beginSplit(reservationOrderId, body).getFinalResult(); } /** - * Unarchive a `Reservation`. + * Split the `Reservation`. * - * Restores a `Reservation` to the state it was before archiving. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed to Split a reservation item. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> unarchiveWithResponseAsync(String reservationOrderId, String reservationId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.unarchive(this.client.getEndpoint(), reservationOrderId, reservationId, apiVersion, accept, - context); + public List split(String reservationOrderId, SplitRequest body, Context context) { + return beginSplit(reservationOrderId, body, context).getFinalResult(); } /** - * Unarchive a `Reservation`. + * Merges two `Reservation`s. * - * Restores a `Reservation` to the state it was before archiving. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono unarchiveAsync(String reservationOrderId, String reservationId) { - return unarchiveWithResponseAsync(reservationOrderId, reservationId).flatMap(ignored -> Mono.empty()); + private Mono>> mergeWithResponseAsync(String reservationOrderId, MergeRequest body) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.merge(this.client.getEndpoint(), apiVersion, reservationOrderId, + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Unarchive a `Reservation`. + * Merges two `Reservation`s. * - * Restores a `Reservation` to the state it was before archiving. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param context The context to associate with this operation. + * @param body Information needed for commercial request for a reservation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response unarchiveWithResponse(String reservationOrderId, String reservationId, Context context) { - return unarchiveWithResponseAsync(reservationOrderId, reservationId, context).block(); + private Response mergeWithResponse(String reservationOrderId, MergeRequest body) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.mergeSync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, accept, body, + Context.NONE); } /** - * Unarchive a `Reservation`. + * Merges two `Reservation`s. * - * Restores a `Reservation` to the state it was before archiving. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void unarchive(String reservationOrderId, String reservationId) { - unarchiveWithResponse(reservationOrderId, reservationId, Context.NONE); + private Response mergeWithResponse(String reservationOrderId, MergeRequest body, Context context) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.mergeSync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, accept, body, + context); } /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `Reservation`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRevisionsSinglePageAsync(String reservationOrderId, - String reservationId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listRevisions(this.client.getEndpoint(), reservationOrderId, reservationId, - apiVersion, 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())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux>, List> + beginMergeAsync(String reservationOrderId, MergeRequest body) { + Mono>> mono = mergeWithResponseAsync(reservationOrderId, body); + return this.client., List>getLroResult(mono, + this.client.getHttpPipeline(), new TypeReference>() { + }.getJavaType(), new TypeReference>() { + }.getJavaType(), this.client.getContext()); } /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param context The context to associate with this operation. + * @param body Information needed for commercial request for a reservation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `Reservation`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRevisionsSinglePageAsync(String reservationOrderId, - String reservationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (reservationId == null) { - return Mono.error(new IllegalArgumentException("Parameter reservationId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listRevisions(this.client.getEndpoint(), reservationOrderId, reservationId, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>, List> + beginMerge(String reservationOrderId, MergeRequest body) { + Response response = mergeWithResponse(reservationOrderId, body); + return this.client., List>getLroResult(response, + new TypeReference>() { + }.getJavaType(), new TypeReference>() { + }.getJavaType(), Context.NONE); } /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. + * @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 list of `Reservation`s as paginated response with {@link PagedFlux}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listRevisionsAsync(String reservationOrderId, String reservationId) { - return new PagedFlux<>(() -> listRevisionsSinglePageAsync(reservationOrderId, reservationId), - nextLink -> listRevisionsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>, List> + beginMerge(String reservationOrderId, MergeRequest body, Context context) { + Response response = mergeWithResponse(reservationOrderId, body, context); + return this.client., List>getLroResult(response, + new TypeReference>() { + }.getJavaType(), new TypeReference>() { + }.getJavaType(), context); } /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param context The context to associate with this operation. + * @param body Information needed for commercial request for a reservation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `Reservation`s as paginated response with {@link PagedFlux}. + * @return the response body on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listRevisionsAsync(String reservationOrderId, String reservationId, - Context context) { - return new PagedFlux<>(() -> listRevisionsSinglePageAsync(reservationOrderId, reservationId, context), - nextLink -> listRevisionsNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> mergeAsync(String reservationOrderId, MergeRequest body) { + return beginMergeAsync(reservationOrderId, body).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `Reservation`s as paginated response with {@link PagedIterable}. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRevisions(String reservationOrderId, String reservationId) { - return new PagedIterable<>(listRevisionsAsync(reservationOrderId, reservationId)); + @ServiceMethod(returns = ReturnType.SINGLE) + public List merge(String reservationOrderId, MergeRequest body) { + return beginMerge(reservationOrderId, body).getFinalResult(); } /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listRevisions(String reservationOrderId, String reservationId, - Context context) { - return new PagedIterable<>(listRevisionsAsync(reservationOrderId, reservationId, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public List merge(String reservationOrderId, MergeRequest body, Context context) { + return beginMerge(reservationOrderId, body, context).getFinalResult(); } /** @@ -1811,10 +1617,6 @@ public PagedIterable listRevisions(String reservationO @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAllSinglePageAsync(String filter, String orderby, String refreshSummary, Float skiptoken, String selectedState, Float take) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String apiVersion = "2022-11-01"; final String accept = "application/json"; return FluxUtil @@ -1825,45 +1627,6 @@ private Mono> listAllSinglePageAsync(Str .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * List the reservations and the roll up counts of reservations group by provisioning states that the user has - * access to in the current tenant. - * - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, - * properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, - * expiryDateTime, provisioningState, quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType, - * userFriendlyRenewState}. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. - * @param skiptoken The number of reservations to skip from the list before returning results. - * @param selectedState The selected provisioning state. - * @param take To number of reservations to return. - * @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 reservations and summary of roll out count of reservations in each state along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync(String filter, String orderby, - String refreshSummary, Float skiptoken, String selectedState, Float take, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAll(this.client.getEndpoint(), apiVersion, filter, orderby, refreshSummary, skiptoken, selectedState, - take, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * List the reservations and the roll up counts of reservations group by provisioning states that the user has * access to in the current tenant. @@ -1915,6 +1678,38 @@ private PagedFlux listAllAsync() { nextLink -> listAllNextSinglePageAsync(nextLink)); } + /** + * List the reservations and the roll up counts of reservations group by provisioning states that the user has + * access to in the current tenant. + * + * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does + * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, + * properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, + * expiryDateTime, provisioningState, quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType, + * userFriendlyRenewState}. + * @param orderby May be used to sort order by reservation properties. + * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning + * states. + * @param skiptoken The number of reservations to skip from the list before returning results. + * @param selectedState The selected provisioning state. + * @param take To number of reservations to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 reservations and summary of roll out count of reservations in each state along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAllSinglePage(String filter, String orderby, + String refreshSummary, Float skiptoken, String selectedState, Float take) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res = service.listAllSync(this.client.getEndpoint(), apiVersion, filter, + orderby, refreshSummary, skiptoken, selectedState, take, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * List the reservations and the roll up counts of reservations group by provisioning states that the user has * access to in the current tenant. @@ -1934,15 +1729,18 @@ private PagedFlux listAllAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservations and summary of roll out count of reservations in each state as paginated - * response with {@link PagedFlux}. + * @return the list of reservations and summary of roll out count of reservations in each state along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync(String filter, String orderby, String refreshSummary, - Float skiptoken, String selectedState, Float take, Context context) { - return new PagedFlux<>( - () -> listAllSinglePageAsync(filter, orderby, refreshSummary, skiptoken, selectedState, take, context), - nextLink -> listAllNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAllSinglePage(String filter, String orderby, + String refreshSummary, Float skiptoken, String selectedState, Float take, Context context) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res = service.listAllSync(this.client.getEndpoint(), apiVersion, filter, + orderby, refreshSummary, skiptoken, selectedState, take, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1962,7 +1760,9 @@ public PagedIterable listAll() { final Float skiptoken = null; final String selectedState = null; final Float take = null; - return new PagedIterable<>(listAllAsync(filter, orderby, refreshSummary, skiptoken, selectedState, take)); + return new PagedIterable<>( + () -> listAllSinglePage(filter, orderby, refreshSummary, skiptoken, selectedState, take), + nextLink -> listAllNextSinglePage(nextLink)); } /** @@ -1991,27 +1791,26 @@ public PagedIterable listAll() { public PagedIterable listAll(String filter, String orderby, String refreshSummary, Float skiptoken, String selectedState, Float take, Context context) { return new PagedIterable<>( - listAllAsync(filter, orderby, refreshSummary, skiptoken, selectedState, take, context)); + () -> listAllSinglePage(filter, orderby, refreshSummary, skiptoken, selectedState, take, context), + nextLink -> listAllNextSinglePage(nextLink, context)); } /** + * Get `Reservation`s in a given reservation Order + * * 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 list of `Reservation`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` 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(), @@ -2020,6 +1819,29 @@ private Mono> listNextSinglePageAsync(St } /** + * Get `Reservation`s in a given reservation Order + * + * 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 `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` 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 `Reservation`s in a given reservation Order + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2027,42 +1849,34 @@ 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 list of `Reservation`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` 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); } /** + * Get `Reservation` revisions. + * * 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 list of `Reservation`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listRevisionsNextSinglePageAsync(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.listRevisionsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -2072,6 +1886,30 @@ private Mono> listRevisionsNextSinglePag } /** + * Get `Reservation` revisions. + * + * 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 `Reservation` revisions. + * + * List of all the revisions for the `Reservation` along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listRevisionsNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listRevisionsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get `Reservation` revisions. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2079,23 +1917,17 @@ private Mono> listRevisionsNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of `Reservation`s along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRevisionsNextSinglePageAsync(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 listRevisionsNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listRevisionsNext(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.listRevisionsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2110,13 +1942,6 @@ private Mono> listRevisionsNextSinglePag */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAllNextSinglePageAsync(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.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -2125,6 +1950,25 @@ private Mono> listAllNextSinglePageAsync .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 reservations and summary of roll out count of reservations in each state along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAllNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listAllNextSync(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. * @@ -2134,21 +1978,18 @@ private Mono> listAllNextSinglePageAsync * @throws 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 reservations and summary of roll out count of reservations in each state along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(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 listAllNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAllNext(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.listAllNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final TypeReference> TYPE_REFERENCE_LIST_RESERVATION_RESPONSE_INNER + = new TypeReference>() { + }; } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsImpl.java index 5a3857d32b6e..fec2d593d41b 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsImpl.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.reservations.implementation; @@ -36,69 +36,40 @@ public ReservationsImpl(ReservationsClient innerClient, this.serviceManager = serviceManager; } - public AvailableScopeProperties availableScopes(String reservationOrderId, String reservationId, - AvailableScopeRequest body) { - AvailableScopePropertiesInner inner - = this.serviceClient().availableScopes(reservationOrderId, reservationId, body); - if (inner != null) { - return new AvailableScopePropertiesImpl(inner, this.manager()); - } else { - return null; - } + public Response getWithResponse(String reservationOrderId, String reservationId, String expand, + Context context) { + Response inner + = this.serviceClient().getWithResponse(reservationOrderId, reservationId, expand, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ReservationResponseImpl(inner.getValue(), this.manager())); } - public AvailableScopeProperties availableScopes(String reservationOrderId, String reservationId, - AvailableScopeRequest body, Context context) { - AvailableScopePropertiesInner inner - = this.serviceClient().availableScopes(reservationOrderId, reservationId, body, context); + public ReservationResponse get(String reservationOrderId, String reservationId) { + ReservationResponseInner inner = this.serviceClient().get(reservationOrderId, reservationId); if (inner != null) { - return new AvailableScopePropertiesImpl(inner, this.manager()); + return new ReservationResponseImpl(inner, this.manager()); } else { return null; } } - public List split(String reservationOrderId, SplitRequest body) { - List inner = this.serviceClient().split(reservationOrderId, body); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new ReservationResponseImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public List split(String reservationOrderId, SplitRequest body, Context context) { - List inner = this.serviceClient().split(reservationOrderId, body, context); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new ReservationResponseImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public List merge(String reservationOrderId, MergeRequest body) { - List inner = this.serviceClient().merge(reservationOrderId, body); + public ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters) { + ReservationResponseInner inner = this.serviceClient().update(reservationOrderId, reservationId, parameters); if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new ReservationResponseImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return new ReservationResponseImpl(inner, this.manager()); } else { - return Collections.emptyList(); + return null; } } - public List merge(String reservationOrderId, MergeRequest body, Context context) { - List inner = this.serviceClient().merge(reservationOrderId, body, context); + public ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters, + Context context) { + ReservationResponseInner inner + = this.serviceClient().update(reservationOrderId, reservationId, parameters, context); if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new ReservationResponseImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return new ReservationResponseImpl(inner, this.manager()); } else { - return Collections.emptyList(); + return null; } } @@ -112,42 +83,23 @@ public PagedIterable list(String reservationOrderId, Contex return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationResponseImpl(inner1, this.manager())); } - public Response getWithResponse(String reservationOrderId, String reservationId, String expand, - Context context) { - Response inner - = this.serviceClient().getWithResponse(reservationOrderId, reservationId, expand, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ReservationResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ReservationResponse get(String reservationOrderId, String reservationId) { - ReservationResponseInner inner = this.serviceClient().get(reservationOrderId, reservationId); - if (inner != null) { - return new ReservationResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters) { - ReservationResponseInner inner = this.serviceClient().update(reservationOrderId, reservationId, parameters); + public AvailableScopeProperties availableScopes(String reservationOrderId, String reservationId, + AvailableScopeRequest body) { + AvailableScopePropertiesInner inner + = this.serviceClient().availableScopes(reservationOrderId, reservationId, body); if (inner != null) { - return new ReservationResponseImpl(inner, this.manager()); + return new AvailableScopePropertiesImpl(inner, this.manager()); } else { return null; } } - public ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters, - Context context) { - ReservationResponseInner inner - = this.serviceClient().update(reservationOrderId, reservationId, parameters, context); + public AvailableScopeProperties availableScopes(String reservationOrderId, String reservationId, + AvailableScopeRequest body, Context context) { + AvailableScopePropertiesInner inner + = this.serviceClient().availableScopes(reservationOrderId, reservationId, body, context); if (inner != null) { - return new ReservationResponseImpl(inner, this.manager()); + return new AvailableScopePropertiesImpl(inner, this.manager()); } else { return null; } @@ -182,6 +134,50 @@ public PagedIterable listRevisions(String reservationOrderI return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationResponseImpl(inner1, this.manager())); } + public List split(String reservationOrderId, SplitRequest body) { + List inner = this.serviceClient().split(reservationOrderId, body); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ReservationResponseImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List split(String reservationOrderId, SplitRequest body, Context context) { + List inner = this.serviceClient().split(reservationOrderId, body, context); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ReservationResponseImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List merge(String reservationOrderId, MergeRequest body) { + List inner = this.serviceClient().merge(reservationOrderId, body); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ReservationResponseImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List merge(String reservationOrderId, MergeRequest body, Context context) { + List inner = this.serviceClient().merge(reservationOrderId, body, context); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ReservationResponseImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + public PagedIterable listAll() { PagedIterable inner = this.serviceClient().listAll(); return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationResponseImpl(inner1, this.manager())); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiBuilder.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsManagementClientBuilder.java similarity index 65% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiBuilder.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsManagementClientBuilder.java index c0469cc8d892..d9b4defbcf11 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiBuilder.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsManagementClientBuilder.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.reservations.implementation; @@ -15,22 +15,22 @@ import java.time.Duration; /** - * A builder for creating a new instance of the AzureReservationApiImpl type. + * A builder for creating a new instance of the ReservationsManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { AzureReservationApiImpl.class }) -public final class AzureReservationApiBuilder { +@ServiceClientBuilder(serviceClients = { ReservationsManagementClientImpl.class }) +public final class ReservationsManagementClientBuilder { /* - * server parameter + * Service host */ private String endpoint; /** - * Sets server parameter. + * Sets Service host. * * @param endpoint the endpoint value. - * @return the AzureReservationApiBuilder. + * @return the ReservationsManagementClientBuilder. */ - public AzureReservationApiBuilder endpoint(String endpoint) { + public ReservationsManagementClientBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } @@ -44,9 +44,9 @@ public AzureReservationApiBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the AzureReservationApiBuilder. + * @return the ReservationsManagementClientBuilder. */ - public AzureReservationApiBuilder environment(AzureEnvironment environment) { + public ReservationsManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -60,9 +60,9 @@ public AzureReservationApiBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the AzureReservationApiBuilder. + * @return the ReservationsManagementClientBuilder. */ - public AzureReservationApiBuilder pipeline(HttpPipeline pipeline) { + public ReservationsManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -76,9 +76,9 @@ public AzureReservationApiBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the AzureReservationApiBuilder. + * @return the ReservationsManagementClientBuilder. */ - public AzureReservationApiBuilder defaultPollInterval(Duration defaultPollInterval) { + public ReservationsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -92,19 +92,19 @@ public AzureReservationApiBuilder defaultPollInterval(Duration defaultPollInterv * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the AzureReservationApiBuilder. + * @return the ReservationsManagementClientBuilder. */ - public AzureReservationApiBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public ReservationsManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of AzureReservationApiImpl with the provided parameters. + * Builds an instance of ReservationsManagementClientImpl with the provided parameters. * - * @return an instance of AzureReservationApiImpl. + * @return an instance of ReservationsManagementClientImpl. */ - public AzureReservationApiImpl buildClient() { + public ReservationsManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -115,8 +115,8 @@ public AzureReservationApiImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - AzureReservationApiImpl client = new AzureReservationApiImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, localEndpoint); + ReservationsManagementClientImpl client = new ReservationsManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint); return client; } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsManagementClientImpl.java similarity index 89% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiImpl.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsManagementClientImpl.java index 9de824635631..13d8071688f4 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsManagementClientImpl.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.reservations.implementation; @@ -15,15 +15,17 @@ 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.reservations.fluent.AzureReservationApi; import com.azure.resourcemanager.reservations.fluent.CalculateExchangesClient; import com.azure.resourcemanager.reservations.fluent.CalculateRefundsClient; import com.azure.resourcemanager.reservations.fluent.ExchangesClient; @@ -32,6 +34,7 @@ import com.azure.resourcemanager.reservations.fluent.QuotasClient; import com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient; import com.azure.resourcemanager.reservations.fluent.ReservationsClient; +import com.azure.resourcemanager.reservations.fluent.ReservationsManagementClient; import com.azure.resourcemanager.reservations.fluent.ResourceProvidersClient; import com.azure.resourcemanager.reservations.fluent.ReturnsClient; import java.io.IOException; @@ -44,17 +47,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the AzureReservationApiImpl type. + * Initializes a new instance of the ReservationsManagementClientImpl type. */ -@ServiceClient(builder = AzureReservationApiBuilder.class) -public final class AzureReservationApiImpl implements AzureReservationApi { +@ServiceClient(builder = ReservationsManagementClientBuilder.class) +public final class ReservationsManagementClientImpl implements ReservationsManagementClient { /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -104,20 +107,6 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** - * The ReservationsClient object to access its operations. - */ - private final ReservationsClient reservations; - - /** - * Gets the ReservationsClient object to access its operations. - * - * @return the ReservationsClient object. - */ - public ReservationsClient getReservations() { - return this.reservations; - } - /** * The ResourceProvidersClient object to access its operations. */ @@ -133,17 +122,17 @@ public ResourceProvidersClient getResourceProviders() { } /** - * The ReservationOrdersClient object to access its operations. + * The QuotaRequestStatusClient object to access its operations. */ - private final ReservationOrdersClient reservationOrders; + private final QuotaRequestStatusClient quotaRequestStatus; /** - * Gets the ReservationOrdersClient object to access its operations. + * Gets the QuotaRequestStatusClient object to access its operations. * - * @return the ReservationOrdersClient object. + * @return the QuotaRequestStatusClient object. */ - public ReservationOrdersClient getReservationOrders() { - return this.reservationOrders; + public QuotaRequestStatusClient getQuotaRequestStatus() { + return this.quotaRequestStatus; } /** @@ -160,6 +149,48 @@ public OperationsClient getOperations() { return this.operations; } + /** + * The QuotasClient object to access its operations. + */ + private final QuotasClient quotas; + + /** + * Gets the QuotasClient object to access its operations. + * + * @return the QuotasClient object. + */ + public QuotasClient getQuotas() { + return this.quotas; + } + + /** + * The ReservationsClient object to access its operations. + */ + private final ReservationsClient reservations; + + /** + * Gets the ReservationsClient object to access its operations. + * + * @return the ReservationsClient object. + */ + public ReservationsClient getReservations() { + return this.reservations; + } + + /** + * The ReservationOrdersClient object to access its operations. + */ + private final ReservationOrdersClient reservationOrders; + + /** + * Gets the ReservationOrdersClient object to access its operations. + * + * @return the ReservationOrdersClient object. + */ + public ReservationOrdersClient getReservationOrders() { + return this.reservationOrders; + } + /** * The CalculateRefundsClient object to access its operations. */ @@ -217,58 +248,30 @@ public ExchangesClient getExchanges() { } /** - * The QuotasClient object to access its operations. - */ - private final QuotasClient quotas; - - /** - * Gets the QuotasClient object to access its operations. - * - * @return the QuotasClient object. - */ - public QuotasClient getQuotas() { - return this.quotas; - } - - /** - * The QuotaRequestStatusClient object to access its operations. - */ - private final QuotaRequestStatusClient quotaRequestStatus; - - /** - * Gets the QuotaRequestStatusClient object to access its operations. - * - * @return the QuotaRequestStatusClient object. - */ - public QuotaRequestStatusClient getQuotaRequestStatus() { - return this.quotaRequestStatus; - } - - /** - * Initializes an instance of AzureReservationApi client. + * Initializes an instance of ReservationsManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint server parameter. + * @param endpoint Service host. */ - AzureReservationApiImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + ReservationsManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; - this.reservations = new ReservationsClientImpl(this); this.resourceProviders = new ResourceProvidersClientImpl(this); - this.reservationOrders = new ReservationOrdersClientImpl(this); + this.quotaRequestStatus = new QuotaRequestStatusClientImpl(this); this.operations = new OperationsClientImpl(this); + this.quotas = new QuotasClientImpl(this); + this.reservations = new ReservationsClientImpl(this); + this.reservationOrders = new ReservationOrdersClientImpl(this); this.calculateRefunds = new CalculateRefundsClientImpl(this); this.returns = new ReturnsClientImpl(this); this.calculateExchanges = new CalculateExchangesClientImpl(this); this.exchanges = new ExchangesClientImpl(this); - this.quotas = new QuotasClientImpl(this); - this.quotaRequestStatus = new QuotaRequestStatusClientImpl(this); } /** @@ -308,6 +311,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. * @@ -397,5 +417,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(AzureReservationApiImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ReservationsManagementClientImpl.class); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceManagerUtils.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceManagerUtils.java index f12839d12976..96d6073c0c32 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceManagerUtils.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersClientImpl.java index d9eca42158bd..f6a04e3ed9e2 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.implementation; @@ -28,7 +28,7 @@ import com.azure.resourcemanager.reservations.fluent.ResourceProvidersClient; import com.azure.resourcemanager.reservations.fluent.models.AppliedReservationsInner; import com.azure.resourcemanager.reservations.fluent.models.CatalogInner; -import com.azure.resourcemanager.reservations.models.CatalogsResult; +import com.azure.resourcemanager.reservations.implementation.models.CatalogsResult; import reactor.core.publisher.Mono; /** @@ -43,42 +43,61 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of ResourceProvidersClientImpl. * * @param client the instance of the service client containing this operation class. */ - ResourceProvidersClientImpl(AzureReservationApiImpl client) { + ResourceProvidersClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiResourceProviders to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for ReservationsManagementClientResourceProviders to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiR") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientResourceProviders") public interface ResourceProvidersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("reservedResourceType") String reservedResourceType, @QueryParam("location") String location, @QueryParam("publisherId") String publisherId, @QueryParam("offerId") String offerId, @QueryParam("planId") String planId, @QueryParam("$filter") String filter, @QueryParam("$skip") Float skip, @QueryParam("$take") Float take, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("reservedResourceType") String reservedResourceType, @QueryParam("location") String location, + @QueryParam("publisherId") String publisherId, @QueryParam("offerId") String offerId, + @QueryParam("planId") String planId, @QueryParam("$filter") String filter, @QueryParam("$skip") Float skip, + @QueryParam("$take") Float take, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAppliedReservationList(@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.Capacity/appliedReservations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAppliedReservationList(@HostParam("$host") String endpoint, + Response getAppliedReservationListSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -87,15 +106,22 @@ Mono> getAppliedReservationList(@HostParam("$ @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getCatalogNext(@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 getCatalogNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param reservedResourceType The type of the resource for which the skus should be provided. - * @param location Filters the skus based on the location specified in this parameter. This can be an Azure region + * @param location Filters the skus based on the location specified in this parameter. This can be an azure region * or global. * @param publisherId Publisher id used to get the third party products. * @param offerId Offer id used to get the third party products. @@ -112,13 +138,6 @@ Mono> getCatalogNext(@PathParam(value = "nextLink", enc @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String subscriptionId, String reservedResourceType, String location, String publisherId, String offerId, String planId, String filter, Float skip, Float take) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } final String apiVersion = "2022-11-01"; final String accept = "application/json"; return FluxUtil @@ -132,50 +151,9 @@ private Mono> listSinglePageAsync(String subscriptio /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. - * @param reservedResourceType The type of the resource for which the skus should be provided. - * @param location Filters the skus based on the location specified in this parameter. This can be an Azure region - * or global. - * @param publisherId Publisher id used to get the third party products. - * @param offerId Offer id used to get the third party products. - * @param planId Plan id used to get the third party products. - * @param filter May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. - * @param skip The number of reservations to skip from the list before returning results. - * @param take To number of reservations to return. - * @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 regions and skus that are available for RI purchase for the specified Azure subscription along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String subscriptionId, String reservedResourceType, - String location, String publisherId, String offerId, String planId, String filter, Float skip, Float take, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, subscriptionId, reservedResourceType, location, publisherId, - offerId, planId, filter, skip, take, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the regions and skus that are available for RI purchase for the specified Azure subscription. - * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param reservedResourceType The type of the resource for which the skus should be provided. - * @param location Filters the skus based on the location specified in this parameter. This can be an Azure region + * @param location Filters the skus based on the location specified in this parameter. This can be an azure region * or global. * @param publisherId Publisher id used to get the third party products. * @param offerId Offer id used to get the third party products. @@ -199,7 +177,7 @@ private PagedFlux listAsync(String subscriptionId, String reserved /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -223,9 +201,39 @@ private PagedFlux listAsync(String subscriptionId) { /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param reservedResourceType The type of the resource for which the skus should be provided. - * @param location Filters the skus based on the location specified in this parameter. This can be an Azure region + * @param location Filters the skus based on the location specified in this parameter. This can be an azure region + * or global. + * @param publisherId Publisher id used to get the third party products. + * @param offerId Offer id used to get the third party products. + * @param planId Plan id used to get the third party products. + * @param filter May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. + * @param skip The number of reservations to skip from the list before returning results. + * @param take To number of reservations to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 regions and skus that are available for RI purchase for the specified Azure subscription along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String subscriptionId, String reservedResourceType, + String location, String publisherId, String offerId, String planId, String filter, Float skip, Float take) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), apiVersion, subscriptionId, + reservedResourceType, location, publisherId, offerId, planId, filter, skip, take, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the regions and skus that are available for RI purchase for the specified Azure subscription. + * + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param reservedResourceType The type of the resource for which the skus should be provided. + * @param location Filters the skus based on the location specified in this parameter. This can be an azure region * or global. * @param publisherId Publisher id used to get the third party products. * @param offerId Offer id used to get the third party products. @@ -237,21 +245,25 @@ private PagedFlux listAsync(String subscriptionId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 regions and skus that are available for RI purchase for the specified Azure subscription as paginated - * response with {@link PagedFlux}. + * @return the regions and skus that are available for RI purchase for the specified Azure subscription along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String subscriptionId, String reservedResourceType, String location, - String publisherId, String offerId, String planId, String filter, Float skip, Float take, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(subscriptionId, reservedResourceType, location, publisherId, - offerId, planId, filter, skip, take, context), - nextLink -> getCatalogNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String subscriptionId, String reservedResourceType, + String location, String publisherId, String offerId, String planId, String filter, Float skip, Float take, + Context context) { + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), apiVersion, subscriptionId, + reservedResourceType, location, publisherId, offerId, planId, filter, skip, take, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -268,16 +280,16 @@ public PagedIterable list(String subscriptionId) { final String filter = null; final Float skip = null; final Float take = null; - return new PagedIterable<>(listAsync(subscriptionId, reservedResourceType, location, publisherId, offerId, - planId, filter, skip, take)); + return new PagedIterable<>(() -> listSinglePage(subscriptionId, reservedResourceType, location, publisherId, + offerId, planId, filter, skip, take), nextLink -> getCatalogNextSinglePage(nextLink)); } /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param reservedResourceType The type of the resource for which the skus should be provided. - * @param location Filters the skus based on the location specified in this parameter. This can be an Azure region + * @param location Filters the skus based on the location specified in this parameter. This can be an azure region * or global. * @param publisherId Publisher id used to get the third party products. * @param offerId Offer id used to get the third party products. @@ -295,8 +307,8 @@ public PagedIterable list(String subscriptionId) { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String subscriptionId, String reservedResourceType, String location, String publisherId, String offerId, String planId, String filter, Float skip, Float take, Context context) { - return new PagedIterable<>(listAsync(subscriptionId, reservedResourceType, location, publisherId, offerId, - planId, filter, skip, take, context)); + return new PagedIterable<>(() -> listSinglePage(subscriptionId, reservedResourceType, location, publisherId, + offerId, planId, filter, skip, take, context), nextLink -> getCatalogNextSinglePage(nextLink, context)); } /** @@ -304,22 +316,17 @@ public PagedIterable list(String subscriptionId, String reservedRe * * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicable `Reservation`s that are applied to this subscription or a resource group under this - * subscription along with {@link Response} on successful completion of {@link Mono}. + * @return list of applicable `Reservation`s. + * + * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAppliedReservationListWithResponseAsync(String subscriptionId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } final String apiVersion = "2022-11-01"; final String accept = "application/json"; return FluxUtil @@ -333,42 +340,14 @@ private Mono> getAppliedReservationListWithRe * * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. * - * @param subscriptionId Id of the subscription. - * @param context The context to associate with this operation. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicable `Reservation`s that are applied to this subscription or a resource group under this - * subscription along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAppliedReservationListWithResponseAsync(String subscriptionId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAppliedReservationList(this.client.getEndpoint(), apiVersion, subscriptionId, accept, - context); - } - - /** - * Get list of applicable `Reservation`s. - * - * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. + * @return list of applicable `Reservation`s. * - * @param subscriptionId Id of the subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicable `Reservation`s that are applied to this subscription or a resource group under this - * subscription on successful completion of {@link Mono}. + * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAppliedReservationListAsync(String subscriptionId) { @@ -381,18 +360,23 @@ private Mono getAppliedReservationListAsync(String sub * * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @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 applicable `Reservation`s that are applied to this subscription or a resource group under this - * subscription along with {@link Response}. + * @return list of applicable `Reservation`s. + * + * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAppliedReservationListWithResponse(String subscriptionId, Context context) { - return getAppliedReservationListWithResponseAsync(subscriptionId, context).block(); + final String apiVersion = "2022-11-01"; + final String accept = "application/json"; + return service.getAppliedReservationListSync(this.client.getEndpoint(), apiVersion, subscriptionId, accept, + context); } /** @@ -400,12 +384,13 @@ public Response getAppliedReservationListWithResponse( * * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return applicable `Reservation`s that are applied to this subscription or a resource group under this - * subscription. + * @return list of applicable `Reservation`s. + * + * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) public AppliedReservationsInner getAppliedReservationList(String subscriptionId) { @@ -413,24 +398,19 @@ public AppliedReservationsInner getAppliedReservationList(String subscriptionId) } /** + * Get the regions and skus that are available for RI purchase for the specified Azure subscription. + * * 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 catalogs and pagination information along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the regions and skus that are available for RI purchase for the specified Azure subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getCatalogNextSinglePageAsync(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.getCatalogNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -440,6 +420,29 @@ private Mono> getCatalogNextSinglePageAsync(String n } /** + * Get the regions and skus that are available for RI purchase for the specified Azure subscription. + * + * 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 regions and skus that are available for RI purchase for the specified Azure subscription along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse getCatalogNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.getCatalogNextSync(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 regions and skus that are available for RI purchase for the specified Azure subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -447,22 +450,14 @@ private Mono> getCatalogNextSinglePageAsync(String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 catalogs and pagination information along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the regions and skus that are available for RI purchase for the specified Azure subscription along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCatalogNextSinglePageAsync(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 getCatalogNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getCatalogNext(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.getCatalogNextSync(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/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersImpl.java index b92bf8dd48d5..9239f3fc170e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.implementation; @@ -45,12 +45,8 @@ public PagedIterable list(String subscriptionId, String reservedResourc public Response getAppliedReservationListWithResponse(String subscriptionId, Context context) { Response inner = this.serviceClient().getAppliedReservationListWithResponse(subscriptionId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AppliedReservationsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AppliedReservationsImpl(inner.getValue(), this.manager())); } public AppliedReservations getAppliedReservationList(String subscriptionId) { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsClientImpl.java index 920288d30a19..4993868c19e8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsClientImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsClientImpl.java @@ -1,13 +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.reservations.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; 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; @@ -21,6 +20,7 @@ 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; @@ -44,32 +44,40 @@ public final class ReturnsClientImpl implements ReturnsClient { /** * The service client containing this operation class. */ - private final AzureReservationApiImpl client; + private final ReservationsManagementClientImpl client; /** * Initializes an instance of ReturnsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ReturnsClientImpl(AzureReservationApiImpl client) { + ReturnsClientImpl(ReservationsManagementClientImpl client) { this.service = RestProxy.create(ReturnsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureReservationApiReturns to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for ReservationsManagementClientReturns to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "AzureReservationApiR") + @Host("{endpoint}") + @ServiceInterface(name = "ReservationsManagementClientReturns") public interface ReturnsService { - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> post(@HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RefundRequest body, @HeaderParam("Accept") String accept, Context context); + Mono>> post(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RefundRequest body, Context context); + + @Post("/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response postSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("reservationOrderId") String reservationOrderId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RefundRequest body, Context context); } /** @@ -87,23 +95,12 @@ Mono>> post(@HostParam("$host") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> postWithResponseAsync(String reservationOrderId, RefundRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.post(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, context)) + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, + accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -114,33 +111,18 @@ private Mono>> postWithResponseAsync(String reservatio * * @param reservationOrderId Order Id of the reservation. * @param body Information needed for returning reservation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a reservation order being returned along with {@link Response} on successful completion of - * {@link Mono}. + * @return details of a reservation order being returned along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> postWithResponseAsync(String reservationOrderId, RefundRequest body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (reservationOrderId == null) { - return Mono - .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } + private Response postWithResponse(String reservationOrderId, RefundRequest body) { final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.post(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, context); + return service.postSync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, accept, body, + Context.NONE); } /** @@ -150,18 +132,19 @@ private Mono>> postWithResponseAsync(String reservatio * * @param reservationOrderId Order Id of the reservation. * @param body Information needed for returning reservation. + * @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 details of a reservation order being returned. + * @return details of a reservation order being returned along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReservationOrderResponseInner> - beginPostAsync(String reservationOrderId, RefundRequest body) { - Mono>> mono = postWithResponseAsync(reservationOrderId, body); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ReservationOrderResponseInner.class, ReservationOrderResponseInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response postWithResponse(String reservationOrderId, RefundRequest body, Context context) { + final String apiVersion = "2022-11-01"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.postSync(this.client.getEndpoint(), apiVersion, reservationOrderId, contentType, accept, body, + context); } /** @@ -171,7 +154,6 @@ private Mono>> postWithResponseAsync(String reservatio * * @param reservationOrderId Order Id of the reservation. * @param body Information needed for returning reservation. - * @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. @@ -179,12 +161,11 @@ private Mono>> postWithResponseAsync(String reservatio */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ReservationOrderResponseInner> - beginPostAsync(String reservationOrderId, RefundRequest body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = postWithResponseAsync(reservationOrderId, body, context); + beginPostAsync(String reservationOrderId, RefundRequest body) { + Mono>> mono = postWithResponseAsync(reservationOrderId, body); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ReservationOrderResponseInner.class, ReservationOrderResponseInner.class, - context); + this.client.getContext()); } /** @@ -202,7 +183,9 @@ private Mono>> postWithResponseAsync(String reservatio @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ReservationOrderResponseInner> beginPost(String reservationOrderId, RefundRequest body) { - return this.beginPostAsync(reservationOrderId, body).getSyncPoller(); + Response response = postWithResponse(reservationOrderId, body); + return this.client.getLroResult(response, + ReservationOrderResponseInner.class, ReservationOrderResponseInner.class, Context.NONE); } /** @@ -221,7 +204,9 @@ private Mono>> postWithResponseAsync(String reservatio @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ReservationOrderResponseInner> beginPost(String reservationOrderId, RefundRequest body, Context context) { - return this.beginPostAsync(reservationOrderId, body, context).getSyncPoller(); + Response response = postWithResponse(reservationOrderId, body, context); + return this.client.getLroResult(response, + ReservationOrderResponseInner.class, ReservationOrderResponseInner.class, context); } /** @@ -241,25 +226,6 @@ private Mono postAsync(String reservationOrderId, return beginPostAsync(reservationOrderId, body).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Return a reservation. - * - * Return a reservation and get refund information. - * - * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for returning reservation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of a reservation order being returned on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono postAsync(String reservationOrderId, RefundRequest body, - Context context) { - return beginPostAsync(reservationOrderId, body, context).last().flatMap(this.client::getLroFinalResultOrError); - } - /** * Return a reservation. * @@ -274,7 +240,7 @@ private Mono postAsync(String reservationOrderId, */ @ServiceMethod(returns = ReturnType.SINGLE) public ReservationOrderResponseInner post(String reservationOrderId, RefundRequest body) { - return postAsync(reservationOrderId, body).block(); + return beginPost(reservationOrderId, body).getFinalResult(); } /** @@ -292,6 +258,6 @@ public ReservationOrderResponseInner post(String reservationOrderId, RefundReque */ @ServiceMethod(returns = ReturnType.SINGLE) public ReservationOrderResponseInner post(String reservationOrderId, RefundRequest body, Context context) { - return postAsync(reservationOrderId, body, context).block(); + return beginPost(reservationOrderId, body, context).getFinalResult(); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsImpl.java index 81d666210593..931fa8cfd302 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsImpl.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsImpl.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.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CatalogsResult.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/CatalogsResult.java similarity index 74% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CatalogsResult.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/CatalogsResult.java index b25ef88eca5d..ea3d6a14311e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CatalogsResult.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/CatalogsResult.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.reservations.models; +package com.azure.resourcemanager.reservations.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,15 +16,15 @@ /** * The list of catalogs and pagination information. */ -@Fluent +@Immutable public final class CatalogsResult implements JsonSerializable { /* - * The list of catalogs. + * The Catalog items on this page */ private List value; /* - * The link (url) to the next page of results. + * The link to the next page of items */ private String nextLink; @@ -36,11 +36,11 @@ public final class CatalogsResult implements JsonSerializable { /** * Creates an instance of CatalogsResult class. */ - public CatalogsResult() { + private CatalogsResult() { } /** - * Get the value property: The list of catalogs. + * Get the value property: The Catalog items on this page. * * @return the value value. */ @@ -49,7 +49,7 @@ public List value() { } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -66,34 +66,14 @@ public Long totalItems() { return this.totalItems; } - /** - * Set the totalItems property: The total amount of catalog items. - * - * @param totalItems the totalItems value to set. - * @return the CatalogsResult object itself. - */ - public CatalogsResult withTotalItems(Long totalItems) { - this.totalItems = totalItems; - 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); jsonWriter.writeNumberField("totalItems", this.totalItems); return jsonWriter.writeEndObject(); } @@ -104,6 +84,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of CatalogsResult 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 CatalogsResult. */ public static CatalogsResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/OperationList.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/OperationList.java similarity index 71% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/OperationList.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/OperationList.java index 4c2c936119de..9d2e51ce3595 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/OperationList.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/OperationList.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.reservations.models; +package com.azure.resourcemanager.reservations.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; @@ -14,9 +14,9 @@ import java.util.List; /** - * Paginated list of operations. + * The OperationList model. */ -@Fluent +@Immutable public final class OperationList implements JsonSerializable { /* * The value property. @@ -31,7 +31,7 @@ public final class OperationList implements JsonSerializable { /** * Creates an instance of OperationList class. */ - public OperationList() { + private OperationList() { } /** @@ -43,17 +43,6 @@ public List value() { return this.value; } - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the OperationList object itself. - */ - public OperationList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: Url to get the next page of items. * @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Url to get the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the OperationList object itself. - */ - public OperationList 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} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaLimits.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/QuotaLimits.java similarity index 63% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaLimits.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/QuotaLimits.java index c215cd095c87..c28772c8b481 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaLimits.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/QuotaLimits.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.reservations.models; +package com.azure.resourcemanager.reservations.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 @@ /** * Quota limits. */ -@Fluent +@Immutable public final class QuotaLimits implements JsonSerializable { /* - * List of quotas (service limits). + * The CurrentQuotaLimitBase items on this page */ private List value; /* - * The URI for fetching the next page of quotas (service limits). When no more pages exist, the value is null. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of QuotaLimits class. */ - public QuotaLimits() { + private QuotaLimits() { } /** - * Get the value property: List of quotas (service limits). + * Get the value property: The CurrentQuotaLimitBase items on this page. * * @return the value value. */ @@ -44,19 +44,7 @@ public List value() { } /** - * Set the value property: List of quotas (service limits). - * - * @param value the value value to set. - * @return the QuotaLimits object itself. - */ - public QuotaLimits withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI for fetching the next page of quotas (service limits). When no more pages - * exist, the value is null. + * 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: The URI for fetching the next page of quotas (service limits). When no more pages - * exist, the value is null. - * - * @param nextLink the nextLink value to set. - * @return the QuotaLimits object itself. - */ - public QuotaLimits 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 QuotaLimits 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 QuotaLimits. */ public static QuotaLimits fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestDetailsList.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/QuotaRequestDetailsList.java similarity index 65% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestDetailsList.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/QuotaRequestDetailsList.java index 594c43fa326b..be04c918b023 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestDetailsList.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/QuotaRequestDetailsList.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.reservations.models; +package com.azure.resourcemanager.reservations.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 @@ /** * Quota request details. */ -@Fluent +@Immutable public final class QuotaRequestDetailsList implements JsonSerializable { /* - * The quota requests. + * The QuotaRequestDetails items on this page */ private List value; /* - * The URI to fetch the next page of quota limits. When there are no more pages, this is null. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of QuotaRequestDetailsList class. */ - public QuotaRequestDetailsList() { + private QuotaRequestDetailsList() { } /** - * Get the value property: The quota requests. + * Get the value property: The QuotaRequestDetails items on this page. * * @return the value value. */ @@ -44,19 +44,7 @@ public List value() { } /** - * Set the value property: The quota requests. - * - * @param value the value value to set. - * @return the QuotaRequestDetailsList object itself. - */ - public QuotaRequestDetailsList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of quota limits. When there are no more pages, this is - * null. + * 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: The URI to fetch the next page of quota limits. When there are no more pages, this is - * null. - * - * @param nextLink the nextLink value to set. - * @return the QuotaRequestDetailsList object itself. - */ - public QuotaRequestDetailsList 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 QuotaRequestDetailsList 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 QuotaRequestDetailsList. */ public static QuotaRequestDetailsList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationList.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationList.java similarity index 67% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationList.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationList.java index 56d225e85c05..5d73d928fea3 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationList.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationList.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.reservations.models; +package com.azure.resourcemanager.reservations.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 @@ /** * List of `Reservation`s. */ -@Fluent +@Immutable public final class ReservationList implements JsonSerializable { /* - * The value property. + * The ReservationResponse items on this page */ private List value; /* - * Url to get the next page of reservations. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ReservationList class. */ - public ReservationList() { + private ReservationList() { } /** - * Get the value property: The value property. + * Get the value property: The ReservationResponse items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ReservationList object itself. - */ - public ReservationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Url to get the next page of reservations. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Url to get the next page of reservations. - * - * @param nextLink the nextLink value to set. - * @return the ReservationList object itself. - */ - public ReservationList 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} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ReservationList 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 ReservationList. */ public static ReservationList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderList.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationOrderList.java similarity index 67% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderList.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationOrderList.java index 480f45b18f07..8bdb9091602c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderList.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationOrderList.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.reservations.models; +package com.azure.resourcemanager.reservations.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 @@ /** * List of `ReservationOrder`s. */ -@Fluent +@Immutable public final class ReservationOrderList implements JsonSerializable { /* - * The value property. + * The ReservationOrderResponse items on this page */ private List value; /* - * Url to get the next page of reservationOrders. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ReservationOrderList class. */ - public ReservationOrderList() { + private ReservationOrderList() { } /** - * Get the value property: The value property. + * Get the value property: The ReservationOrderResponse items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ReservationOrderList object itself. - */ - public ReservationOrderList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Url to get the next page of reservationOrders. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Url to get the next page of reservationOrders. - * - * @param nextLink the nextLink value to set. - * @return the ReservationOrderList object itself. - */ - public ReservationOrderList 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} */ @@ -102,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ReservationOrderList 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 ReservationOrderList. */ public static ReservationOrderList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsListResult.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationsListResult.java similarity index 79% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsListResult.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationsListResult.java index 4073bc90981c..65a06f057e29 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsListResult.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationsListResult.java @@ -1,22 +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.reservations.models; +package com.azure.resourcemanager.reservations.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; import com.azure.json.JsonWriter; import com.azure.resourcemanager.reservations.fluent.models.ReservationResponseInner; +import com.azure.resourcemanager.reservations.models.ReservationSummary; import java.io.IOException; import java.util.List; /** * The list of reservations and summary of roll out count of reservations in each state. */ -@Fluent +@Immutable public final class ReservationsListResult implements JsonSerializable { /* * The list of reservations. @@ -36,7 +37,7 @@ public final class ReservationsListResult implements JsonSerializable e.validate()); - } - if (summary() != null) { - summary().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/package-info.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/package-info.java index 97c84dc739fc..f604d9cc95e3 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/package-info.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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 AzureReservationApi. - * This API describe Azure Reservation. + * Package containing the implementations for ReservationsManagementClient. + * Microsoft Azure Quota Resource Provider. */ package com.azure.resourcemanager.reservations.implementation; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservationList.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservationList.java index b879dfb9319e..982a623192aa 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservationList.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservationList.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.reservations.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,10 +15,10 @@ /** * Paginated list of applied reservations. */ -@Fluent +@Immutable public final class AppliedReservationList implements JsonSerializable { /* - * The value property. + * Array of reservation resource ids */ private List value; @@ -30,11 +30,11 @@ public final class AppliedReservationList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the AppliedReservationList object itself. - */ - public AppliedReservationList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: Url to get the next page of reservations. * @@ -62,25 +51,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Url to get the next page of reservations. - * - * @param nextLink the nextLink value to set. - * @return the AppliedReservationList object itself. - */ - public AppliedReservationList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservations.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservations.java index ec97aec402a5..80f8538853f5 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservations.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservations.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeProperties.java index 109b24d0e8f6..2a8f38711889 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeProperties.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.reservations.models; @@ -150,14 +150,6 @@ public AppliedScopeProperties withDisplayName(String displayName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeType.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeType.java index f4314995dea8..76e35f2aa551 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeType.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeType.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.reservations.models; @@ -12,17 +12,17 @@ */ public final class AppliedScopeType extends ExpandableStringEnum { /** - * Static value Single for AppliedScopeType. + * Single. */ public static final AppliedScopeType SINGLE = fromString("Single"); /** - * Static value Shared for AppliedScopeType. + * Shared. */ public static final AppliedScopeType SHARED = fromString("Shared"); /** - * Static value ManagementGroup for AppliedScopeType. + * ManagementGroup. */ public static final AppliedScopeType MANAGEMENT_GROUP = fromString("ManagementGroup"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeProperties.java index 070b3b18707c..2e69095ce01b 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeProperties.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequest.java index c353159bb1f1..c25d8bc7f958 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequest.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.reservations.models; @@ -47,17 +47,6 @@ public AvailableScopeRequest withProperties(AvailableScopeRequestProperties prop return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequestProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequestProperties.java index 28c181fda186..e1b8aaa381f1 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequestProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequestProperties.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.reservations.models; @@ -48,14 +48,6 @@ public AvailableScopeRequestProperties withScopes(List scopes) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/BillingInformation.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/BillingInformation.java index 31d5656e4fd9..53e327376e8d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/BillingInformation.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/BillingInformation.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.reservations.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 @@ /** * billing information. */ -@Fluent +@Immutable public final class BillingInformation implements JsonSerializable { /* * Pricing information containing the amount and the currency code @@ -34,7 +34,7 @@ public final class BillingInformation implements JsonSerializable { /** - * Static value P1M for BillingPlan. + * P1M. */ public static final BillingPlan P1M = fromString("P1M"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultResponse.java index d8200bd0a42b..72a9c0e95da4 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultResponse.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultResponse.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultStatus.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultStatus.java index 90b5f24f772e..de4343314971 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultStatus.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultStatus.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.reservations.models; @@ -13,22 +13,22 @@ public final class CalculateExchangeOperationResultStatus extends ExpandableStringEnum { /** - * Static value Succeeded for CalculateExchangeOperationResultStatus. + * Succeeded. */ public static final CalculateExchangeOperationResultStatus SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for CalculateExchangeOperationResultStatus. + * Failed. */ public static final CalculateExchangeOperationResultStatus FAILED = fromString("Failed"); /** - * Static value Cancelled for CalculateExchangeOperationResultStatus. + * Cancelled. */ public static final CalculateExchangeOperationResultStatus CANCELLED = fromString("Cancelled"); /** - * Static value Pending for CalculateExchangeOperationResultStatus. + * Pending. */ public static final CalculateExchangeOperationResultStatus PENDING = fromString("Pending"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequest.java index 6b711ed2a2c6..8351434c1dab 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequest.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.reservations.models; @@ -47,17 +47,6 @@ public CalculateExchangeRequest withProperties(CalculateExchangeRequestPropertie return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequestProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequestProperties.java index 438ded55305f..0f51970ddab4 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequestProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequestProperties.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.reservations.models; @@ -100,23 +100,6 @@ public List reservationsToExchange() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (reservationsToPurchase() != null) { - reservationsToPurchase().forEach(e -> e.validate()); - } - if (savingsPlansToPurchase() != null) { - savingsPlansToPurchase().forEach(e -> e.validate()); - } - if (reservationsToExchange() != null) { - reservationsToExchange().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeResponseProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeResponseProperties.java index 33f0de70828d..47b0388e167d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeResponseProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeResponseProperties.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.reservations.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 @@ /** * CalculateExchange response properties. */ -@Fluent +@Immutable public final class CalculateExchangeResponseProperties implements JsonSerializable { /* @@ -61,7 +61,7 @@ public final class CalculateExchangeResponseProperties /** * Creates an instance of CalculateExchangeResponseProperties class. */ - public CalculateExchangeResponseProperties() { + private CalculateExchangeResponseProperties() { } /** @@ -73,17 +73,6 @@ public String sessionId() { return this.sessionId; } - /** - * Set the sessionId property: Exchange session identifier. - * - * @param sessionId the sessionId value to set. - * @return the CalculateExchangeResponseProperties object itself. - */ - public CalculateExchangeResponseProperties withSessionId(String sessionId) { - this.sessionId = sessionId; - return this; - } - /** * Get the netPayable property: Pricing information containing the amount and the currency code. * @@ -93,17 +82,6 @@ public Price netPayable() { return this.netPayable; } - /** - * Set the netPayable property: Pricing information containing the amount and the currency code. - * - * @param netPayable the netPayable value to set. - * @return the CalculateExchangeResponseProperties object itself. - */ - public CalculateExchangeResponseProperties withNetPayable(Price netPayable) { - this.netPayable = netPayable; - return this; - } - /** * Get the refundsTotal property: Pricing information containing the amount and the currency code. * @@ -113,17 +91,6 @@ public Price refundsTotal() { return this.refundsTotal; } - /** - * Set the refundsTotal property: Pricing information containing the amount and the currency code. - * - * @param refundsTotal the refundsTotal value to set. - * @return the CalculateExchangeResponseProperties object itself. - */ - public CalculateExchangeResponseProperties withRefundsTotal(Price refundsTotal) { - this.refundsTotal = refundsTotal; - return this; - } - /** * Get the purchasesTotal property: Pricing information containing the amount and the currency code. * @@ -133,17 +100,6 @@ public Price purchasesTotal() { return this.purchasesTotal; } - /** - * Set the purchasesTotal property: Pricing information containing the amount and the currency code. - * - * @param purchasesTotal the purchasesTotal value to set. - * @return the CalculateExchangeResponseProperties object itself. - */ - public CalculateExchangeResponseProperties withPurchasesTotal(Price purchasesTotal) { - this.purchasesTotal = purchasesTotal; - return this; - } - /** * Get the reservationsToPurchase property: Details of the reservations being purchased. * @@ -153,18 +109,6 @@ public List reservationsToPurchase() { return this.reservationsToPurchase; } - /** - * Set the reservationsToPurchase property: Details of the reservations being purchased. - * - * @param reservationsToPurchase the reservationsToPurchase value to set. - * @return the CalculateExchangeResponseProperties object itself. - */ - public CalculateExchangeResponseProperties - withReservationsToPurchase(List reservationsToPurchase) { - this.reservationsToPurchase = reservationsToPurchase; - return this; - } - /** * Get the savingsPlansToPurchase property: Details of the savings plans being purchased. * @@ -174,18 +118,6 @@ public List savingsPlansToPurchase() { return this.savingsPlansToPurchase; } - /** - * Set the savingsPlansToPurchase property: Details of the savings plans being purchased. - * - * @param savingsPlansToPurchase the savingsPlansToPurchase value to set. - * @return the CalculateExchangeResponseProperties object itself. - */ - public CalculateExchangeResponseProperties - withSavingsPlansToPurchase(List savingsPlansToPurchase) { - this.savingsPlansToPurchase = savingsPlansToPurchase; - return this; - } - /** * Get the reservationsToExchange property: Details of the reservations being returned. * @@ -195,18 +127,6 @@ public List reservationsToExchange() { return this.reservationsToExchange; } - /** - * Set the reservationsToExchange property: Details of the reservations being returned. - * - * @param reservationsToExchange the reservationsToExchange value to set. - * @return the CalculateExchangeResponseProperties object itself. - */ - public CalculateExchangeResponseProperties - withReservationsToExchange(List reservationsToExchange) { - this.reservationsToExchange = reservationsToExchange; - return this; - } - /** * Get the policyResult property: Exchange policy errors. * @@ -216,46 +136,6 @@ public ExchangePolicyErrors policyResult() { return this.policyResult; } - /** - * Set the policyResult property: Exchange policy errors. - * - * @param policyResult the policyResult value to set. - * @return the CalculateExchangeResponseProperties object itself. - */ - public CalculateExchangeResponseProperties withPolicyResult(ExchangePolicyErrors policyResult) { - this.policyResult = policyResult; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (netPayable() != null) { - netPayable().validate(); - } - if (refundsTotal() != null) { - refundsTotal().validate(); - } - if (purchasesTotal() != null) { - purchasesTotal().validate(); - } - if (reservationsToPurchase() != null) { - reservationsToPurchase().forEach(e -> e.validate()); - } - if (savingsPlansToPurchase() != null) { - savingsPlansToPurchase().forEach(e -> e.validate()); - } - if (reservationsToExchange() != null) { - reservationsToExchange().forEach(e -> e.validate()); - } - if (policyResult() != null) { - policyResult().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchanges.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchanges.java index 08ef0c84cfb1..fcc9d1501ea4 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchanges.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchanges.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.reservations.models; @@ -15,11 +15,11 @@ public interface CalculateExchanges { * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @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 calculateExchange operation result. + * @return the response. */ CalculateExchangeOperationResultResponse post(CalculateExchangeRequest body); @@ -28,12 +28,12 @@ public interface CalculateExchanges { * * Calculates price for exchanging `Reservations` if there are no policy errors. * - * @param body Request containing purchases and refunds that need to be executed. + * @param body The request body. * @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 calculateExchange operation result. + * @return the response. */ CalculateExchangeOperationResultResponse post(CalculateExchangeRequest body, Context context); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponse.java index 79096f24ad66..f127ecf5a573 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponse.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponse.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponseProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponseProperties.java index b55beba264be..651fdb9b4b0c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponseProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponseProperties.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.reservations.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 @@ /** * Properties for calculate price response. */ -@Fluent +@Immutable public final class CalculatePriceResponseProperties implements JsonSerializable { /* * Currency and amount that customer will be charged in customer's local currency. Tax is not included. @@ -75,7 +75,7 @@ public final class CalculatePriceResponseProperties implements JsonSerializable< /** * Creates an instance of CalculatePriceResponseProperties class. */ - public CalculatePriceResponseProperties() { + private CalculatePriceResponseProperties() { } /** @@ -88,19 +88,6 @@ public CalculatePriceResponsePropertiesBillingCurrencyTotal billingCurrencyTotal return this.billingCurrencyTotal; } - /** - * Set the billingCurrencyTotal property: Currency and amount that customer will be charged in customer's local - * currency. Tax is not included. - * - * @param billingCurrencyTotal the billingCurrencyTotal value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties - withBillingCurrencyTotal(CalculatePriceResponsePropertiesBillingCurrencyTotal billingCurrencyTotal) { - this.billingCurrencyTotal = billingCurrencyTotal; - return this; - } - /** * Get the netTotal property: Net total amount in pricing currency. * @@ -110,17 +97,6 @@ public Double netTotal() { return this.netTotal; } - /** - * Set the netTotal property: Net total amount in pricing currency. - * - * @param netTotal the netTotal value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties withNetTotal(Double netTotal) { - this.netTotal = netTotal; - return this; - } - /** * Get the taxTotal property: Tax amount in pricing currency. * @@ -130,17 +106,6 @@ public Double taxTotal() { return this.taxTotal; } - /** - * Set the taxTotal property: Tax amount in pricing currency. - * - * @param taxTotal the taxTotal value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties withTaxTotal(Double taxTotal) { - this.taxTotal = taxTotal; - return this; - } - /** * Get the grandTotal property: Total amount in pricing currency. * @@ -150,17 +115,6 @@ public Double grandTotal() { return this.grandTotal; } - /** - * Set the grandTotal property: Total amount in pricing currency. - * - * @param grandTotal the grandTotal value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties withGrandTotal(Double grandTotal) { - this.grandTotal = grandTotal; - return this; - } - /** * Get the isTaxIncluded property: Whether or not tax is included in grand total. * @@ -170,17 +124,6 @@ public Boolean isTaxIncluded() { return this.isTaxIncluded; } - /** - * Set the isTaxIncluded property: Whether or not tax is included in grand total. - * - * @param isTaxIncluded the isTaxIncluded value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties withIsTaxIncluded(Boolean isTaxIncluded) { - this.isTaxIncluded = isTaxIncluded; - return this; - } - /** * Get the isBillingPartnerManaged property: True if billing is managed by Microsoft Partner. Used only for CSP * accounts. @@ -191,18 +134,6 @@ public Boolean isBillingPartnerManaged() { return this.isBillingPartnerManaged; } - /** - * Set the isBillingPartnerManaged property: True if billing is managed by Microsoft Partner. Used only for CSP - * accounts. - * - * @param isBillingPartnerManaged the isBillingPartnerManaged value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties withIsBillingPartnerManaged(Boolean isBillingPartnerManaged) { - this.isBillingPartnerManaged = isBillingPartnerManaged; - return this; - } - /** * Get the reservationOrderId property: GUID that represents reservation order that can be placed after calculating * price. @@ -213,18 +144,6 @@ public String reservationOrderId() { return this.reservationOrderId; } - /** - * Set the reservationOrderId property: GUID that represents reservation order that can be placed after calculating - * price. - * - * @param reservationOrderId the reservationOrderId value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties withReservationOrderId(String reservationOrderId) { - this.reservationOrderId = reservationOrderId; - return this; - } - /** * Get the skuTitle property: Title of sku that is being purchased. * @@ -234,17 +153,6 @@ public String skuTitle() { return this.skuTitle; } - /** - * Set the skuTitle property: Title of sku that is being purchased. - * - * @param skuTitle the skuTitle value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties withSkuTitle(String skuTitle) { - this.skuTitle = skuTitle; - return this; - } - /** * Get the skuDescription property: Description of sku that is being purchased. * @@ -254,17 +162,6 @@ public String skuDescription() { return this.skuDescription; } - /** - * Set the skuDescription property: Description of sku that is being purchased. - * - * @param skuDescription the skuDescription value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties withSkuDescription(String skuDescription) { - this.skuDescription = skuDescription; - return this; - } - /** * Get the pricingCurrencyTotal property: Amount that Microsoft uses for record. Used during refund for calculating * refund limit. Tax is not included. @@ -275,19 +172,6 @@ public CalculatePriceResponsePropertiesPricingCurrencyTotal pricingCurrencyTotal return this.pricingCurrencyTotal; } - /** - * Set the pricingCurrencyTotal property: Amount that Microsoft uses for record. Used during refund for calculating - * refund limit. Tax is not included. - * - * @param pricingCurrencyTotal the pricingCurrencyTotal value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties - withPricingCurrencyTotal(CalculatePriceResponsePropertiesPricingCurrencyTotal pricingCurrencyTotal) { - this.pricingCurrencyTotal = pricingCurrencyTotal; - return this; - } - /** * Get the paymentSchedule property: The paymentSchedule property. * @@ -297,34 +181,6 @@ public List paymentSchedule() { return this.paymentSchedule; } - /** - * Set the paymentSchedule property: The paymentSchedule property. - * - * @param paymentSchedule the paymentSchedule value to set. - * @return the CalculatePriceResponseProperties object itself. - */ - public CalculatePriceResponseProperties withPaymentSchedule(List paymentSchedule) { - this.paymentSchedule = paymentSchedule; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (billingCurrencyTotal() != null) { - billingCurrencyTotal().validate(); - } - if (pricingCurrencyTotal() != null) { - pricingCurrencyTotal().validate(); - } - if (paymentSchedule() != null) { - paymentSchedule().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesBillingCurrencyTotal.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesBillingCurrencyTotal.java index 5944b2d382ae..1663a500c51c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesBillingCurrencyTotal.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesBillingCurrencyTotal.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.reservations.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 @@ /** * Currency and amount that customer will be charged in customer's local currency. Tax is not included. */ -@Fluent +@Immutable public final class CalculatePriceResponsePropertiesBillingCurrencyTotal implements JsonSerializable { /* @@ -30,7 +30,7 @@ public final class CalculatePriceResponsePropertiesBillingCurrencyTotal /** * Creates an instance of CalculatePriceResponsePropertiesBillingCurrencyTotal class. */ - public CalculatePriceResponsePropertiesBillingCurrencyTotal() { + private CalculatePriceResponsePropertiesBillingCurrencyTotal() { } /** @@ -42,17 +42,6 @@ public String currencyCode() { return this.currencyCode; } - /** - * Set the currencyCode property: The ISO 4217 3-letter currency code for the currency used by this purchase record. - * - * @param currencyCode the currencyCode value to set. - * @return the CalculatePriceResponsePropertiesBillingCurrencyTotal object itself. - */ - public CalculatePriceResponsePropertiesBillingCurrencyTotal withCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; - return this; - } - /** * Get the amount property: Amount in pricing currency. Tax is not included. * @@ -62,25 +51,6 @@ public Double amount() { return this.amount; } - /** - * Set the amount property: Amount in pricing currency. Tax is not included. - * - * @param amount the amount value to set. - * @return the CalculatePriceResponsePropertiesBillingCurrencyTotal object itself. - */ - public CalculatePriceResponsePropertiesBillingCurrencyTotal withAmount(Double amount) { - this.amount = amount; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesPricingCurrencyTotal.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesPricingCurrencyTotal.java index 2e5d4e3ebb2c..4de9e5e07198 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesPricingCurrencyTotal.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesPricingCurrencyTotal.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.reservations.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 @@ /** * Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. */ -@Fluent +@Immutable public final class CalculatePriceResponsePropertiesPricingCurrencyTotal implements JsonSerializable { /* @@ -30,7 +30,7 @@ public final class CalculatePriceResponsePropertiesPricingCurrencyTotal /** * Creates an instance of CalculatePriceResponsePropertiesPricingCurrencyTotal class. */ - public CalculatePriceResponsePropertiesPricingCurrencyTotal() { + private CalculatePriceResponsePropertiesPricingCurrencyTotal() { } /** @@ -42,17 +42,6 @@ public String currencyCode() { return this.currencyCode; } - /** - * Set the currencyCode property: The ISO 4217 3-letter currency code for the currency used by this purchase record. - * - * @param currencyCode the currencyCode value to set. - * @return the CalculatePriceResponsePropertiesPricingCurrencyTotal object itself. - */ - public CalculatePriceResponsePropertiesPricingCurrencyTotal withCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; - return this; - } - /** * Get the amount property: The amount property. * @@ -62,25 +51,6 @@ public Float amount() { return this.amount; } - /** - * Set the amount property: The amount property. - * - * @param amount the amount value to set. - * @return the CalculatePriceResponsePropertiesPricingCurrencyTotal object itself. - */ - public CalculatePriceResponsePropertiesPricingCurrencyTotal withAmount(Float amount) { - this.amount = amount; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequest.java index 95ba767144de..182d6c2b52f5 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequest.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.reservations.models; @@ -74,17 +74,6 @@ public CalculateRefundRequest withProperties(CalculateRefundRequestProperties pr return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequestProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequestProperties.java index 7c9d2ac52cfc..3ec60adc0254 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequestProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequestProperties.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.reservations.models; @@ -72,17 +72,6 @@ public CalculateRefundRequestProperties withReservationToReturn(ReservationToRet return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (reservationToReturn() != null) { - reservationToReturn().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundResponse.java index 5de79126bcd7..8758d21d2aa9 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundResponse.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundResponse.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefunds.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefunds.java index e150bd5cb6f9..c27ffd4663f1 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefunds.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefunds.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Catalog.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Catalog.java index 593efebe629a..217b9edd5f2f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Catalog.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Catalog.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CatalogMsrp.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CatalogMsrp.java index de04862f8e92..b613113d9e6d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CatalogMsrp.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CatalogMsrp.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.reservations.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 @@ /** * Pricing information about the sku. */ -@Fluent +@Immutable public final class CatalogMsrp implements JsonSerializable { /* * Amount in pricing currency. Tax not included. @@ -34,7 +34,7 @@ public final class CatalogMsrp implements JsonSerializable { /** * Creates an instance of CatalogMsrp class. */ - public CatalogMsrp() { + private CatalogMsrp() { } /** @@ -46,17 +46,6 @@ public Price p1Y() { return this.p1Y; } - /** - * Set the p1Y property: Amount in pricing currency. Tax not included. - * - * @param p1Y the p1Y value to set. - * @return the CatalogMsrp object itself. - */ - public CatalogMsrp withP1Y(Price p1Y) { - this.p1Y = p1Y; - return this; - } - /** * Get the p3Y property: Amount in pricing currency. Tax not included. * @@ -66,17 +55,6 @@ public Price p3Y() { return this.p3Y; } - /** - * Set the p3Y property: Amount in pricing currency. Tax not included. - * - * @param p3Y the p3Y value to set. - * @return the CatalogMsrp object itself. - */ - public CatalogMsrp withP3Y(Price p3Y) { - this.p3Y = p3Y; - return this; - } - /** * Get the p5Y property: Amount in pricing currency. Tax not included. * @@ -86,34 +64,6 @@ public Price p5Y() { return this.p5Y; } - /** - * Set the p5Y property: Amount in pricing currency. Tax not included. - * - * @param p5Y the p5Y value to set. - * @return the CatalogMsrp object itself. - */ - public CatalogMsrp withP5Y(Price p5Y) { - this.p5Y = p5Y; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (p1Y() != null) { - p1Y().validate(); - } - if (p3Y() != null) { - p3Y().validate(); - } - if (p5Y() != null) { - p5Y().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryRequest.java index 368a4122aff0..5ce3f7aa211a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryRequest.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.reservations.models; @@ -47,14 +47,6 @@ public ChangeDirectoryRequest withDestinationTenantId(String destinationTenantId return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResponse.java index 86499330dc54..5dc9f09f4463 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResponse.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResponse.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResult.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResult.java index 18a9f73f981a..7ea39acce3b0 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResult.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResult.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.reservations.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 @@ /** * Change directory result for reservation order or reservation. */ -@Fluent +@Immutable public final class ChangeDirectoryResult implements JsonSerializable { /* * Identifier of the reservation order or reservation @@ -39,7 +39,7 @@ public final class ChangeDirectoryResult implements JsonSerializable { /** - * Static value Hourly for CommitmentGrain. + * Hourly. */ public static final CommitmentGrain HOURLY = fromString("Hourly"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CurrentQuotaLimitBase.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CurrentQuotaLimitBase.java index a6fc358ff4c0..2386782d61ee 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CurrentQuotaLimitBase.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/CurrentQuotaLimitBase.java @@ -1,9 +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.reservations.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.reservations.fluent.models.CurrentQuotaLimitBaseInner; @@ -39,6 +40,13 @@ public interface CurrentQuotaLimitBase { */ QuotaProperties 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.reservations.fluent.models.CurrentQuotaLimitBaseInner object. * @@ -70,7 +78,7 @@ interface WithParentResource { /** * Specifies subscriptionId, providerId, location. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @return the next definition stage. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ErrorResponseCode.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ErrorResponseCode.java index 5b61689bc0db..a79d9d583bbb 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ErrorResponseCode.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ErrorResponseCode.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.reservations.models; @@ -12,306 +12,306 @@ */ public final class ErrorResponseCode extends ExpandableStringEnum { /** - * Static value NotSpecified for ErrorResponseCode. + * NotSpecified. */ public static final ErrorResponseCode NOT_SPECIFIED = fromString("NotSpecified"); /** - * Static value InternalServerError for ErrorResponseCode. + * InternalServerError. */ public static final ErrorResponseCode INTERNAL_SERVER_ERROR = fromString("InternalServerError"); /** - * Static value ServerTimeout for ErrorResponseCode. + * ServerTimeout. */ public static final ErrorResponseCode SERVER_TIMEOUT = fromString("ServerTimeout"); /** - * Static value AuthorizationFailed for ErrorResponseCode. + * AuthorizationFailed. */ public static final ErrorResponseCode AUTHORIZATION_FAILED = fromString("AuthorizationFailed"); /** - * Static value BadRequest for ErrorResponseCode. + * BadRequest. */ public static final ErrorResponseCode BAD_REQUEST = fromString("BadRequest"); /** - * Static value ClientCertificateThumbprintNotSet for ErrorResponseCode. + * ClientCertificateThumbprintNotSet. */ public static final ErrorResponseCode CLIENT_CERTIFICATE_THUMBPRINT_NOT_SET = fromString("ClientCertificateThumbprintNotSet"); /** - * Static value InvalidRequestContent for ErrorResponseCode. + * InvalidRequestContent. */ public static final ErrorResponseCode INVALID_REQUEST_CONTENT = fromString("InvalidRequestContent"); /** - * Static value OperationFailed for ErrorResponseCode. + * OperationFailed. */ public static final ErrorResponseCode OPERATION_FAILED = fromString("OperationFailed"); /** - * Static value HttpMethodNotSupported for ErrorResponseCode. + * HttpMethodNotSupported. */ public static final ErrorResponseCode HTTP_METHOD_NOT_SUPPORTED = fromString("HttpMethodNotSupported"); /** - * Static value InvalidRequestUri for ErrorResponseCode. + * InvalidRequestUri. */ public static final ErrorResponseCode INVALID_REQUEST_URI = fromString("InvalidRequestUri"); /** - * Static value MissingTenantId for ErrorResponseCode. + * MissingTenantId. */ public static final ErrorResponseCode MISSING_TENANT_ID = fromString("MissingTenantId"); /** - * Static value InvalidTenantId for ErrorResponseCode. + * InvalidTenantId. */ public static final ErrorResponseCode INVALID_TENANT_ID = fromString("InvalidTenantId"); /** - * Static value InvalidReservationOrderId for ErrorResponseCode. + * InvalidReservationOrderId. */ public static final ErrorResponseCode INVALID_RESERVATION_ORDER_ID = fromString("InvalidReservationOrderId"); /** - * Static value InvalidReservationId for ErrorResponseCode. + * InvalidReservationId. */ public static final ErrorResponseCode INVALID_RESERVATION_ID = fromString("InvalidReservationId"); /** - * Static value ReservationIdNotInReservationOrder for ErrorResponseCode. + * ReservationIdNotInReservationOrder. */ public static final ErrorResponseCode RESERVATION_ID_NOT_IN_RESERVATION_ORDER = fromString("ReservationIdNotInReservationOrder"); /** - * Static value ReservationOrderNotFound for ErrorResponseCode. + * ReservationOrderNotFound. */ public static final ErrorResponseCode RESERVATION_ORDER_NOT_FOUND = fromString("ReservationOrderNotFound"); /** - * Static value InvalidSubscriptionId for ErrorResponseCode. + * InvalidSubscriptionId. */ public static final ErrorResponseCode INVALID_SUBSCRIPTION_ID = fromString("InvalidSubscriptionId"); /** - * Static value InvalidAccessToken for ErrorResponseCode. + * InvalidAccessToken. */ public static final ErrorResponseCode INVALID_ACCESS_TOKEN = fromString("InvalidAccessToken"); /** - * Static value InvalidLocationId for ErrorResponseCode. + * InvalidLocationId. */ public static final ErrorResponseCode INVALID_LOCATION_ID = fromString("InvalidLocationId"); /** - * Static value UnauthenticatedRequestsThrottled for ErrorResponseCode. + * UnauthenticatedRequestsThrottled. */ public static final ErrorResponseCode UNAUTHENTICATED_REQUESTS_THROTTLED = fromString("UnauthenticatedRequestsThrottled"); /** - * Static value InvalidHealthCheckType for ErrorResponseCode. + * InvalidHealthCheckType. */ public static final ErrorResponseCode INVALID_HEALTH_CHECK_TYPE = fromString("InvalidHealthCheckType"); /** - * Static value Forbidden for ErrorResponseCode. + * Forbidden. */ public static final ErrorResponseCode FORBIDDEN = fromString("Forbidden"); /** - * Static value BillingScopeIdCannotBeChanged for ErrorResponseCode. + * BillingScopeIdCannotBeChanged. */ public static final ErrorResponseCode BILLING_SCOPE_ID_CANNOT_BE_CHANGED = fromString("BillingScopeIdCannotBeChanged"); /** - * Static value AppliedScopesNotAssociatedWithCommerceAccount for ErrorResponseCode. + * AppliedScopesNotAssociatedWithCommerceAccount. */ public static final ErrorResponseCode APPLIED_SCOPES_NOT_ASSOCIATED_WITH_COMMERCE_ACCOUNT = fromString("AppliedScopesNotAssociatedWithCommerceAccount"); /** - * Static value PatchValuesSameAsExisting for ErrorResponseCode. + * PatchValuesSameAsExisting. */ public static final ErrorResponseCode PATCH_VALUES_SAME_AS_EXISTING = fromString("PatchValuesSameAsExisting"); /** - * Static value RoleAssignmentCreationFailed for ErrorResponseCode. + * RoleAssignmentCreationFailed. */ public static final ErrorResponseCode ROLE_ASSIGNMENT_CREATION_FAILED = fromString("RoleAssignmentCreationFailed"); /** - * Static value ReservationOrderCreationFailed for ErrorResponseCode. + * ReservationOrderCreationFailed. */ public static final ErrorResponseCode RESERVATION_ORDER_CREATION_FAILED = fromString("ReservationOrderCreationFailed"); /** - * Static value ReservationOrderNotEnabled for ErrorResponseCode. + * ReservationOrderNotEnabled. */ public static final ErrorResponseCode RESERVATION_ORDER_NOT_ENABLED = fromString("ReservationOrderNotEnabled"); /** - * Static value CapacityUpdateScopesFailed for ErrorResponseCode. + * CapacityUpdateScopesFailed. */ public static final ErrorResponseCode CAPACITY_UPDATE_SCOPES_FAILED = fromString("CapacityUpdateScopesFailed"); /** - * Static value UnsupportedReservationTerm for ErrorResponseCode. + * UnsupportedReservationTerm. */ public static final ErrorResponseCode UNSUPPORTED_RESERVATION_TERM = fromString("UnsupportedReservationTerm"); /** - * Static value ReservationOrderIdAlreadyExists for ErrorResponseCode. + * ReservationOrderIdAlreadyExists. */ public static final ErrorResponseCode RESERVATION_ORDER_ID_ALREADY_EXISTS = fromString("ReservationOrderIdAlreadyExists"); /** - * Static value RiskCheckFailed for ErrorResponseCode. + * RiskCheckFailed. */ public static final ErrorResponseCode RISK_CHECK_FAILED = fromString("RiskCheckFailed"); /** - * Static value CreateQuoteFailed for ErrorResponseCode. + * CreateQuoteFailed. */ public static final ErrorResponseCode CREATE_QUOTE_FAILED = fromString("CreateQuoteFailed"); /** - * Static value ActivateQuoteFailed for ErrorResponseCode. + * ActivateQuoteFailed. */ public static final ErrorResponseCode ACTIVATE_QUOTE_FAILED = fromString("ActivateQuoteFailed"); /** - * Static value NonsupportedAccountId for ErrorResponseCode. + * NonsupportedAccountId. */ public static final ErrorResponseCode NONSUPPORTED_ACCOUNT_ID = fromString("NonsupportedAccountId"); /** - * Static value PaymentInstrumentNotFound for ErrorResponseCode. + * PaymentInstrumentNotFound. */ public static final ErrorResponseCode PAYMENT_INSTRUMENT_NOT_FOUND = fromString("PaymentInstrumentNotFound"); /** - * Static value MissingAppliedScopesForSingle for ErrorResponseCode. + * MissingAppliedScopesForSingle. */ public static final ErrorResponseCode MISSING_APPLIED_SCOPES_FOR_SINGLE = fromString("MissingAppliedScopesForSingle"); /** - * Static value NoValidReservationsToReRate for ErrorResponseCode. + * NoValidReservationsToReRate. */ public static final ErrorResponseCode NO_VALID_RESERVATIONS_TO_RE_RATE = fromString("NoValidReservationsToReRate"); /** - * Static value ReRateOnlyAllowedForEA for ErrorResponseCode. + * ReRateOnlyAllowedForEA. */ public static final ErrorResponseCode RE_RATE_ONLY_ALLOWED_FOR_EA = fromString("ReRateOnlyAllowedForEA"); /** - * Static value OperationCannotBePerformedInCurrentState for ErrorResponseCode. + * OperationCannotBePerformedInCurrentState. */ public static final ErrorResponseCode OPERATION_CANNOT_BE_PERFORMED_IN_CURRENT_STATE = fromString("OperationCannotBePerformedInCurrentState"); /** - * Static value InvalidSingleAppliedScopesCount for ErrorResponseCode. + * InvalidSingleAppliedScopesCount. */ public static final ErrorResponseCode INVALID_SINGLE_APPLIED_SCOPES_COUNT = fromString("InvalidSingleAppliedScopesCount"); /** - * Static value InvalidFulfillmentRequestParameters for ErrorResponseCode. + * InvalidFulfillmentRequestParameters. */ public static final ErrorResponseCode INVALID_FULFILLMENT_REQUEST_PARAMETERS = fromString("InvalidFulfillmentRequestParameters"); /** - * Static value NotSupportedCountry for ErrorResponseCode. + * NotSupportedCountry. */ public static final ErrorResponseCode NOT_SUPPORTED_COUNTRY = fromString("NotSupportedCountry"); /** - * Static value InvalidRefundQuantity for ErrorResponseCode. + * InvalidRefundQuantity. */ public static final ErrorResponseCode INVALID_REFUND_QUANTITY = fromString("InvalidRefundQuantity"); /** - * Static value PurchaseError for ErrorResponseCode. + * PurchaseError. */ public static final ErrorResponseCode PURCHASE_ERROR = fromString("PurchaseError"); /** - * Static value BillingCustomerInputError for ErrorResponseCode. + * BillingCustomerInputError. */ public static final ErrorResponseCode BILLING_CUSTOMER_INPUT_ERROR = fromString("BillingCustomerInputError"); /** - * Static value BillingPaymentInstrumentSoftError for ErrorResponseCode. + * BillingPaymentInstrumentSoftError. */ public static final ErrorResponseCode BILLING_PAYMENT_INSTRUMENT_SOFT_ERROR = fromString("BillingPaymentInstrumentSoftError"); /** - * Static value BillingPaymentInstrumentHardError for ErrorResponseCode. + * BillingPaymentInstrumentHardError. */ public static final ErrorResponseCode BILLING_PAYMENT_INSTRUMENT_HARD_ERROR = fromString("BillingPaymentInstrumentHardError"); /** - * Static value BillingTransientError for ErrorResponseCode. + * BillingTransientError. */ public static final ErrorResponseCode BILLING_TRANSIENT_ERROR = fromString("BillingTransientError"); /** - * Static value BillingError for ErrorResponseCode. + * BillingError. */ public static final ErrorResponseCode BILLING_ERROR = fromString("BillingError"); /** - * Static value FulfillmentConfigurationError for ErrorResponseCode. + * FulfillmentConfigurationError. */ public static final ErrorResponseCode FULFILLMENT_CONFIGURATION_ERROR = fromString("FulfillmentConfigurationError"); /** - * Static value FulfillmentOutOfStockError for ErrorResponseCode. + * FulfillmentOutOfStockError. */ public static final ErrorResponseCode FULFILLMENT_OUT_OF_STOCK_ERROR = fromString("FulfillmentOutOfStockError"); /** - * Static value FulfillmentTransientError for ErrorResponseCode. + * FulfillmentTransientError. */ public static final ErrorResponseCode FULFILLMENT_TRANSIENT_ERROR = fromString("FulfillmentTransientError"); /** - * Static value FulfillmentError for ErrorResponseCode. + * FulfillmentError. */ public static final ErrorResponseCode FULFILLMENT_ERROR = fromString("FulfillmentError"); /** - * Static value CalculatePriceFailed for ErrorResponseCode. + * CalculatePriceFailed. */ public static final ErrorResponseCode CALCULATE_PRICE_FAILED = fromString("CalculatePriceFailed"); /** - * Static value AppliedScopesSameAsExisting for ErrorResponseCode. + * AppliedScopesSameAsExisting. */ public static final ErrorResponseCode APPLIED_SCOPES_SAME_AS_EXISTING = fromString("AppliedScopesSameAsExisting"); /** - * Static value SelfServiceRefundNotSupported for ErrorResponseCode. + * SelfServiceRefundNotSupported. */ public static final ErrorResponseCode SELF_SERVICE_REFUND_NOT_SUPPORTED = fromString("SelfServiceRefundNotSupported"); /** - * Static value RefundLimitExceeded for ErrorResponseCode. + * RefundLimitExceeded. */ public static final ErrorResponseCode REFUND_LIMIT_EXCEEDED = fromString("RefundLimitExceeded"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultResponse.java index 1dcb2e3ca2e0..436690a66dc4 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultResponse.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultResponse.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultStatus.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultStatus.java index f5c60132285e..65fcbfd9a66e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultStatus.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultStatus.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.reservations.models; @@ -12,27 +12,27 @@ */ public final class ExchangeOperationResultStatus extends ExpandableStringEnum { /** - * Static value Succeeded for ExchangeOperationResultStatus. + * Succeeded. */ public static final ExchangeOperationResultStatus SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ExchangeOperationResultStatus. + * Failed. */ public static final ExchangeOperationResultStatus FAILED = fromString("Failed"); /** - * Static value Cancelled for ExchangeOperationResultStatus. + * Cancelled. */ public static final ExchangeOperationResultStatus CANCELLED = fromString("Cancelled"); /** - * Static value PendingRefunds for ExchangeOperationResultStatus. + * PendingRefunds. */ public static final ExchangeOperationResultStatus PENDING_REFUNDS = fromString("PendingRefunds"); /** - * Static value PendingPurchases for ExchangeOperationResultStatus. + * PendingPurchases. */ public static final ExchangeOperationResultStatus PENDING_PURCHASES = fromString("PendingPurchases"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangePolicyError.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangePolicyError.java index 9582773dabdd..a39c035d3134 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangePolicyError.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangePolicyError.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.reservations.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 @@ /** * error details. */ -@Fluent +@Immutable public final class ExchangePolicyError implements JsonSerializable { /* * The code property. @@ -29,7 +29,7 @@ public final class ExchangePolicyError implements JsonSerializable { /* * Exchange Policy errors @@ -25,7 +25,7 @@ public final class ExchangePolicyErrors implements JsonSerializable policyErrors() { return this.policyErrors; } - /** - * Set the policyErrors property: Exchange Policy errors. - * - * @param policyErrors the policyErrors value to set. - * @return the ExchangePolicyErrors object itself. - */ - public ExchangePolicyErrors withPolicyErrors(List policyErrors) { - this.policyErrors = policyErrors; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (policyErrors() != null) { - policyErrors().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequest.java index cc638927e02c..90069b8e9513 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequest.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.reservations.models; @@ -47,17 +47,6 @@ public ExchangeRequest withProperties(ExchangeRequestProperties properties) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequestProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequestProperties.java index 01662ece97a2..14f51b227485 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequestProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequestProperties.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.reservations.models; @@ -47,14 +47,6 @@ public ExchangeRequestProperties withSessionId(String sessionId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeResponseProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeResponseProperties.java index eaef3c6c1612..184bdff6dd51 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeResponseProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExchangeResponseProperties.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.reservations.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 @@ /** * Exchange response properties. */ -@Fluent +@Immutable public final class ExchangeResponseProperties implements JsonSerializable { /* * Exchange session identifier @@ -60,7 +60,7 @@ public final class ExchangeResponseProperties implements JsonSerializable reservationsToPurchase() { return this.reservationsToPurchase; } - /** - * Set the reservationsToPurchase property: Details of the reservations being purchased. - * - * @param reservationsToPurchase the reservationsToPurchase value to set. - * @return the ExchangeResponseProperties object itself. - */ - public ExchangeResponseProperties - withReservationsToPurchase(List reservationsToPurchase) { - this.reservationsToPurchase = reservationsToPurchase; - return this; - } - /** * Get the savingsPlansToPurchase property: Details of the savings plans being purchased. * @@ -173,18 +117,6 @@ public List savingsPlansToPurchase() { return this.savingsPlansToPurchase; } - /** - * Set the savingsPlansToPurchase property: Details of the savings plans being purchased. - * - * @param savingsPlansToPurchase the savingsPlansToPurchase value to set. - * @return the ExchangeResponseProperties object itself. - */ - public ExchangeResponseProperties - withSavingsPlansToPurchase(List savingsPlansToPurchase) { - this.savingsPlansToPurchase = savingsPlansToPurchase; - return this; - } - /** * Get the reservationsToExchange property: Details of the reservations being returned. * @@ -194,18 +126,6 @@ public List reservationsToExchange() { return this.reservationsToExchange; } - /** - * Set the reservationsToExchange property: Details of the reservations being returned. - * - * @param reservationsToExchange the reservationsToExchange value to set. - * @return the ExchangeResponseProperties object itself. - */ - public ExchangeResponseProperties - withReservationsToExchange(List reservationsToExchange) { - this.reservationsToExchange = reservationsToExchange; - return this; - } - /** * Get the policyResult property: Exchange policy errors. * @@ -215,46 +135,6 @@ public ExchangePolicyErrors policyResult() { return this.policyResult; } - /** - * Set the policyResult property: Exchange policy errors. - * - * @param policyResult the policyResult value to set. - * @return the ExchangeResponseProperties object itself. - */ - public ExchangeResponseProperties withPolicyResult(ExchangePolicyErrors policyResult) { - this.policyResult = policyResult; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (netPayable() != null) { - netPayable().validate(); - } - if (refundsTotal() != null) { - refundsTotal().validate(); - } - if (purchasesTotal() != null) { - purchasesTotal().validate(); - } - if (reservationsToPurchase() != null) { - reservationsToPurchase().forEach(e -> e.validate()); - } - if (savingsPlansToPurchase() != null) { - savingsPlansToPurchase().forEach(e -> e.validate()); - } - if (reservationsToExchange() != null) { - reservationsToExchange().forEach(e -> e.validate()); - } - if (policyResult() != null) { - policyResult().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Exchanges.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Exchanges.java index 1c1fb8c92656..0708694a4f2b 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Exchanges.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Exchanges.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.reservations.models; @@ -15,11 +15,11 @@ public interface Exchanges { * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @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 exchange operation result. + * @return the response. */ ExchangeOperationResultResponse post(ExchangeRequest body); @@ -28,12 +28,12 @@ public interface Exchanges { * * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. * - * @param body Request containing the refunds and purchases that need to be executed. + * @param body The request body. * @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 exchange operation result. + * @return the response. */ ExchangeOperationResultResponse post(ExchangeRequest body, Context context); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExtendedStatusInfo.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExtendedStatusInfo.java index 620adc8f199d..f1109282f428 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExtendedStatusInfo.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ExtendedStatusInfo.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.reservations.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 @@ /** * The ExtendedStatusInfo model. */ -@Fluent +@Immutable public final class ExtendedStatusInfo implements JsonSerializable { /* * The statusCode property. @@ -29,7 +29,7 @@ public final class ExtendedStatusInfo implements JsonSerializable { /** - * Static value On for InstanceFlexibility. + * On. */ public static final InstanceFlexibility ON = fromString("On"); /** - * Static value Off for InstanceFlexibility. + * Off. */ public static final InstanceFlexibility OFF = fromString("Off"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/MergeRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/MergeRequest.java index 79a645ed44c4..8d01f6eb366f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/MergeRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/MergeRequest.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.reservations.models; @@ -63,17 +63,6 @@ public MergeRequest withSources(List sources) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/OperationDisplay.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/OperationDisplay.java index 1b93e7a8c457..410b3e257852 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/OperationDisplay.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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.reservations.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 an operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* * The provider property. @@ -39,7 +39,7 @@ public final class OperationDisplay implements JsonSerializable { /* * Required if status == failed or status == cancelled. If status == failed, provide an invariant error code used @@ -31,7 +31,7 @@ public final class OperationResultError implements JsonSerializable { /** - * Static value Succeeded for OperationStatus. + * Succeeded. */ public static final OperationStatus SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for OperationStatus. + * Failed. */ public static final OperationStatus FAILED = fromString("Failed"); /** - * Static value Cancelled for OperationStatus. + * Cancelled. */ public static final OperationStatus CANCELLED = fromString("Cancelled"); /** - * Static value Pending for OperationStatus. + * Pending. */ public static final OperationStatus PENDING = fromString("Pending"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Operations.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Operations.java index f84c7b2b135c..3927daabf60d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Operations.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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.reservations.models; @@ -18,7 +18,9 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations as paginated response with {@link PagedIterable}. + * @return operations. + * + * List all the operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -31,7 +33,9 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of operations as paginated response with {@link PagedIterable}. + * @return operations. + * + * List all the operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PatchModel.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PatchModel.java index 3f4ae557b2f3..7de447757522 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PatchModel.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PatchModel.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.reservations.models; @@ -233,17 +233,6 @@ public PatchModel withReviewDateTime(OffsetDateTime reviewDateTime) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PatchPropertiesRenewProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PatchPropertiesRenewProperties.java index 02f87b91373c..65d8c8438fe9 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PatchPropertiesRenewProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PatchPropertiesRenewProperties.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.reservations.models; @@ -47,17 +47,6 @@ public PatchPropertiesRenewProperties withPurchaseProperties(PurchaseRequest pur return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (purchaseProperties() != null) { - purchaseProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PaymentDetail.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PaymentDetail.java index 55de858dbea1..e9accd20b5fb 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PaymentDetail.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PaymentDetail.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.reservations.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,7 +16,7 @@ /** * Information about payment related to a reservation order. */ -@Fluent +@Immutable public final class PaymentDetail implements JsonSerializable { /* * Date when the payment needs to be done. @@ -56,7 +56,7 @@ public final class PaymentDetail implements JsonSerializable { /** * Creates an instance of PaymentDetail class. */ - public PaymentDetail() { + private PaymentDetail() { } /** @@ -68,17 +68,6 @@ public LocalDate dueDate() { return this.dueDate; } - /** - * Set the dueDate property: Date when the payment needs to be done. - * - * @param dueDate the dueDate value to set. - * @return the PaymentDetail object itself. - */ - public PaymentDetail withDueDate(LocalDate dueDate) { - this.dueDate = dueDate; - return this; - } - /** * Get the paymentDate property: Date when the transaction is completed. Is null when it is scheduled. * @@ -88,17 +77,6 @@ public LocalDate paymentDate() { return this.paymentDate; } - /** - * Set the paymentDate property: Date when the transaction is completed. Is null when it is scheduled. - * - * @param paymentDate the paymentDate value to set. - * @return the PaymentDetail object itself. - */ - public PaymentDetail withPaymentDate(LocalDate paymentDate) { - this.paymentDate = paymentDate; - return this; - } - /** * Get the pricingCurrencyTotal property: Amount in pricing currency. Tax not included. * @@ -108,17 +86,6 @@ public Price pricingCurrencyTotal() { return this.pricingCurrencyTotal; } - /** - * Set the pricingCurrencyTotal property: Amount in pricing currency. Tax not included. - * - * @param pricingCurrencyTotal the pricingCurrencyTotal value to set. - * @return the PaymentDetail object itself. - */ - public PaymentDetail withPricingCurrencyTotal(Price pricingCurrencyTotal) { - this.pricingCurrencyTotal = pricingCurrencyTotal; - return this; - } - /** * Get the billingCurrencyTotal property: Amount charged in Billing currency. Tax not included. Is null for future * payments. @@ -129,18 +96,6 @@ public Price billingCurrencyTotal() { return this.billingCurrencyTotal; } - /** - * Set the billingCurrencyTotal property: Amount charged in Billing currency. Tax not included. Is null for future - * payments. - * - * @param billingCurrencyTotal the billingCurrencyTotal value to set. - * @return the PaymentDetail object itself. - */ - public PaymentDetail withBillingCurrencyTotal(Price billingCurrencyTotal) { - this.billingCurrencyTotal = billingCurrencyTotal; - return this; - } - /** * Get the billingAccount property: Shows the Account that is charged for this payment. * @@ -150,17 +105,6 @@ public String billingAccount() { return this.billingAccount; } - /** - * Set the billingAccount property: Shows the Account that is charged for this payment. - * - * @param billingAccount the billingAccount value to set. - * @return the PaymentDetail object itself. - */ - public PaymentDetail withBillingAccount(String billingAccount) { - this.billingAccount = billingAccount; - return this; - } - /** * Get the status property: Describes whether the payment is completed, failed, cancelled or scheduled in the * future. @@ -171,18 +115,6 @@ public PaymentStatus status() { return this.status; } - /** - * Set the status property: Describes whether the payment is completed, failed, cancelled or scheduled in the - * future. - * - * @param status the status value to set. - * @return the PaymentDetail object itself. - */ - public PaymentDetail withStatus(PaymentStatus status) { - this.status = status; - return this; - } - /** * Get the extendedStatusInfo property: The extendedStatusInfo property. * @@ -192,34 +124,6 @@ public ExtendedStatusInfo extendedStatusInfo() { return this.extendedStatusInfo; } - /** - * Set the extendedStatusInfo property: The extendedStatusInfo property. - * - * @param extendedStatusInfo the extendedStatusInfo value to set. - * @return the PaymentDetail object itself. - */ - public PaymentDetail withExtendedStatusInfo(ExtendedStatusInfo extendedStatusInfo) { - this.extendedStatusInfo = extendedStatusInfo; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (pricingCurrencyTotal() != null) { - pricingCurrencyTotal().validate(); - } - if (billingCurrencyTotal() != null) { - billingCurrencyTotal().validate(); - } - if (extendedStatusInfo() != null) { - extendedStatusInfo().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PaymentStatus.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PaymentStatus.java index f40b5c82181e..d0a56cc7c25d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PaymentStatus.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PaymentStatus.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.reservations.models; @@ -12,22 +12,22 @@ */ public final class PaymentStatus extends ExpandableStringEnum { /** - * Static value Succeeded for PaymentStatus. + * Succeeded. */ public static final PaymentStatus SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for PaymentStatus. + * Failed. */ public static final PaymentStatus FAILED = fromString("Failed"); /** - * Static value Scheduled for PaymentStatus. + * Scheduled. */ public static final PaymentStatus SCHEDULED = fromString("Scheduled"); /** - * Static value Cancelled for PaymentStatus. + * Cancelled. */ public static final PaymentStatus CANCELLED = fromString("Cancelled"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Price.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Price.java index f1813e5df5de..c177856eca64 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Price.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Price.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.reservations.models; @@ -72,14 +72,6 @@ public Price withAmount(Double amount) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ProvisioningState.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ProvisioningState.java index b5b707ad6fd8..b1f9e02c4c89 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ProvisioningState.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ProvisioningState.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.reservations.models; @@ -12,67 +12,67 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value Creating for ProvisioningState. + * Creating. */ public static final ProvisioningState CREATING = fromString("Creating"); /** - * Static value PendingResourceHold for ProvisioningState. + * PendingResourceHold. */ public static final ProvisioningState PENDING_RESOURCE_HOLD = fromString("PendingResourceHold"); /** - * Static value ConfirmedResourceHold for ProvisioningState. + * ConfirmedResourceHold. */ public static final ProvisioningState CONFIRMED_RESOURCE_HOLD = fromString("ConfirmedResourceHold"); /** - * Static value PendingBilling for ProvisioningState. + * PendingBilling. */ public static final ProvisioningState PENDING_BILLING = fromString("PendingBilling"); /** - * Static value ConfirmedBilling for ProvisioningState. + * ConfirmedBilling. */ public static final ProvisioningState CONFIRMED_BILLING = fromString("ConfirmedBilling"); /** - * Static value Created for ProvisioningState. + * Created. */ public static final ProvisioningState CREATED = fromString("Created"); /** - * Static value Succeeded for ProvisioningState. + * Succeeded. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Cancelled for ProvisioningState. + * Cancelled. */ public static final ProvisioningState CANCELLED = fromString("Cancelled"); /** - * Static value Expired for ProvisioningState. + * Expired. */ public static final ProvisioningState EXPIRED = fromString("Expired"); /** - * Static value BillingFailed for ProvisioningState. + * BillingFailed. */ public static final ProvisioningState BILLING_FAILED = fromString("BillingFailed"); /** - * Static value Failed for ProvisioningState. + * Failed. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Split for ProvisioningState. + * Split. */ public static final ProvisioningState SPLIT = fromString("Split"); /** - * Static value Merged for ProvisioningState. + * Merged. */ public static final ProvisioningState MERGED = fromString("Merged"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequest.java index 46e6f0174217..4837a49b9cdd 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequest.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.reservations.models; @@ -90,7 +90,8 @@ private PurchaseRequestProperties innerProperties() { } /** - * Get the reservedResourceType property: The type of the resource that is being reserved. + * Get the reservedResourceType property: The type of the resource that is being reserved. In addition to below + * types we have also added the following: OpenAIPTU, MDC, Sentinel. * * @return the reservedResourceType value. */ @@ -99,7 +100,8 @@ public ReservedResourceType reservedResourceType() { } /** - * Set the reservedResourceType property: The type of the resource that is being reserved. + * Set the reservedResourceType property: The type of the resource that is being reserved. In addition to below + * types we have also added the following: OpenAIPTU, MDC, Sentinel. * * @param reservedResourceType the reservedResourceType value to set. * @return the PurchaseRequest object itself. @@ -376,20 +378,6 @@ public PurchaseRequest withReviewDateTime(OffsetDateTime reviewDateTime) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequestPropertiesReservedResourceProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequestPropertiesReservedResourceProperties.java index 6b1998488468..793bdaca3bac 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequestPropertiesReservedResourceProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequestPropertiesReservedResourceProperties.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.reservations.models; @@ -52,14 +52,6 @@ public InstanceFlexibility instanceFlexibility() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaProperties.java index fe3590e9a045..e45aeaf1c740 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaProperties.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.reservations.models; @@ -184,17 +184,6 @@ public QuotaProperties withProperties(Object properties) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - } - /** * {@inheritDoc} */ @@ -205,7 +194,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("unit", this.unit); jsonWriter.writeJsonField("name", this.name); jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); - jsonWriter.writeUntypedField("properties", this.properties); + if (this.properties != null) { + jsonWriter.writeUntypedField("properties", this.properties); + } return jsonWriter.writeEndObject(); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestDetails.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestDetails.java index aa7273b598cb..9db25d7f8d9b 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestDetails.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestDetails.java @@ -1,9 +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.reservations.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner; import java.time.OffsetDateTime; import java.util.List; @@ -33,6 +34,13 @@ public interface QuotaRequestDetails { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the provisioningState property: The quota request status. * diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestState.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestState.java index 7a489bccc9b9..ed8dd94fff45 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestState.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestState.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.reservations.models; @@ -12,27 +12,27 @@ */ public final class QuotaRequestState extends ExpandableStringEnum { /** - * Static value Accepted for QuotaRequestState. + * Accepted. */ public static final QuotaRequestState ACCEPTED = fromString("Accepted"); /** - * Static value Invalid for QuotaRequestState. + * Invalid. */ public static final QuotaRequestState INVALID = fromString("Invalid"); /** - * Static value Succeeded for QuotaRequestState. + * Succeeded. */ public static final QuotaRequestState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for QuotaRequestState. + * Failed. */ public static final QuotaRequestState FAILED = fromString("Failed"); /** - * Static value InProgress for QuotaRequestState. + * InProgress. */ public static final QuotaRequestState IN_PROGRESS = fromString("InProgress"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestStatus.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestStatus.java index 5c588d389da5..1bdb5e90c27d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestStatus.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestStatus.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.reservations.models; @@ -17,7 +17,7 @@ public interface QuotaRequestStatus { * ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response * with the requestId parameter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param id Quota Request ID. @@ -35,7 +35,7 @@ Response getWithResponse(String subscriptionId, String prov * ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response * with the requestId parameter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param id Quota Request ID. @@ -50,7 +50,7 @@ Response getWithResponse(String subscriptionId, String prov * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -64,7 +64,7 @@ Response getWithResponse(String subscriptionId, String prov * For the specified Azure region (location), subscription, and resource provider, get the history of the quota * requests for the past year. To select specific quota requests, use the oData filter. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param filter | Field | Supported operators | diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestSubmitResponse201.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestSubmitResponse201.java deleted file mode 100644 index df39950e2656..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestSubmitResponse201.java +++ /dev/null @@ -1,54 +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.reservations.models; - -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestSubmitResponse201Inner; - -/** - * An immutable client-side representation of QuotaRequestSubmitResponse201. - */ -public interface QuotaRequestSubmitResponse201 { - /** - * Gets the id property: The quota request ID. Use the requestId parameter to check the request status. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: Operation ID. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: Resource type. - * - * @return the type value. - */ - String type(); - - /** - * Gets the provisioningState property: The details of the quota request status. - * - * @return the provisioningState value. - */ - QuotaRequestState provisioningState(); - - /** - * Gets the message property: A user friendly message. - * - * @return the message value. - */ - String message(); - - /** - * Gets the inner com.azure.resourcemanager.reservations.fluent.models.QuotaRequestSubmitResponse201Inner object. - * - * @return the inner object. - */ - QuotaRequestSubmitResponse201Inner innerModel(); -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Quotas.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Quotas.java index f9e21ad2d7c3..5887a1fe34f1 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Quotas.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Quotas.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.reservations.models; @@ -16,7 +16,7 @@ public interface Quotas { * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to * submit quota update request. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -34,7 +34,7 @@ Response getWithResponse(String subscriptionId, String pr * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to * submit quota update request. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or @@ -50,7 +50,7 @@ Response getWithResponse(String subscriptionId, String pr * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -65,7 +65,7 @@ Response getWithResponse(String subscriptionId, String pr * Gets a list of current quotas (service limits) and usage for all resources. The response from the list quota * operation can be leveraged to request quota updates. * - * @param subscriptionId Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param providerId Azure resource provider ID. * @param location Azure region. * @param context The context to associate with this operation. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetHeaders.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetHeaders.java index 958fad700acd..1b69497f66b7 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetHeaders.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetHeaders.java @@ -1,22 +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.reservations.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; /** * The QuotasGetHeaders model. */ -@Fluent +@Immutable public final class QuotasGetHeaders { /* - * The Etag property. + * The ETag property. */ - private String etag; + private final String eTag; // HttpHeaders containing the raw property values. /** @@ -25,34 +25,15 @@ public final class QuotasGetHeaders { * @param rawHeaders The raw HttpHeaders that will be used to create the property values. */ public QuotasGetHeaders(HttpHeaders rawHeaders) { - this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); } /** - * Get the etag property: The Etag property. + * Get the eTag property: The ETag property. * - * @return the etag value. + * @return the eTag value. */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The Etag property. - * - * @param etag the etag value to set. - * @return the QuotasGetHeaders object itself. - */ - public QuotasGetHeaders withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { + public String eTag() { + return this.eTag; } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetResponse.java index d6724b528be8..99a8508185b8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetResponse.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetResponse.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListHeaders.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListHeaders.java deleted file mode 100644 index 04ac3aecbb9f..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListHeaders.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The QuotasListHeaders model. - */ -@Fluent -public final class QuotasListHeaders { - /* - * The Etag property. - */ - private String etag; - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of QuotasListHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public QuotasListHeaders(HttpHeaders rawHeaders) { - this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); - } - - /** - * Get the etag property: The Etag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The Etag property. - * - * @param etag the etag value to set. - * @return the QuotasListHeaders object itself. - */ - public QuotasListHeaders withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListNextHeaders.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListNextHeaders.java deleted file mode 100644 index 1c397f33fe2a..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListNextHeaders.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The QuotasListNextHeaders model. - */ -@Fluent -public final class QuotasListNextHeaders { - /* - * The Etag property. - */ - private String etag; - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of QuotasListNextHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public QuotasListNextHeaders(HttpHeaders rawHeaders) { - this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); - } - - /** - * Get the etag property: The Etag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The Etag property. - * - * @param etag the etag value to set. - * @return the QuotasListNextHeaders object itself. - */ - public QuotasListNextHeaders withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListNextResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListNextResponse.java deleted file mode 100644 index 0566986b4b46..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListNextResponse.java +++ /dev/null @@ -1,38 +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.reservations.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; - -/** - * Contains all response data for the listNext operation. - */ -public final class QuotasListNextResponse extends ResponseBase { - /** - * Creates an instance of QuotasListNextResponse. - * - * @param request the request which resulted in this QuotasListNextResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public QuotasListNextResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, QuotaLimits value, - QuotasListNextHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ - @Override - public QuotaLimits getValue() { - return super.getValue(); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListResponse.java deleted file mode 100644 index 1cfb2d9ac9d8..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/QuotasListResponse.java +++ /dev/null @@ -1,38 +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.reservations.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; - -/** - * Contains all response data for the list operation. - */ -public final class QuotasListResponse extends ResponseBase { - /** - * Creates an instance of QuotasListResponse. - * - * @param request the request which resulted in this QuotasListResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public QuotasListResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, QuotaLimits value, - QuotasListHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ - @Override - public QuotaLimits getValue() { - return super.getValue(); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundBillingInformation.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundBillingInformation.java index fd4487302674..bb6f30412a50 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundBillingInformation.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundBillingInformation.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.reservations.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 @@ /** * billing information. */ -@Fluent +@Immutable public final class RefundBillingInformation implements JsonSerializable { /* * Represent the billing plans. @@ -49,7 +49,7 @@ public final class RefundBillingInformation implements JsonSerializable { /* * Error code describing the reason that service is not able to process the incoming request @@ -29,7 +29,7 @@ public final class RefundPolicyError implements JsonSerializable { /* * Refund policy result property @@ -24,7 +24,7 @@ public final class RefundPolicyResult implements JsonSerializable { /* * Pricing information containing the amount and the currency code @@ -35,7 +35,7 @@ public final class RefundPolicyResultProperty implements JsonSerializable policyErrors() { return this.policyErrors; } - /** - * Set the policyErrors property: Refund Policy errors. - * - * @param policyErrors the policyErrors value to set. - * @return the RefundPolicyResultProperty object itself. - */ - public RefundPolicyResultProperty withPolicyErrors(List policyErrors) { - this.policyErrors = policyErrors; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (consumedRefundsTotal() != null) { - consumedRefundsTotal().validate(); - } - if (maxRefundLimit() != null) { - maxRefundLimit().validate(); - } - if (policyErrors() != null) { - policyErrors().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundRequest.java index f104c44bbb72..1f59c44ed5c7 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundRequest.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.reservations.models; @@ -50,17 +50,6 @@ public RefundRequest withProperties(RefundRequestProperties properties) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundRequestProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundRequestProperties.java index dc8eaa48e45c..d08017a0699a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundRequestProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundRequestProperties.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.reservations.models; @@ -123,17 +123,6 @@ public RefundRequestProperties withReturnReason(String returnReason) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (reservationToReturn() != null) { - reservationToReturn().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundResponse.java deleted file mode 100644 index e3e058433462..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundResponse.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.reservations.models; - -import com.azure.resourcemanager.reservations.fluent.models.RefundResponseInner; - -/** - * An immutable client-side representation of RefundResponse. - */ -public interface RefundResponse { - /** - * Gets the id property: Fully qualified identifier of the reservation being returned. - * - * @return the id value. - */ - String id(); - - /** - * Gets the properties property: The refund properties of reservation. - * - * @return the properties value. - */ - RefundResponseProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.reservations.fluent.models.RefundResponseInner object. - * - * @return the inner object. - */ - RefundResponseInner innerModel(); -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundResponseProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundResponseProperties.java index 3145596c528a..3bbcf34b48e8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundResponseProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RefundResponseProperties.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.reservations.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 @@ /** * The refund properties of reservation. */ -@Fluent +@Immutable public final class RefundResponseProperties implements JsonSerializable { /* * Refund session identifier @@ -49,7 +49,7 @@ public final class RefundResponseProperties implements JsonSerializable { /* * The request for reservation purchase @@ -36,7 +36,7 @@ public final class RenewPropertiesResponse implements JsonSerializable { /* @@ -31,7 +31,7 @@ public final class RenewPropertiesResponseBillingCurrencyTotal /** * Creates an instance of RenewPropertiesResponseBillingCurrencyTotal class. */ - public RenewPropertiesResponseBillingCurrencyTotal() { + private RenewPropertiesResponseBillingCurrencyTotal() { } /** @@ -43,17 +43,6 @@ public String currencyCode() { return this.currencyCode; } - /** - * Set the currencyCode property: The ISO 4217 3-letter currency code for the currency used by this purchase record. - * - * @param currencyCode the currencyCode value to set. - * @return the RenewPropertiesResponseBillingCurrencyTotal object itself. - */ - public RenewPropertiesResponseBillingCurrencyTotal withCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; - return this; - } - /** * Get the amount property: The amount property. * @@ -63,25 +52,6 @@ public Float amount() { return this.amount; } - /** - * Set the amount property: The amount property. - * - * @param amount the amount value to set. - * @return the RenewPropertiesResponseBillingCurrencyTotal object itself. - */ - public RenewPropertiesResponseBillingCurrencyTotal withAmount(Float amount) { - this.amount = amount; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RenewPropertiesResponsePricingCurrencyTotal.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RenewPropertiesResponsePricingCurrencyTotal.java index aa8099f31e1f..72b6f86cfdc0 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RenewPropertiesResponsePricingCurrencyTotal.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/RenewPropertiesResponsePricingCurrencyTotal.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.reservations.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 @@ * Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is * locked price 30 days before expiry. */ -@Fluent +@Immutable public final class RenewPropertiesResponsePricingCurrencyTotal implements JsonSerializable { /* @@ -31,7 +31,7 @@ public final class RenewPropertiesResponsePricingCurrencyTotal /** * Creates an instance of RenewPropertiesResponsePricingCurrencyTotal class. */ - public RenewPropertiesResponsePricingCurrencyTotal() { + private RenewPropertiesResponsePricingCurrencyTotal() { } /** @@ -43,17 +43,6 @@ public String currencyCode() { return this.currencyCode; } - /** - * Set the currencyCode property: The ISO 4217 3-letter currency code for the currency used by this purchase record. - * - * @param currencyCode the currencyCode value to set. - * @return the RenewPropertiesResponsePricingCurrencyTotal object itself. - */ - public RenewPropertiesResponsePricingCurrencyTotal withCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; - return this; - } - /** * Get the amount property: The amount property. * @@ -63,25 +52,6 @@ public Float amount() { return this.amount; } - /** - * Set the amount property: The amount property. - * - * @param amount the amount value to set. - * @return the RenewPropertiesResponsePricingCurrencyTotal object itself. - */ - public RenewPropertiesResponsePricingCurrencyTotal withAmount(Float amount) { - this.amount = amount; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationBillingPlan.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationBillingPlan.java index 0bdea90ac8e3..5e4008dadc05 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationBillingPlan.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationBillingPlan.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.reservations.models; @@ -12,12 +12,12 @@ */ public final class ReservationBillingPlan extends ExpandableStringEnum { /** - * Static value Upfront for ReservationBillingPlan. + * Upfront. */ public static final ReservationBillingPlan UPFRONT = fromString("Upfront"); /** - * Static value Monthly for ReservationBillingPlan. + * Monthly. */ public static final ReservationBillingPlan MONTHLY = fromString("Monthly"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationMergeProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationMergeProperties.java index 973b90913842..fa18ac469445 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationMergeProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationMergeProperties.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.reservations.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 @@ /** * Properties of reservation merge. */ -@Fluent +@Immutable public final class ReservationMergeProperties implements JsonSerializable { /* * Reservation resource id Created due to the merge. Format of the resource id is @@ -32,7 +32,7 @@ public final class ReservationMergeProperties implements JsonSerializable mergeSources() { return this.mergeSources; } - /** - * Set the mergeSources property: Resource ids of the source reservation's merged to form this reservation. Format - * of the resource id is - * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. - * - * @param mergeSources the mergeSources value to set. - * @return the ReservationMergeProperties object itself. - */ - public ReservationMergeProperties withMergeSources(List mergeSources) { - this.mergeSources = mergeSources; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderBillingPlanInformation.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderBillingPlanInformation.java index 5ce9bb2c46cc..fc889be1765c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderBillingPlanInformation.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderBillingPlanInformation.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.reservations.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; @@ -17,7 +17,7 @@ /** * Information describing the type of billing plan for this reservation. */ -@Fluent +@Immutable public final class ReservationOrderBillingPlanInformation implements JsonSerializable { /* @@ -43,7 +43,7 @@ public final class ReservationOrderBillingPlanInformation /** * Creates an instance of ReservationOrderBillingPlanInformation class. */ - public ReservationOrderBillingPlanInformation() { + private ReservationOrderBillingPlanInformation() { } /** @@ -55,17 +55,6 @@ public Price pricingCurrencyTotal() { return this.pricingCurrencyTotal; } - /** - * Set the pricingCurrencyTotal property: Amount of money to be paid for the Order. Tax is not included. - * - * @param pricingCurrencyTotal the pricingCurrencyTotal value to set. - * @return the ReservationOrderBillingPlanInformation object itself. - */ - public ReservationOrderBillingPlanInformation withPricingCurrencyTotal(Price pricingCurrencyTotal) { - this.pricingCurrencyTotal = pricingCurrencyTotal; - return this; - } - /** * Get the startDate property: Date when the billing plan has started. * @@ -75,17 +64,6 @@ public LocalDate startDate() { return this.startDate; } - /** - * Set the startDate property: Date when the billing plan has started. - * - * @param startDate the startDate value to set. - * @return the ReservationOrderBillingPlanInformation object itself. - */ - public ReservationOrderBillingPlanInformation withStartDate(LocalDate startDate) { - this.startDate = startDate; - return this; - } - /** * Get the nextPaymentDueDate property: For recurring billing plans, indicates the date when next payment will be * processed. Null when total is paid off. @@ -96,18 +74,6 @@ public LocalDate nextPaymentDueDate() { return this.nextPaymentDueDate; } - /** - * Set the nextPaymentDueDate property: For recurring billing plans, indicates the date when next payment will be - * processed. Null when total is paid off. - * - * @param nextPaymentDueDate the nextPaymentDueDate value to set. - * @return the ReservationOrderBillingPlanInformation object itself. - */ - public ReservationOrderBillingPlanInformation withNextPaymentDueDate(LocalDate nextPaymentDueDate) { - this.nextPaymentDueDate = nextPaymentDueDate; - return this; - } - /** * Get the transactions property: The transactions property. * @@ -117,31 +83,6 @@ public List transactions() { return this.transactions; } - /** - * Set the transactions property: The transactions property. - * - * @param transactions the transactions value to set. - * @return the ReservationOrderBillingPlanInformation object itself. - */ - public ReservationOrderBillingPlanInformation withTransactions(List transactions) { - this.transactions = transactions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (pricingCurrencyTotal() != null) { - pricingCurrencyTotal().validate(); - } - if (transactions() != null) { - transactions().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderResponse.java index dfced350123b..29a91a6f7b63 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderResponse.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderResponse.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.reservations.models; @@ -43,7 +43,7 @@ public interface ReservationOrderResponse { Integer etag(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrders.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrders.java index 360d58c54776..14fbba379a44 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrders.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrders.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.reservations.models; @@ -13,55 +13,36 @@ */ public interface ReservationOrders { /** - * Calculate price for a `ReservationOrder`. + * Get a specific `ReservationOrder`. * - * Calculate price for placing a `ReservationOrder`. + * Get the details of the `ReservationOrder`. * - * @param body Information needed for calculate or purchase reservation. + * @param reservationOrderId Order Id of the reservation. + * @param expand May be used to expand the planInformation. * @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 calculate price for reservation along with {@link Response}. - */ - Response calculateWithResponse(PurchaseRequest body, Context context); - - /** - * Calculate price for a `ReservationOrder`. - * - * Calculate price for placing a `ReservationOrder`. - * - * @param body Information needed for calculate or purchase reservation. - * @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 calculate price for reservation. - */ - CalculatePriceResponse calculate(PurchaseRequest body); - - /** - * Get all `ReservationOrder`s. - * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. + * @return a specific `ReservationOrder`. * - * @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 list of `ReservationOrder`s as paginated response with {@link PagedIterable}. + * Get the details of the `ReservationOrder` along with {@link Response}. */ - PagedIterable list(); + Response getWithResponse(String reservationOrderId, String expand, Context context); /** - * Get all `ReservationOrder`s. + * Get a specific `ReservationOrder`. * - * List of all the `ReservationOrder`s that the user has access to in the current tenant. + * Get the details of the `ReservationOrder`. * - * @param context The context to associate with this operation. + * @param reservationOrderId Order Id of the reservation. * @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 list of `ReservationOrder`s as paginated response with {@link PagedIterable}. + * @return a specific `ReservationOrder`. + * + * Get the details of the `ReservationOrder`. */ - PagedIterable list(Context context); + ReservationOrderResponse get(String reservationOrderId); /** * Purchase `ReservationOrder` @@ -93,32 +74,34 @@ public interface ReservationOrders { ReservationOrderResponse purchase(String reservationOrderId, PurchaseRequest body, Context context); /** - * Get a specific `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Get the details of the `ReservationOrder`. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. - * @param expand May be used to expand the planInformation. - * @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 details of the `ReservationOrder` along with {@link Response}. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant as paginated response with + * {@link PagedIterable}. */ - Response getWithResponse(String reservationOrderId, String expand, Context context); + PagedIterable list(); /** - * Get a specific `ReservationOrder`. + * Get all `ReservationOrder`s. * - * Get the details of the `ReservationOrder`. + * List of all the `ReservationOrder`s that the user has access to in the current tenant. * - * @param reservationOrderId Order Id of the reservation. + * @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 details of the `ReservationOrder`. + * @return all `ReservationOrder`s. + * + * List of all the `ReservationOrder`s that the user has access to in the current tenant as paginated response with + * {@link PagedIterable}. */ - ReservationOrderResponse get(String reservationOrderId); + PagedIterable list(Context context); /** * Change directory of `ReservationOrder`. @@ -149,4 +132,31 @@ Response changeDirectoryWithResponse(String reservation * @return change directory response. */ ChangeDirectoryResponse changeDirectory(String reservationOrderId, ChangeDirectoryRequest body); + + /** + * Calculate price for a `ReservationOrder`. + * + * Calculate price for placing a `ReservationOrder`. + * + * @param body The request body. + * @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 calculate price for reservation along with {@link Response}. + */ + Response calculateWithResponse(PurchaseRequest body, Context context); + + /** + * Calculate price for a `ReservationOrder`. + * + * Calculate price for placing a `ReservationOrder`. + * + * @param body The request body. + * @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 calculate price for reservation. + */ + CalculatePriceResponse calculate(PurchaseRequest body); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationResponse.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationResponse.java index 5143bcddcbf1..16886e7bfb1e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationResponse.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationResponse.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.reservations.models; @@ -32,6 +32,13 @@ public interface ReservationResponse { */ String type(); + /** + * Gets the properties property: The properties associated to this reservation. + * + * @return the properties value. + */ + ReservationsProperties properties(); + /** * Gets the location property: The Azure region where the reserved resource lives. * @@ -53,19 +60,12 @@ public interface ReservationResponse { */ SkuName sku(); - /** - * Gets the properties property: The properties associated to this reservation. - * - * @return the properties value. - */ - ReservationsProperties properties(); - /** * Gets the kind property: Resource Provider type to be reserved. * * @return the kind value. */ - Kind kind(); + ReservationResponseKind kind(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Kind.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationResponseKind.java similarity index 54% rename from sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Kind.java rename to sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationResponseKind.java index af0a338c51c8..6cee65bcc58c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Kind.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationResponseKind.java @@ -1,39 +1,39 @@ // 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.reservations.models; /** - * Resource Provider type to be reserved. + * Defines values for ReservationResponseKind. */ -public enum Kind { +public enum ReservationResponseKind { /** * Enum value Microsoft.Compute. */ MICROSOFT_COMPUTE("Microsoft.Compute"); /** - * The actual serialized value for a Kind instance. + * The actual serialized value for a ReservationResponseKind instance. */ private final String value; - Kind(String value) { + ReservationResponseKind(String value) { this.value = value; } /** - * Parses a serialized value to a Kind instance. + * Parses a serialized value to a ReservationResponseKind instance. * * @param value the serialized value to parse. - * @return the parsed Kind object, or null if unable to parse. + * @return the parsed ReservationResponseKind object, or null if unable to parse. */ - public static Kind fromString(String value) { + public static ReservationResponseKind fromString(String value) { if (value == null) { return null; } - Kind[] items = Kind.values(); - for (Kind item : items) { + ReservationResponseKind[] items = ReservationResponseKind.values(); + for (ReservationResponseKind item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationSplitProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationSplitProperties.java index a3ad58658d24..7c8ab74f2eea 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationSplitProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationSplitProperties.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.reservations.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 @@ /** * Properties of reservation split. */ -@Fluent +@Immutable public final class ReservationSplitProperties implements JsonSerializable { /* * List of destination resource id that are created due to split. Format of the resource id is @@ -32,7 +32,7 @@ public final class ReservationSplitProperties implements JsonSerializable splitDestinations() { return this.splitDestinations; } - /** - * Set the splitDestinations property: List of destination resource id that are created due to split. Format of the - * resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. - * - * @param splitDestinations the splitDestinations value to set. - * @return the ReservationSplitProperties object itself. - */ - public ReservationSplitProperties withSplitDestinations(List splitDestinations) { - this.splitDestinations = splitDestinations; - return this; - } - /** * Get the splitSource property: Resource id of the reservation from which this is split. Format of the resource id * is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. @@ -67,26 +55,6 @@ public String splitSource() { return this.splitSource; } - /** - * Set the splitSource property: Resource id of the reservation from which this is split. Format of the resource id - * is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. - * - * @param splitSource the splitSource value to set. - * @return the ReservationSplitProperties object itself. - */ - public ReservationSplitProperties withSplitSource(String splitSource) { - this.splitSource = splitSource; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationStatusCode.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationStatusCode.java index 296b8d31b5d0..cde85c561a6a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationStatusCode.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationStatusCode.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.reservations.models; @@ -12,52 +12,52 @@ */ public final class ReservationStatusCode extends ExpandableStringEnum { /** - * Static value None for ReservationStatusCode. + * None. */ public static final ReservationStatusCode NONE = fromString("None"); /** - * Static value Pending for ReservationStatusCode. + * Pending. */ public static final ReservationStatusCode PENDING = fromString("Pending"); /** - * Static value Processing for ReservationStatusCode. + * Processing. */ public static final ReservationStatusCode PROCESSING = fromString("Processing"); /** - * Static value Active for ReservationStatusCode. + * Active. */ public static final ReservationStatusCode ACTIVE = fromString("Active"); /** - * Static value PurchaseError for ReservationStatusCode. + * PurchaseError. */ public static final ReservationStatusCode PURCHASE_ERROR = fromString("PurchaseError"); /** - * Static value PaymentInstrumentError for ReservationStatusCode. + * PaymentInstrumentError. */ public static final ReservationStatusCode PAYMENT_INSTRUMENT_ERROR = fromString("PaymentInstrumentError"); /** - * Static value Split for ReservationStatusCode. + * Split. */ public static final ReservationStatusCode SPLIT = fromString("Split"); /** - * Static value Merged for ReservationStatusCode. + * Merged. */ public static final ReservationStatusCode MERGED = fromString("Merged"); /** - * Static value Expired for ReservationStatusCode. + * Expired. */ public static final ReservationStatusCode EXPIRED = fromString("Expired"); /** - * Static value Succeeded for ReservationStatusCode. + * Succeeded. */ public static final ReservationStatusCode SUCCEEDED = fromString("Succeeded"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationSummary.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationSummary.java index ecaa7d64e940..9ff01516a0d5 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationSummary.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationSummary.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.reservations.models; @@ -64,7 +64,7 @@ public final class ReservationSummary implements JsonSerializable { /* * Resource id of the source reservation that gets swapped. Format of the resource id is @@ -31,7 +31,7 @@ public final class ReservationSwapProperties implements JsonSerializable { /** - * Static value P1Y for ReservationTerm. + * P1Y. */ public static final ReservationTerm P1Y = fromString("P1Y"); /** - * Static value P3Y for ReservationTerm. + * P3Y. */ public static final ReservationTerm P3Y = fromString("P3Y"); /** - * Static value P5Y for ReservationTerm. + * P5Y. */ public static final ReservationTerm P5Y = fromString("P5Y"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationToExchange.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationToExchange.java index 3c3d2f555129..723b295c21b8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationToExchange.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationToExchange.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.reservations.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 @@ /** * Reservation refund details. */ -@Fluent +@Immutable public final class ReservationToExchange implements JsonSerializable { /* * Fully qualified id of the reservation being returned. @@ -39,7 +39,7 @@ public final class ReservationToExchange implements JsonSerializable { /* @@ -30,7 +30,7 @@ public final class ReservationToPurchaseCalculateExchange /** * Creates an instance of ReservationToPurchaseCalculateExchange class. */ - public ReservationToPurchaseCalculateExchange() { + private ReservationToPurchaseCalculateExchange() { } /** @@ -42,17 +42,6 @@ public PurchaseRequest properties() { return this.properties; } - /** - * Set the properties property: The request for reservation purchase. - * - * @param properties the properties value to set. - * @return the ReservationToPurchaseCalculateExchange object itself. - */ - public ReservationToPurchaseCalculateExchange withProperties(PurchaseRequest properties) { - this.properties = properties; - return this; - } - /** * Get the billingCurrencyTotal property: Pricing information containing the amount and the currency code. * @@ -62,31 +51,6 @@ public Price billingCurrencyTotal() { return this.billingCurrencyTotal; } - /** - * Set the billingCurrencyTotal property: Pricing information containing the amount and the currency code. - * - * @param billingCurrencyTotal the billingCurrencyTotal value to set. - * @return the ReservationToPurchaseCalculateExchange object itself. - */ - public ReservationToPurchaseCalculateExchange withBillingCurrencyTotal(Price billingCurrencyTotal) { - this.billingCurrencyTotal = billingCurrencyTotal; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (billingCurrencyTotal() != null) { - billingCurrencyTotal().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationToPurchaseExchange.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationToPurchaseExchange.java index f4d5f3643ba9..59f041cf7c1a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationToPurchaseExchange.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationToPurchaseExchange.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.reservations.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 @@ /** * Reservation purchase details. */ -@Fluent +@Immutable public final class ReservationToPurchaseExchange implements JsonSerializable { /* * Fully qualified id of the reservationOrder being purchased @@ -45,7 +45,7 @@ public final class ReservationToPurchaseExchange implements JsonSerializable { /* * Fully qualified id of the reservation being returned. @@ -44,7 +44,7 @@ public final class ReservationToReturnForExchange implements JsonSerializable getWithResponse(String reservationOrderId, String reservationId, String expand, + Context context); /** - * Get Available Scopes for `Reservation`. + * Get `Reservation` details. * - * Check whether the scopes from request is valid for `Reservation`. + * Get specific `Reservation` details. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param body Scopes to be checked for eligibility. - * @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 available scope api containing scopes and their eligibilities. + * @return `Reservation` details. + * + * Get specific `Reservation` details. */ - AvailableScopeProperties availableScopes(String reservationOrderId, String reservationId, - AvailableScopeRequest body, Context context); + ReservationResponse get(String reservationOrderId, String reservationId); /** - * Split the `Reservation`. + * Updates a `Reservation`. * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. + * @param reservationId Id of the reservation item. + * @param parameters Information needed to patch a reservation item. * @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 array of ReservationResponse. + * @return the definition of the reservation. */ - List split(String reservationOrderId, SplitRequest body); + ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters); /** - * Split the `Reservation`. + * Updates a `Reservation`. * - * Split a `Reservation` into two `Reservation`s with specified quantity distribution. + * Updates the applied scopes of the `Reservation`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed to Split a reservation item. + * @param reservationId Id of the reservation item. + * @param parameters Information needed to patch a reservation item. * @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 array of ReservationResponse. + * @return the definition of the reservation. */ - List split(String reservationOrderId, SplitRequest body, Context context); + ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters, Context context); /** - * Merges two `Reservation`s. + * Get `Reservation`s in a given reservation Order * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. * @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 array of ReservationResponse. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` as paginated response with {@link PagedIterable}. */ - List merge(String reservationOrderId, MergeRequest body); + PagedIterable list(String reservationOrderId); /** - * Merges two `Reservation`s. + * Get `Reservation`s in a given reservation Order * - * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same - * properties. + * List `Reservation`s within a single `ReservationOrder`. * * @param reservationOrderId Order Id of the reservation. - * @param body Information needed for commercial request for a reservation. * @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 array of ReservationResponse. + * @return `Reservation`s in a given reservation Order + * + * List `Reservation`s within a single `ReservationOrder` as paginated response with {@link PagedIterable}. */ - List merge(String reservationOrderId, MergeRequest body, Context context); + PagedIterable list(String reservationOrderId, Context context); /** - * Get `Reservation`s in a given reservation Order + * Get Available Scopes for `Reservation`. * - * List `Reservation`s within a single `ReservationOrder`. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. + * @return available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ - PagedIterable list(String reservationOrderId); + AvailableScopeProperties availableScopes(String reservationOrderId, String reservationId, + AvailableScopeRequest body); /** - * Get `Reservation`s in a given reservation Order + * Get Available Scopes for `Reservation`. * - * List `Reservation`s within a single `ReservationOrder`. + * Check whether the scopes from request is valid for `Reservation`. * * @param reservationOrderId Order Id of the reservation. + * @param reservationId Id of the reservation item. + * @param body Scopes to be checked for eligibility. * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. + * @return available Scopes for `Reservation`. + * + * Check whether the scopes from request is valid for `Reservation`. */ - PagedIterable list(String reservationOrderId, Context context); + AvailableScopeProperties availableScopes(String reservationOrderId, String reservationId, + AvailableScopeRequest body, Context context); /** - * Get `Reservation` details. + * Archive a `Reservation`. * - * Get specific `Reservation` details. + * Archiving a `Reservation` moves it to `Archived` state. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param expand Supported value of this query is renewProperties. * @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 specific `Reservation` details along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String reservationOrderId, String reservationId, String expand, - Context context); + Response archiveWithResponse(String reservationOrderId, String reservationId, Context context); /** - * Get `Reservation` details. + * Archive a `Reservation`. * - * Get specific `Reservation` details. + * Archiving a `Reservation` moves it to `Archived` state. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. * @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 specific `Reservation` details. */ - ReservationResponse get(String reservationOrderId, String reservationId); + void archive(String reservationOrderId, String reservationId); /** - * Updates a `Reservation`. + * Unarchive a `Reservation`. * - * Updates the applied scopes of the `Reservation`. + * Restores a `Reservation` to the state it was before archiving. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. + * @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 definition of the reservation. + * @return the {@link Response}. */ - ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters); + Response unarchiveWithResponse(String reservationOrderId, String reservationId, Context context); /** - * Updates a `Reservation`. + * Unarchive a `Reservation`. * - * Updates the applied scopes of the `Reservation`. + * Restores a `Reservation` to the state it was before archiving. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @param parameters Information needed to patch a reservation item. - * @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 definition of the reservation. */ - ReservationResponse update(String reservationOrderId, String reservationId, PatchModel parameters, Context context); + void unarchive(String reservationOrderId, String reservationId); /** - * Archive a `Reservation`. + * Get `Reservation` revisions. * - * Archiving a `Reservation` moves it to `Archived` state. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. - * @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}. + * @return `Reservation` revisions. + * + * List of all the revisions for the `Reservation` as paginated response with {@link PagedIterable}. */ - Response archiveWithResponse(String reservationOrderId, String reservationId, Context context); + PagedIterable listRevisions(String reservationOrderId, String reservationId); /** - * Archive a `Reservation`. + * Get `Reservation` revisions. * - * Archiving a `Reservation` moves it to `Archived` state. + * List of all the revisions for the `Reservation`. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation item. + * @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 `Reservation` revisions. + * + * List of all the revisions for the `Reservation` as paginated response with {@link PagedIterable}. */ - void archive(String reservationOrderId, String reservationId); + PagedIterable listRevisions(String reservationOrderId, String reservationId, Context context); /** - * Unarchive a `Reservation`. + * Split the `Reservation`. * - * Restores a `Reservation` to the state it was before archiving. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. - * @param context The context to associate with this operation. + * @param body Information needed to Split a reservation item. * @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}. + * @return the response. */ - Response unarchiveWithResponse(String reservationOrderId, String reservationId, Context context); + List split(String reservationOrderId, SplitRequest body); /** - * Unarchive a `Reservation`. + * Split the `Reservation`. * - * Restores a `Reservation` to the state it was before archiving. + * Split a `Reservation` into two `Reservation`s with specified quantity distribution. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed to Split a reservation item. + * @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. */ - void unarchive(String reservationOrderId, String reservationId); + List split(String reservationOrderId, SplitRequest body, Context context); /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. + * @return the response. */ - PagedIterable listRevisions(String reservationOrderId, String reservationId); + List merge(String reservationOrderId, MergeRequest body); /** - * Get `Reservation` revisions. + * Merges two `Reservation`s. * - * List of all the revisions for the `Reservation`. + * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same + * properties. * * @param reservationOrderId Order Id of the reservation. - * @param reservationId Id of the reservation item. + * @param body Information needed for commercial request for a reservation. * @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 list of `Reservation`s as paginated response with {@link PagedIterable}. + * @return the response. */ - PagedIterable listRevisions(String reservationOrderId, String reservationId, Context context); + List merge(String reservationOrderId, MergeRequest body, Context context); /** * List the reservations and the roll up counts of reservations group by provisioning states that the user has diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsProperties.java index 444f156ba6ec..ae7bb6962063 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsProperties.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.reservations.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; @@ -20,7 +20,7 @@ /** * The properties of the reservations. */ -@Fluent +@Immutable public final class ReservationsProperties implements JsonSerializable { /* * The type of the resource that is being reserved. @@ -59,7 +59,7 @@ public final class ReservationsProperties implements JsonSerializable appliedScopes() { return this.appliedScopes; } - /** - * Set the appliedScopes property: The list of applied scopes. - * - * @param appliedScopes the appliedScopes value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withAppliedScopes(List appliedScopes) { - this.appliedScopes = appliedScopes; - return this; - } - /** * Get the appliedScopeType property: The applied scope type. * @@ -298,17 +253,6 @@ public AppliedScopeType appliedScopeType() { return this.appliedScopeType; } - /** - * Set the appliedScopeType property: The applied scope type. - * - * @param appliedScopeType the appliedScopeType value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withAppliedScopeType(AppliedScopeType appliedScopeType) { - this.appliedScopeType = appliedScopeType; - return this; - } - /** * Get the archived property: Indicates if the reservation is archived. * @@ -318,17 +262,6 @@ public Boolean archived() { return this.archived; } - /** - * Set the archived property: Indicates if the reservation is archived. - * - * @param archived the archived value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withArchived(Boolean archived) { - this.archived = archived; - return this; - } - /** * Get the capabilities property: Capabilities of the reservation. * @@ -339,18 +272,7 @@ public String capabilities() { } /** - * Set the capabilities property: Capabilities of the reservation. - * - * @param capabilities the capabilities value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withCapabilities(String capabilities) { - this.capabilities = capabilities; - return this; - } - - /** - * Get the quantity property: Quantity of the skus that are part of the reservation. + * Get the quantity property: Quantity of the skus that are part of the reservation. Must be greater than zero. * * @return the quantity value. */ @@ -358,17 +280,6 @@ public Integer quantity() { return this.quantity; } - /** - * Set the quantity property: Quantity of the skus that are part of the reservation. - * - * @param quantity the quantity value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withQuantity(Integer quantity) { - this.quantity = quantity; - return this; - } - /** * Get the provisioningState property: Current state of the reservation. * @@ -378,17 +289,6 @@ public ProvisioningState provisioningState() { return this.provisioningState; } - /** - * Set the provisioningState property: Current state of the reservation. - * - * @param provisioningState the provisioningState value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - /** * Get the effectiveDateTime property: DateTime of the reservation starting when this version is effective from. * @@ -398,17 +298,6 @@ public OffsetDateTime effectiveDateTime() { return this.effectiveDateTime; } - /** - * Set the effectiveDateTime property: DateTime of the reservation starting when this version is effective from. - * - * @param effectiveDateTime the effectiveDateTime value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withEffectiveDateTime(OffsetDateTime effectiveDateTime) { - this.effectiveDateTime = effectiveDateTime; - return this; - } - /** * Get the benefitStartTime property: This is the DateTime when the reservation benefit started. * @@ -418,17 +307,6 @@ public OffsetDateTime benefitStartTime() { return this.benefitStartTime; } - /** - * Set the benefitStartTime property: This is the DateTime when the reservation benefit started. - * - * @param benefitStartTime the benefitStartTime value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withBenefitStartTime(OffsetDateTime benefitStartTime) { - this.benefitStartTime = benefitStartTime; - return this; - } - /** * Get the lastUpdatedDateTime property: DateTime of the last time the reservation was updated. * @@ -447,17 +325,6 @@ public LocalDate expiryDate() { return this.expiryDate; } - /** - * Set the expiryDate property: This is the date when the reservation will expire. - * - * @param expiryDate the expiryDate value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withExpiryDate(LocalDate expiryDate) { - this.expiryDate = expiryDate; - return this; - } - /** * Get the expiryDateTime property: This is the date-time when the reservation will expire. * @@ -467,17 +334,6 @@ public OffsetDateTime expiryDateTime() { return this.expiryDateTime; } - /** - * Set the expiryDateTime property: This is the date-time when the reservation will expire. - * - * @param expiryDateTime the expiryDateTime value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withExpiryDateTime(OffsetDateTime expiryDateTime) { - this.expiryDateTime = expiryDateTime; - return this; - } - /** * Get the reviewDateTime property: This is the date-time when the Azure Hybrid Benefit needs to be reviewed. * @@ -487,17 +343,6 @@ public OffsetDateTime reviewDateTime() { return this.reviewDateTime; } - /** - * Set the reviewDateTime property: This is the date-time when the Azure Hybrid Benefit needs to be reviewed. - * - * @param reviewDateTime the reviewDateTime value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withReviewDateTime(OffsetDateTime reviewDateTime) { - this.reviewDateTime = reviewDateTime; - return this; - } - /** * Get the skuDescription property: Description of the sku in english. * @@ -507,17 +352,6 @@ public String skuDescription() { return this.skuDescription; } - /** - * Set the skuDescription property: Description of the sku in english. - * - * @param skuDescription the skuDescription value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withSkuDescription(String skuDescription) { - this.skuDescription = skuDescription; - return this; - } - /** * Get the extendedStatusInfo property: The message giving detailed information about the status code. * @@ -527,17 +361,6 @@ public ExtendedStatusInfo extendedStatusInfo() { return this.extendedStatusInfo; } - /** - * Set the extendedStatusInfo property: The message giving detailed information about the status code. - * - * @param extendedStatusInfo the extendedStatusInfo value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withExtendedStatusInfo(ExtendedStatusInfo extendedStatusInfo) { - this.extendedStatusInfo = extendedStatusInfo; - return this; - } - /** * Get the billingPlan property: The billing plan options available for this sku. * @@ -547,17 +370,6 @@ public ReservationBillingPlan billingPlan() { return this.billingPlan; } - /** - * Set the billingPlan property: The billing plan options available for this sku. - * - * @param billingPlan the billingPlan value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withBillingPlan(ReservationBillingPlan billingPlan) { - this.billingPlan = billingPlan; - return this; - } - /** * Get the displayProvisioningState property: The provisioning state of the reservation for display, e.g. Succeeded. * @@ -585,17 +397,6 @@ public LocalDate purchaseDate() { return this.purchaseDate; } - /** - * Set the purchaseDate property: This is the date when the reservation was purchased. - * - * @param purchaseDate the purchaseDate value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withPurchaseDate(LocalDate purchaseDate) { - this.purchaseDate = purchaseDate; - return this; - } - /** * Get the purchaseDateTime property: This is the date-time when the reservation was purchased. * @@ -605,17 +406,6 @@ public OffsetDateTime purchaseDateTime() { return this.purchaseDateTime; } - /** - * Set the purchaseDateTime property: This is the date-time when the reservation was purchased. - * - * @param purchaseDateTime the purchaseDateTime value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withPurchaseDateTime(OffsetDateTime purchaseDateTime) { - this.purchaseDateTime = purchaseDateTime; - return this; - } - /** * Get the splitProperties property: Properties of reservation split. * @@ -625,17 +415,6 @@ public ReservationSplitProperties splitProperties() { return this.splitProperties; } - /** - * Set the splitProperties property: Properties of reservation split. - * - * @param splitProperties the splitProperties value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withSplitProperties(ReservationSplitProperties splitProperties) { - this.splitProperties = splitProperties; - return this; - } - /** * Get the mergeProperties property: Properties of reservation merge. * @@ -645,17 +424,6 @@ public ReservationMergeProperties mergeProperties() { return this.mergeProperties; } - /** - * Set the mergeProperties property: Properties of reservation merge. - * - * @param mergeProperties the mergeProperties value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withMergeProperties(ReservationMergeProperties mergeProperties) { - this.mergeProperties = mergeProperties; - return this; - } - /** * Get the swapProperties property: Properties of reservation swap. * @@ -665,17 +433,6 @@ public ReservationSwapProperties swapProperties() { return this.swapProperties; } - /** - * Set the swapProperties property: Properties of reservation swap. - * - * @param swapProperties the swapProperties value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withSwapProperties(ReservationSwapProperties swapProperties) { - this.swapProperties = swapProperties; - return this; - } - /** * Get the appliedScopeProperties property: Properties specific to applied scope type. Not required if not * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup. @@ -686,18 +443,6 @@ public AppliedScopeProperties appliedScopeProperties() { return this.appliedScopeProperties; } - /** - * Set the appliedScopeProperties property: Properties specific to applied scope type. Not required if not - * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup. - * - * @param appliedScopeProperties the appliedScopeProperties value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withAppliedScopeProperties(AppliedScopeProperties appliedScopeProperties) { - this.appliedScopeProperties = appliedScopeProperties; - return this; - } - /** * Get the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan. * @@ -707,17 +452,6 @@ public String billingScopeId() { return this.billingScopeId; } - /** - * Set the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan. - * - * @param billingScopeId the billingScopeId value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withBillingScopeId(String billingScopeId) { - this.billingScopeId = billingScopeId; - return this; - } - /** * Get the renew property: Setting this to true will automatically purchase a new reservation on the expiration date * time. @@ -728,18 +462,6 @@ public Boolean renew() { return this.renew; } - /** - * Set the renew property: Setting this to true will automatically purchase a new reservation on the expiration date - * time. - * - * @param renew the renew value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withRenew(Boolean renew) { - this.renew = renew; - return this; - } - /** * Get the renewSource property: Reservation Id of the reservation from which this reservation is renewed. Format of * the resource Id is @@ -751,19 +473,6 @@ public String renewSource() { return this.renewSource; } - /** - * Set the renewSource property: Reservation Id of the reservation from which this reservation is renewed. Format of - * the resource Id is - * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. - * - * @param renewSource the renewSource value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withRenewSource(String renewSource) { - this.renewSource = renewSource; - return this; - } - /** * Get the renewDestination property: Reservation Id of the reservation which is purchased because of renew. Format * of the resource Id is @@ -775,19 +484,6 @@ public String renewDestination() { return this.renewDestination; } - /** - * Set the renewDestination property: Reservation Id of the reservation which is purchased because of renew. Format - * of the resource Id is - * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. - * - * @param renewDestination the renewDestination value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withRenewDestination(String renewDestination) { - this.renewDestination = renewDestination; - return this; - } - /** * Get the renewProperties property: The renew properties for a reservation. * @@ -797,17 +493,6 @@ public RenewPropertiesResponse renewProperties() { return this.renewProperties; } - /** - * Set the renewProperties property: The renew properties for a reservation. - * - * @param renewProperties the renewProperties value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withRenewProperties(RenewPropertiesResponse renewProperties) { - this.renewProperties = renewProperties; - return this; - } - /** * Get the term property: Represent the term of reservation. * @@ -817,17 +502,6 @@ public ReservationTerm term() { return this.term; } - /** - * Set the term property: Represent the term of reservation. - * - * @param term the term value to set. - * @return the ReservationsProperties object itself. - */ - public ReservationsProperties withTerm(ReservationTerm term) { - this.term = term; - return this; - } - /** * Get the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. * Shared. @@ -856,35 +530,6 @@ public ReservationsPropertiesUtilization utilization() { return this.utilization; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (extendedStatusInfo() != null) { - extendedStatusInfo().validate(); - } - if (splitProperties() != null) { - splitProperties().validate(); - } - if (mergeProperties() != null) { - mergeProperties().validate(); - } - if (swapProperties() != null) { - swapProperties().validate(); - } - if (appliedScopeProperties() != null) { - appliedScopeProperties().validate(); - } - if (renewProperties() != null) { - renewProperties().validate(); - } - if (utilization() != null) { - utilization().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsPropertiesUtilization.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsPropertiesUtilization.java index 8d0c146b7f2c..574c3deae7da 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsPropertiesUtilization.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservationsPropertiesUtilization.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.reservations.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 @@ /** * Reservation utilization. */ -@Fluent +@Immutable public final class ReservationsPropertiesUtilization implements JsonSerializable { /* * last 7 day utilization trend for a reservation @@ -30,7 +30,7 @@ public final class ReservationsPropertiesUtilization implements JsonSerializable /** * Creates an instance of ReservationsPropertiesUtilization class. */ - public ReservationsPropertiesUtilization() { + private ReservationsPropertiesUtilization() { } /** @@ -51,28 +51,6 @@ public List aggregates() { return this.aggregates; } - /** - * Set the aggregates property: The array of aggregates of a reservation's utilization. - * - * @param aggregates the aggregates value to set. - * @return the ReservationsPropertiesUtilization object itself. - */ - public ReservationsPropertiesUtilization withAggregates(List aggregates) { - this.aggregates = aggregates; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (aggregates() != null) { - aggregates().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservedResourceType.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservedResourceType.java index 773487f79901..a883bdb9e335 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservedResourceType.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ReservedResourceType.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.reservations.models; @@ -8,136 +8,137 @@ import java.util.Collection; /** - * The type of the resource that is being reserved. + * The type of the resource that is being reserved. In addition to below types we have also added the following: + * OpenAIPTU, MDC, Sentinel. */ public final class ReservedResourceType extends ExpandableStringEnum { /** - * Static value VirtualMachines for ReservedResourceType. + * VirtualMachines. */ public static final ReservedResourceType VIRTUAL_MACHINES = fromString("VirtualMachines"); /** - * Static value SqlDatabases for ReservedResourceType. + * SqlDatabases. */ public static final ReservedResourceType SQL_DATABASES = fromString("SqlDatabases"); /** - * Static value SuseLinux for ReservedResourceType. + * SuseLinux. */ public static final ReservedResourceType SUSE_LINUX = fromString("SuseLinux"); /** - * Static value CosmosDb for ReservedResourceType. + * CosmosDb. */ public static final ReservedResourceType COSMOS_DB = fromString("CosmosDb"); /** - * Static value RedHat for ReservedResourceType. + * RedHat. */ public static final ReservedResourceType RED_HAT = fromString("RedHat"); /** - * Static value SqlDataWarehouse for ReservedResourceType. + * SqlDataWarehouse. */ public static final ReservedResourceType SQL_DATA_WAREHOUSE = fromString("SqlDataWarehouse"); /** - * Static value VMwareCloudSimple for ReservedResourceType. + * VMwareCloudSimple. */ public static final ReservedResourceType VMWARE_CLOUD_SIMPLE = fromString("VMwareCloudSimple"); /** - * Static value RedHatOsa for ReservedResourceType. + * RedHatOsa. */ public static final ReservedResourceType RED_HAT_OSA = fromString("RedHatOsa"); /** - * Static value Databricks for ReservedResourceType. + * Databricks. */ public static final ReservedResourceType DATABRICKS = fromString("Databricks"); /** - * Static value AppService for ReservedResourceType. + * AppService. */ public static final ReservedResourceType APP_SERVICE = fromString("AppService"); /** - * Static value ManagedDisk for ReservedResourceType. + * ManagedDisk. */ public static final ReservedResourceType MANAGED_DISK = fromString("ManagedDisk"); /** - * Static value BlockBlob for ReservedResourceType. + * BlockBlob. */ public static final ReservedResourceType BLOCK_BLOB = fromString("BlockBlob"); /** - * Static value RedisCache for ReservedResourceType. + * RedisCache. */ public static final ReservedResourceType REDIS_CACHE = fromString("RedisCache"); /** - * Static value AzureDataExplorer for ReservedResourceType. + * AzureDataExplorer. */ public static final ReservedResourceType AZURE_DATA_EXPLORER = fromString("AzureDataExplorer"); /** - * Static value MySql for ReservedResourceType. + * MySql. */ public static final ReservedResourceType MY_SQL = fromString("MySql"); /** - * Static value MariaDb for ReservedResourceType. + * MariaDb. */ public static final ReservedResourceType MARIA_DB = fromString("MariaDb"); /** - * Static value PostgreSql for ReservedResourceType. + * PostgreSql. */ public static final ReservedResourceType POSTGRE_SQL = fromString("PostgreSql"); /** - * Static value DedicatedHost for ReservedResourceType. + * DedicatedHost. */ public static final ReservedResourceType DEDICATED_HOST = fromString("DedicatedHost"); /** - * Static value SapHana for ReservedResourceType. + * SapHana. */ public static final ReservedResourceType SAP_HANA = fromString("SapHana"); /** - * Static value SqlAzureHybridBenefit for ReservedResourceType. + * SqlAzureHybridBenefit. */ public static final ReservedResourceType SQL_AZURE_HYBRID_BENEFIT = fromString("SqlAzureHybridBenefit"); /** - * Static value AVS for ReservedResourceType. + * AVS. */ public static final ReservedResourceType AVS = fromString("AVS"); /** - * Static value DataFactory for ReservedResourceType. + * DataFactory. */ public static final ReservedResourceType DATA_FACTORY = fromString("DataFactory"); /** - * Static value NetAppStorage for ReservedResourceType. + * NetAppStorage. */ public static final ReservedResourceType NET_APP_STORAGE = fromString("NetAppStorage"); /** - * Static value AzureFiles for ReservedResourceType. + * AzureFiles. */ public static final ReservedResourceType AZURE_FILES = fromString("AzureFiles"); /** - * Static value SqlEdge for ReservedResourceType. + * SqlEdge. */ public static final ReservedResourceType SQL_EDGE = fromString("SqlEdge"); /** - * Static value VirtualMachineSoftware for ReservedResourceType. + * VirtualMachineSoftware. */ public static final ReservedResourceType VIRTUAL_MACHINE_SOFTWARE = fromString("VirtualMachineSoftware"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceName.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceName.java index 065c8bfbad67..1562ad4508cb 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceName.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceName.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.reservations.models; @@ -61,14 +61,6 @@ public String localizedValue() { return this.localizedValue; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceProviders.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceProviders.java index d55d963a4b71..2606ce309fbb 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceProviders.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceProviders.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.models; @@ -15,7 +15,7 @@ public interface ResourceProviders { /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @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. @@ -27,9 +27,9 @@ public interface ResourceProviders { /** * Get the regions and skus that are available for RI purchase for the specified Azure subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param reservedResourceType The type of the resource for which the skus should be provided. - * @param location Filters the skus based on the location specified in this parameter. This can be an Azure region + * @param location Filters the skus based on the location specified in this parameter. This can be an azure region * or global. * @param publisherId Publisher id used to get the third party products. * @param offerId Offer id used to get the third party products. @@ -52,13 +52,15 @@ PagedIterable list(String subscriptionId, String reservedResourceType, * * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @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 applicable `Reservation`s that are applied to this subscription or a resource group under this - * subscription along with {@link Response}. + * @return list of applicable `Reservation`s. + * + * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription + * along with {@link Response}. */ Response getAppliedReservationListWithResponse(String subscriptionId, Context context); @@ -67,12 +69,13 @@ PagedIterable list(String subscriptionId, String reservedResourceType, * * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. * - * @param subscriptionId Id of the subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @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 applicable `Reservation`s that are applied to this subscription or a resource group under this - * subscription. + * @return list of applicable `Reservation`s. + * + * Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. */ AppliedReservations getAppliedReservationList(String subscriptionId); } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceType.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceType.java index e546931863c5..ce5c29724174 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceType.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/ResourceType.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.reservations.models; @@ -12,27 +12,27 @@ */ public final class ResourceType extends ExpandableStringEnum { /** - * Static value standard for ResourceType. + * standard. */ public static final ResourceType STANDARD = fromString("standard"); /** - * Static value dedicated for ResourceType. + * dedicated. */ public static final ResourceType DEDICATED = fromString("dedicated"); /** - * Static value lowPriority for ResourceType. + * lowPriority. */ public static final ResourceType LOW_PRIORITY = fromString("lowPriority"); /** - * Static value shared for ResourceType. + * shared. */ public static final ResourceType SHARED = fromString("shared"); /** - * Static value serviceSpecific for ResourceType. + * serviceSpecific. */ public static final ResourceType SERVICE_SPECIFIC = fromString("serviceSpecific"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Returns.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Returns.java index 6c173f99b49b..aa4b0c2e0213 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Returns.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/Returns.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.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanPurchaseRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanPurchaseRequest.java index 204dc9460bc7..f269a6662f79 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanPurchaseRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanPurchaseRequest.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.reservations.models; @@ -227,20 +227,6 @@ public SavingsPlanPurchaseRequest withCommitment(Commitment commitment) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanTerm.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanTerm.java index ed1a89e7fea9..a473a121dca8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanTerm.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanTerm.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.reservations.models; @@ -12,12 +12,12 @@ */ public final class SavingsPlanTerm extends ExpandableStringEnum { /** - * Static value P1Y for SavingsPlanTerm. + * P1Y. */ public static final SavingsPlanTerm P1Y = fromString("P1Y"); /** - * Static value P3Y for SavingsPlanTerm. + * P3Y. */ public static final SavingsPlanTerm P3Y = fromString("P3Y"); diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseCalculateExchange.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseCalculateExchange.java index ccc32676a20a..90f6c37a0d73 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseCalculateExchange.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseCalculateExchange.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.reservations.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 @@ /** * Savings plan purchase details. */ -@Fluent +@Immutable public final class SavingsPlanToPurchaseCalculateExchange implements JsonSerializable { /* @@ -30,7 +30,7 @@ public final class SavingsPlanToPurchaseCalculateExchange /** * Creates an instance of SavingsPlanToPurchaseCalculateExchange class. */ - public SavingsPlanToPurchaseCalculateExchange() { + private SavingsPlanToPurchaseCalculateExchange() { } /** @@ -42,17 +42,6 @@ public SavingsPlanPurchaseRequest properties() { return this.properties; } - /** - * Set the properties property: Request body for savings plan purchase. - * - * @param properties the properties value to set. - * @return the SavingsPlanToPurchaseCalculateExchange object itself. - */ - public SavingsPlanToPurchaseCalculateExchange withProperties(SavingsPlanPurchaseRequest properties) { - this.properties = properties; - return this; - } - /** * Get the billingCurrencyTotal property: Pricing information containing the amount and the currency code. * @@ -62,31 +51,6 @@ public Price billingCurrencyTotal() { return this.billingCurrencyTotal; } - /** - * Set the billingCurrencyTotal property: Pricing information containing the amount and the currency code. - * - * @param billingCurrencyTotal the billingCurrencyTotal value to set. - * @return the SavingsPlanToPurchaseCalculateExchange object itself. - */ - public SavingsPlanToPurchaseCalculateExchange withBillingCurrencyTotal(Price billingCurrencyTotal) { - this.billingCurrencyTotal = billingCurrencyTotal; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (billingCurrencyTotal() != null) { - billingCurrencyTotal().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseExchange.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseExchange.java index ad309121324f..3ae1a6f8eb7e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseExchange.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseExchange.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.reservations.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 @@ /** * Savings plan purchase details. */ -@Fluent +@Immutable public final class SavingsPlanToPurchaseExchange implements JsonSerializable { /* * Fully qualified id of the savings plan order being purchased @@ -45,7 +45,7 @@ public final class SavingsPlanToPurchaseExchange implements JsonSerializable { /* * The scope property. @@ -29,7 +29,7 @@ public final class ScopeProperties implements JsonSerializable /** * Creates an instance of ScopeProperties class. */ - public ScopeProperties() { + private ScopeProperties() { } /** @@ -41,17 +41,6 @@ public String scope() { return this.scope; } - /** - * Set the scope property: The scope property. - * - * @param scope the scope value to set. - * @return the ScopeProperties object itself. - */ - public ScopeProperties withScope(String scope) { - this.scope = scope; - return this; - } - /** * Get the valid property: The valid property. * @@ -61,25 +50,6 @@ public Boolean valid() { return this.valid; } - /** - * Set the valid property: The valid property. - * - * @param valid the valid value to set. - * @return the ScopeProperties object itself. - */ - public ScopeProperties withValid(Boolean valid) { - this.valid = valid; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuCapability.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuCapability.java index d9a487b3a524..5ad7d32d38b3 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuCapability.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuCapability.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.reservations.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 @@ /** * Capability of a sku. */ -@Fluent +@Immutable public final class SkuCapability implements JsonSerializable { /* * An invariant to describe the feature. @@ -29,7 +29,7 @@ public final class SkuCapability implements JsonSerializable { /** * Creates an instance of SkuCapability class. */ - public SkuCapability() { + private SkuCapability() { } /** @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: An invariant to describe the feature. - * - * @param name the name value to set. - * @return the SkuCapability object itself. - */ - public SkuCapability withName(String name) { - this.name = name; - return this; - } - /** * Get the value property: An invariant if the feature is measured by quantity. * @@ -61,25 +50,6 @@ public String value() { return this.value; } - /** - * Set the value property: An invariant if the feature is measured by quantity. - * - * @param value the value value to set. - * @return the SkuCapability object itself. - */ - public SkuCapability 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/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuName.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuName.java index d8d740b7fb27..f186e54f2544 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuName.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuName.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.reservations.models; @@ -47,14 +47,6 @@ public SkuName withName(String name) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuProperty.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuProperty.java index 35b21ba2f0d0..eb707c23aa92 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuProperty.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuProperty.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.reservations.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 @@ /** * Property of a sku. */ -@Fluent +@Immutable public final class SkuProperty implements JsonSerializable { /* * An invariant to describe the feature. @@ -29,7 +29,7 @@ public final class SkuProperty implements JsonSerializable { /** * Creates an instance of SkuProperty class. */ - public SkuProperty() { + private SkuProperty() { } /** @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: An invariant to describe the feature. - * - * @param name the name value to set. - * @return the SkuProperty object itself. - */ - public SkuProperty withName(String name) { - this.name = name; - return this; - } - /** * Get the value property: An invariant if the feature is measured by quantity. * @@ -61,25 +50,6 @@ public String value() { return this.value; } - /** - * Set the value property: An invariant if the feature is measured by quantity. - * - * @param value the value value to set. - * @return the SkuProperty object itself. - */ - public SkuProperty 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/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuRestriction.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuRestriction.java index 5df96bf1fac1..f28983106ef2 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuRestriction.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SkuRestriction.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.reservations.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 @@ /** * Restriction of a sku. */ -@Fluent +@Immutable public final class SkuRestriction implements JsonSerializable { /* * The type of restrictions. @@ -36,7 +36,7 @@ public final class SkuRestriction implements JsonSerializable { /** * Creates an instance of SkuRestriction class. */ - public SkuRestriction() { + private SkuRestriction() { } /** @@ -48,17 +48,6 @@ public String type() { return this.type; } - /** - * Set the type property: The type of restrictions. - * - * @param type the type value to set. - * @return the SkuRestriction object itself. - */ - public SkuRestriction withType(String type) { - this.type = type; - return this; - } - /** * Get the values property: The value of restrictions. If the restriction type is set to location. This would be * different locations where the sku is restricted. @@ -69,18 +58,6 @@ public List values() { return this.values; } - /** - * Set the values property: The value of restrictions. If the restriction type is set to location. This would be - * different locations where the sku is restricted. - * - * @param values the values value to set. - * @return the SkuRestriction object itself. - */ - public SkuRestriction withValues(List values) { - this.values = values; - return this; - } - /** * Get the reasonCode property: The reason for restriction. * @@ -90,25 +67,6 @@ public String reasonCode() { return this.reasonCode; } - /** - * Set the reasonCode property: The reason for restriction. - * - * @param reasonCode the reasonCode value to set. - * @return the SkuRestriction object itself. - */ - public SkuRestriction withReasonCode(String reasonCode) { - this.reasonCode = reasonCode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SplitRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SplitRequest.java index 6059219e0bfc..0696f60dc822 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SplitRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SplitRequest.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.reservations.models; @@ -86,17 +86,6 @@ public SplitRequest withReservationId(String reservationId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SubRequest.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SubRequest.java index fb44b7eb606d..221788af2a60 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SubRequest.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SubRequest.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.reservations.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 @@ /** * The sub-request submitted with the quota request. */ -@Fluent +@Immutable public final class SubRequest implements JsonSerializable { /* * Quota (resource limit). @@ -55,7 +55,7 @@ public final class SubRequest implements JsonSerializable { /** * Creates an instance of SubRequest class. */ - public SubRequest() { + private SubRequest() { } /** @@ -76,17 +76,6 @@ public ResourceName name() { return this.name; } - /** - * Set the name property: The resource name. - * - * @param name the name value to set. - * @return the SubRequest object itself. - */ - public SubRequest withName(ResourceName name) { - this.name = name; - return this; - } - /** * Get the resourceType property: Resource type for which the quota check was made. * @@ -106,18 +95,6 @@ public String unit() { return this.unit; } - /** - * Set the unit property: The limit units, such as **count** and **bytes**. Use the unit field provided in the - * response of the GET quota operation. - * - * @param unit the unit value to set. - * @return the SubRequest object itself. - */ - public SubRequest withUnit(String unit) { - this.unit = unit; - return this; - } - /** * Get the provisioningState property: The quota request status. * @@ -127,17 +104,6 @@ public QuotaRequestState provisioningState() { return this.provisioningState; } - /** - * Set the provisioningState property: The quota request status. - * - * @param provisioningState the provisioningState value to set. - * @return the SubRequest object itself. - */ - public SubRequest withProvisioningState(QuotaRequestState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - /** * Get the message property: User-friendly status message. * @@ -156,17 +122,6 @@ public String subRequestId() { return this.subRequestId; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() != null) { - name().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SubscriptionScopeProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SubscriptionScopeProperties.java index 40cc6d3a73b8..c909b746b44a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SubscriptionScopeProperties.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/SubscriptionScopeProperties.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.reservations.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 @@ /** * The scopes checked by the available scope api. */ -@Fluent +@Immutable public final class SubscriptionScopeProperties implements JsonSerializable { /* * The scopes property. @@ -25,7 +25,7 @@ public final class SubscriptionScopeProperties implements JsonSerializable scopes() { return this.scopes; } - /** - * Set the scopes property: The scopes property. - * - * @param scopes the scopes value to set. - * @return the SubscriptionScopeProperties object itself. - */ - public SubscriptionScopeProperties withScopes(List scopes) { - this.scopes = scopes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (scopes() != null) { - scopes().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/package-info.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/package-info.java index b47d8e6b887c..d8dbb979c3f8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/models/package-info.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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 AzureReservationApi. - * This API describe Azure Reservation. + * Package containing the data models for ReservationsManagementClient. + * Microsoft Azure Quota Resource Provider. */ package com.azure.resourcemanager.reservations.models; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/package-info.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/package-info.java index 512739472616..93e1f6d0d638 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/package-info.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/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 AzureReservationApi. - * This API describe Azure Reservation. + * Package containing the classes for ReservationsManagementClient. + * Microsoft Azure Quota Resource Provider. */ package com.azure.resourcemanager.reservations; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/module-info.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/module-info.java index 666d2fc73bbc..3272cc13b867 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/module-info.java +++ b/sdk/reservations/azure-resourcemanager-reservations/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.reservations { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.reservations.fluent.models to com.azure.core; opens com.azure.resourcemanager.reservations.models to com.azure.core; + opens com.azure.resourcemanager.reservations.implementation.models to com.azure.core; } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/META-INF/azure-resourcemanager-reservations_metadata.json b/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/META-INF/azure-resourcemanager-reservations_metadata.json new file mode 100644 index 000000000000..f95271ed473f --- /dev/null +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/META-INF/azure-resourcemanager-reservations_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Quota":"2020-10-25","Reservations":"2022-11-01"},"crossLanguageDefinitions":{"com.azure.resourcemanager.reservations.fluent.CalculateExchangesClient":"Reservations","com.azure.resourcemanager.reservations.fluent.CalculateExchangesClient.beginPost":"Reservations.CalculateExchangeOperationGroup.post","com.azure.resourcemanager.reservations.fluent.CalculateExchangesClient.post":"Reservations.CalculateExchangeOperationGroup.post","com.azure.resourcemanager.reservations.fluent.CalculateRefundsClient":"Reservations","com.azure.resourcemanager.reservations.fluent.CalculateRefundsClient.post":"Reservations.ReservationOrderResponses.post","com.azure.resourcemanager.reservations.fluent.CalculateRefundsClient.postWithResponse":"Reservations.ReservationOrderResponses.post","com.azure.resourcemanager.reservations.fluent.ExchangesClient":"Reservations","com.azure.resourcemanager.reservations.fluent.ExchangesClient.beginPost":"Reservations.ExchangeOperationGroup.post","com.azure.resourcemanager.reservations.fluent.ExchangesClient.post":"Reservations.ExchangeOperationGroup.post","com.azure.resourcemanager.reservations.fluent.OperationsClient":"Reservations.Operation","com.azure.resourcemanager.reservations.fluent.OperationsClient.list":"Reservations.Operation.list","com.azure.resourcemanager.reservations.fluent.QuotaRequestStatusClient":"Quota.QuotaRequestStatus","com.azure.resourcemanager.reservations.fluent.QuotaRequestStatusClient.get":"Quota.QuotaRequestStatus.get","com.azure.resourcemanager.reservations.fluent.QuotaRequestStatusClient.getWithResponse":"Quota.QuotaRequestStatus.get","com.azure.resourcemanager.reservations.fluent.QuotaRequestStatusClient.list":"Quota.QuotaRequestStatus.list","com.azure.resourcemanager.reservations.fluent.QuotasClient":"Quota","com.azure.resourcemanager.reservations.fluent.QuotasClient.beginCreateOrUpdate":"Quota.CurrentQuotaLimitBases.createOrUpdate","com.azure.resourcemanager.reservations.fluent.QuotasClient.beginUpdate":"Quota.CurrentQuotaLimitBases.update","com.azure.resourcemanager.reservations.fluent.QuotasClient.createOrUpdate":"Quota.CurrentQuotaLimitBases.createOrUpdate","com.azure.resourcemanager.reservations.fluent.QuotasClient.get":"Quota.CurrentQuotaLimitBases.get","com.azure.resourcemanager.reservations.fluent.QuotasClient.getWithResponse":"Quota.CurrentQuotaLimitBases.get","com.azure.resourcemanager.reservations.fluent.QuotasClient.list":"Quota.CurrentQuotaLimitBases.list","com.azure.resourcemanager.reservations.fluent.QuotasClient.update":"Quota.CurrentQuotaLimitBases.update","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient":"Reservations","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient.beginPurchase":"Reservations.ReservationOrderResponses.purchase","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient.calculate":"Reservations.ReservationOrderOperationGroup.calculate","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient.calculateWithResponse":"Reservations.ReservationOrderOperationGroup.calculate","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient.changeDirectory":"Reservations.ReservationOrderResponses.changeDirectory","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient.changeDirectoryWithResponse":"Reservations.ReservationOrderResponses.changeDirectory","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient.get":"Reservations.ReservationOrderResponses.get","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient.getWithResponse":"Reservations.ReservationOrderResponses.get","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient.list":"Reservations.ReservationOrderResponses.list","com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient.purchase":"Reservations.ReservationOrderResponses.purchase","com.azure.resourcemanager.reservations.fluent.ReservationsClient":"Reservations","com.azure.resourcemanager.reservations.fluent.ReservationsClient.archive":"Reservations.ReservationResponses.archive","com.azure.resourcemanager.reservations.fluent.ReservationsClient.archiveWithResponse":"Reservations.ReservationResponses.archive","com.azure.resourcemanager.reservations.fluent.ReservationsClient.availableScopes":"Reservations.ReservationResponses.availableScopes","com.azure.resourcemanager.reservations.fluent.ReservationsClient.beginAvailableScopes":"Reservations.ReservationResponses.availableScopes","com.azure.resourcemanager.reservations.fluent.ReservationsClient.beginMerge":"Reservations.ReservationOrderResponses.merge","com.azure.resourcemanager.reservations.fluent.ReservationsClient.beginSplit":"Reservations.ReservationOrderResponses.split","com.azure.resourcemanager.reservations.fluent.ReservationsClient.beginUpdate":"Reservations.ReservationResponses.update","com.azure.resourcemanager.reservations.fluent.ReservationsClient.get":"Reservations.ReservationResponses.get","com.azure.resourcemanager.reservations.fluent.ReservationsClient.getWithResponse":"Reservations.ReservationResponses.get","com.azure.resourcemanager.reservations.fluent.ReservationsClient.list":"Reservations.ReservationResponses.list","com.azure.resourcemanager.reservations.fluent.ReservationsClient.listAll":"Reservations.ReservationOperationGroup.listAll","com.azure.resourcemanager.reservations.fluent.ReservationsClient.listRevisions":"Reservations.ReservationResponses.listRevisions","com.azure.resourcemanager.reservations.fluent.ReservationsClient.merge":"Reservations.ReservationOrderResponses.merge","com.azure.resourcemanager.reservations.fluent.ReservationsClient.split":"Reservations.ReservationOrderResponses.split","com.azure.resourcemanager.reservations.fluent.ReservationsClient.unarchive":"Reservations.ReservationResponses.unarchive","com.azure.resourcemanager.reservations.fluent.ReservationsClient.unarchiveWithResponse":"Reservations.ReservationResponses.unarchive","com.azure.resourcemanager.reservations.fluent.ReservationsClient.update":"Reservations.ReservationResponses.update","com.azure.resourcemanager.reservations.fluent.ReservationsManagementClient":"ReservationsClient","com.azure.resourcemanager.reservations.fluent.ResourceProvidersClient":"ReservationsClient","com.azure.resourcemanager.reservations.fluent.ResourceProvidersClient.getAppliedReservationList":"Reservations.getAppliedReservationList","com.azure.resourcemanager.reservations.fluent.ResourceProvidersClient.getAppliedReservationListWithResponse":"Reservations.getAppliedReservationList","com.azure.resourcemanager.reservations.fluent.ResourceProvidersClient.list":"Reservations.getCatalog","com.azure.resourcemanager.reservations.fluent.ReturnsClient":"Reservations","com.azure.resourcemanager.reservations.fluent.ReturnsClient.beginPost":"Reservations.ReservationOrderResponses.returnPost","com.azure.resourcemanager.reservations.fluent.ReturnsClient.post":"Reservations.ReservationOrderResponses.returnPost","com.azure.resourcemanager.reservations.fluent.models.AppliedReservationsInner":"Reservations.AppliedReservations","com.azure.resourcemanager.reservations.fluent.models.AppliedReservationsProperties":"Reservations.AppliedReservationsProperties","com.azure.resourcemanager.reservations.fluent.models.AvailableScopePropertiesInner":"Reservations.AvailableScopeProperties","com.azure.resourcemanager.reservations.fluent.models.CalculateExchangeOperationResultResponseInner":"Reservations.CalculateExchangeOperationResultResponse","com.azure.resourcemanager.reservations.fluent.models.CalculatePriceResponseInner":"Reservations.CalculatePriceResponse","com.azure.resourcemanager.reservations.fluent.models.CalculateRefundResponseInner":"Reservations.CalculateRefundResponse","com.azure.resourcemanager.reservations.fluent.models.CatalogInner":"Reservations.Catalog","com.azure.resourcemanager.reservations.fluent.models.ChangeDirectoryResponseInner":"Reservations.ChangeDirectoryResponse","com.azure.resourcemanager.reservations.fluent.models.CurrentQuotaLimitBaseInner":"Quota.CurrentQuotaLimitBase","com.azure.resourcemanager.reservations.fluent.models.ExchangeOperationResultResponseInner":"Reservations.ExchangeOperationResultResponse","com.azure.resourcemanager.reservations.fluent.models.MergeProperties":"Reservations.MergeProperties","com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner":"Reservations.OperationResponse","com.azure.resourcemanager.reservations.fluent.models.PatchProperties":"Reservations.PatchProperties","com.azure.resourcemanager.reservations.fluent.models.PurchaseRequestProperties":"Reservations.PurchaseRequestProperties","com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner":"Quota.QuotaRequestDetails","com.azure.resourcemanager.reservations.fluent.models.QuotaRequestProperties":"Quota.QuotaRequestProperties","com.azure.resourcemanager.reservations.fluent.models.ReservationOrderProperties":"Reservations.ReservationOrderProperties","com.azure.resourcemanager.reservations.fluent.models.ReservationOrderResponseInner":"Reservations.ReservationOrderResponse","com.azure.resourcemanager.reservations.fluent.models.ReservationResponseInner":"Reservations.ReservationResponse","com.azure.resourcemanager.reservations.fluent.models.SavingsPlanPurchaseRequestProperties":"Reservations.SavingsPlanPurchaseRequestProperties","com.azure.resourcemanager.reservations.fluent.models.SplitProperties":"Reservations.SplitProperties","com.azure.resourcemanager.reservations.implementation.ReservationsManagementClientBuilder":"ReservationsClient","com.azure.resourcemanager.reservations.implementation.models.CatalogsResult":"Reservations.CatalogsResult","com.azure.resourcemanager.reservations.implementation.models.OperationList":"Reservations.OperationList","com.azure.resourcemanager.reservations.implementation.models.QuotaLimits":"Quota.QuotaLimits","com.azure.resourcemanager.reservations.implementation.models.QuotaRequestDetailsList":"Quota.QuotaRequestDetailsList","com.azure.resourcemanager.reservations.implementation.models.ReservationList":"Reservations.ReservationList","com.azure.resourcemanager.reservations.implementation.models.ReservationOrderList":"Reservations.ReservationOrderList","com.azure.resourcemanager.reservations.implementation.models.ReservationsListResult":"Reservations.ReservationsListResult","com.azure.resourcemanager.reservations.models.AppliedReservationList":"Reservations.AppliedReservationList","com.azure.resourcemanager.reservations.models.AppliedScopeProperties":"Reservations.AppliedScopeProperties","com.azure.resourcemanager.reservations.models.AppliedScopeType":"Reservations.AppliedScopeType","com.azure.resourcemanager.reservations.models.AvailableScopeRequest":"Reservations.AvailableScopeRequest","com.azure.resourcemanager.reservations.models.AvailableScopeRequestProperties":"Reservations.AvailableScopeRequestProperties","com.azure.resourcemanager.reservations.models.BillingInformation":"Reservations.BillingInformation","com.azure.resourcemanager.reservations.models.BillingPlan":"Reservations.BillingPlan","com.azure.resourcemanager.reservations.models.CalculateExchangeOperationResultStatus":"Reservations.CalculateExchangeOperationResultStatus","com.azure.resourcemanager.reservations.models.CalculateExchangeRequest":"Reservations.CalculateExchangeRequest","com.azure.resourcemanager.reservations.models.CalculateExchangeRequestProperties":"Reservations.CalculateExchangeRequestProperties","com.azure.resourcemanager.reservations.models.CalculateExchangeResponseProperties":"Reservations.CalculateExchangeResponseProperties","com.azure.resourcemanager.reservations.models.CalculatePriceResponseProperties":"Reservations.CalculatePriceResponseProperties","com.azure.resourcemanager.reservations.models.CalculatePriceResponsePropertiesBillingCurrencyTotal":"Reservations.CalculatePriceResponsePropertiesBillingCurrencyTotal","com.azure.resourcemanager.reservations.models.CalculatePriceResponsePropertiesPricingCurrencyTotal":"Reservations.CalculatePriceResponsePropertiesPricingCurrencyTotal","com.azure.resourcemanager.reservations.models.CalculateRefundRequest":"Reservations.CalculateRefundRequest","com.azure.resourcemanager.reservations.models.CalculateRefundRequestProperties":"Reservations.CalculateRefundRequestProperties","com.azure.resourcemanager.reservations.models.CatalogMsrp":"Reservations.CatalogMsrp","com.azure.resourcemanager.reservations.models.ChangeDirectoryRequest":"Reservations.ChangeDirectoryRequest","com.azure.resourcemanager.reservations.models.ChangeDirectoryResult":"Reservations.ChangeDirectoryResult","com.azure.resourcemanager.reservations.models.Commitment":"Reservations.Commitment","com.azure.resourcemanager.reservations.models.CommitmentGrain":"Reservations.CommitmentGrain","com.azure.resourcemanager.reservations.models.ErrorResponseCode":"Reservations.ErrorResponseCode","com.azure.resourcemanager.reservations.models.ExchangeOperationResultStatus":"Reservations.ExchangeOperationResultStatus","com.azure.resourcemanager.reservations.models.ExchangePolicyError":"Reservations.ExchangePolicyError","com.azure.resourcemanager.reservations.models.ExchangePolicyErrors":"Reservations.ExchangePolicyErrors","com.azure.resourcemanager.reservations.models.ExchangeRequest":"Reservations.ExchangeRequest","com.azure.resourcemanager.reservations.models.ExchangeRequestProperties":"Reservations.ExchangeRequestProperties","com.azure.resourcemanager.reservations.models.ExchangeResponseProperties":"Reservations.ExchangeResponseProperties","com.azure.resourcemanager.reservations.models.ExtendedStatusInfo":"Reservations.ExtendedStatusInfo","com.azure.resourcemanager.reservations.models.InstanceFlexibility":"Reservations.InstanceFlexibility","com.azure.resourcemanager.reservations.models.MergeRequest":"Reservations.MergeRequest","com.azure.resourcemanager.reservations.models.OperationDisplay":"Reservations.OperationDisplay","com.azure.resourcemanager.reservations.models.OperationResultError":"Reservations.OperationResultError","com.azure.resourcemanager.reservations.models.OperationStatus":"Reservations.OperationStatus","com.azure.resourcemanager.reservations.models.PatchModel":"Reservations.Patch","com.azure.resourcemanager.reservations.models.PatchPropertiesRenewProperties":"Reservations.PatchPropertiesRenewProperties","com.azure.resourcemanager.reservations.models.PaymentDetail":"Reservations.PaymentDetail","com.azure.resourcemanager.reservations.models.PaymentStatus":"Reservations.PaymentStatus","com.azure.resourcemanager.reservations.models.Price":"Reservations.Price","com.azure.resourcemanager.reservations.models.ProvisioningState":"Reservations.ProvisioningState","com.azure.resourcemanager.reservations.models.PurchaseRequest":"Reservations.PurchaseRequest","com.azure.resourcemanager.reservations.models.PurchaseRequestPropertiesReservedResourceProperties":"Reservations.PurchaseRequestPropertiesReservedResourceProperties","com.azure.resourcemanager.reservations.models.QuotaProperties":"Quota.QuotaProperties","com.azure.resourcemanager.reservations.models.QuotaRequestState":"Quota.QuotaRequestState","com.azure.resourcemanager.reservations.models.QuotasGetHeaders":null,"com.azure.resourcemanager.reservations.models.RefundBillingInformation":"Reservations.RefundBillingInformation","com.azure.resourcemanager.reservations.models.RefundPolicyError":"Reservations.RefundPolicyError","com.azure.resourcemanager.reservations.models.RefundPolicyResult":"Reservations.RefundPolicyResult","com.azure.resourcemanager.reservations.models.RefundPolicyResultProperty":"Reservations.RefundPolicyResultProperty","com.azure.resourcemanager.reservations.models.RefundRequest":"Reservations.RefundRequest","com.azure.resourcemanager.reservations.models.RefundRequestProperties":"Reservations.RefundRequestProperties","com.azure.resourcemanager.reservations.models.RefundResponseProperties":"Reservations.RefundResponseProperties","com.azure.resourcemanager.reservations.models.RenewPropertiesResponse":"Reservations.RenewPropertiesResponse","com.azure.resourcemanager.reservations.models.RenewPropertiesResponseBillingCurrencyTotal":"Reservations.RenewPropertiesResponseBillingCurrencyTotal","com.azure.resourcemanager.reservations.models.RenewPropertiesResponsePricingCurrencyTotal":"Reservations.RenewPropertiesResponsePricingCurrencyTotal","com.azure.resourcemanager.reservations.models.ReservationBillingPlan":"Reservations.ReservationBillingPlan","com.azure.resourcemanager.reservations.models.ReservationMergeProperties":"Reservations.ReservationMergeProperties","com.azure.resourcemanager.reservations.models.ReservationOrderBillingPlanInformation":"Reservations.ReservationOrderBillingPlanInformation","com.azure.resourcemanager.reservations.models.ReservationResponseKind":null,"com.azure.resourcemanager.reservations.models.ReservationSplitProperties":"Reservations.ReservationSplitProperties","com.azure.resourcemanager.reservations.models.ReservationStatusCode":"Reservations.ReservationStatusCode","com.azure.resourcemanager.reservations.models.ReservationSummary":"Reservations.ReservationSummary","com.azure.resourcemanager.reservations.models.ReservationSwapProperties":"Reservations.ReservationSwapProperties","com.azure.resourcemanager.reservations.models.ReservationTerm":"Reservations.ReservationTerm","com.azure.resourcemanager.reservations.models.ReservationToExchange":"Reservations.ReservationToExchange","com.azure.resourcemanager.reservations.models.ReservationToPurchaseCalculateExchange":"Reservations.ReservationToPurchaseCalculateExchange","com.azure.resourcemanager.reservations.models.ReservationToPurchaseExchange":"Reservations.ReservationToPurchaseExchange","com.azure.resourcemanager.reservations.models.ReservationToReturn":"Reservations.ReservationToReturn","com.azure.resourcemanager.reservations.models.ReservationToReturnForExchange":"Reservations.ReservationToReturnForExchange","com.azure.resourcemanager.reservations.models.ReservationUtilizationAggregates":"Reservations.ReservationUtilizationAggregates","com.azure.resourcemanager.reservations.models.ReservationsProperties":"Reservations.ReservationsProperties","com.azure.resourcemanager.reservations.models.ReservationsPropertiesUtilization":"Reservations.ReservationsPropertiesUtilization","com.azure.resourcemanager.reservations.models.ReservedResourceType":"Reservations.ReservedResourceType","com.azure.resourcemanager.reservations.models.ResourceName":"Quota.ResourceName","com.azure.resourcemanager.reservations.models.ResourceType":"Quota.ResourceType","com.azure.resourcemanager.reservations.models.SavingsPlanPurchaseRequest":"Reservations.SavingsPlanPurchaseRequest","com.azure.resourcemanager.reservations.models.SavingsPlanTerm":"Reservations.SavingsPlanTerm","com.azure.resourcemanager.reservations.models.SavingsPlanToPurchaseCalculateExchange":"Reservations.SavingsPlanToPurchaseCalculateExchange","com.azure.resourcemanager.reservations.models.SavingsPlanToPurchaseExchange":"Reservations.SavingsPlanToPurchaseExchange","com.azure.resourcemanager.reservations.models.ScopeProperties":"Reservations.ScopeProperties","com.azure.resourcemanager.reservations.models.SkuCapability":"Reservations.SkuCapability","com.azure.resourcemanager.reservations.models.SkuName":"Reservations.SkuName","com.azure.resourcemanager.reservations.models.SkuProperty":"Reservations.SkuProperty","com.azure.resourcemanager.reservations.models.SkuRestriction":"Reservations.SkuRestriction","com.azure.resourcemanager.reservations.models.SplitRequest":"Reservations.SplitRequest","com.azure.resourcemanager.reservations.models.SubRequest":"Quota.SubRequest","com.azure.resourcemanager.reservations.models.SubscriptionScopeProperties":"Reservations.SubscriptionScopeProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/reservations/ReservationsManager.java","src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateExchangesClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateRefundsClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/ExchangesClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/QuotaRequestStatusClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/QuotasClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationOrdersClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsManagementClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/ResourceProvidersClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/ReturnsClient.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsProperties.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/AvailableScopePropertiesInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculateExchangeOperationResultResponseInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculatePriceResponseInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculateRefundResponseInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/CatalogInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/ChangeDirectoryResponseInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/CurrentQuotaLimitBaseInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/ExchangeOperationResultResponseInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/MergeProperties.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/OperationResponseInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/PatchProperties.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/PurchaseRequestProperties.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestDetailsInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestProperties.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderProperties.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderResponseInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationResponseInner.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/SavingsPlanPurchaseRequestProperties.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/SplitProperties.java","src/main/java/com/azure/resourcemanager/reservations/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/reservations/fluent/package-info.java","src/main/java/com/azure/resourcemanager/reservations/implementation/AppliedReservationsImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/AvailableScopePropertiesImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangeOperationResultResponseImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/CalculatePriceResponseImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundResponseImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/CatalogImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ChangeDirectoryResponseImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/CurrentQuotaLimitBaseImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangeOperationResultResponseImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/OperationResponseImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestDetailsImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/QuotasImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrderResponseImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationOrdersImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationResponseImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReservationsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ResourceProvidersImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsClientImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/ReturnsImpl.java","src/main/java/com/azure/resourcemanager/reservations/implementation/models/CatalogsResult.java","src/main/java/com/azure/resourcemanager/reservations/implementation/models/OperationList.java","src/main/java/com/azure/resourcemanager/reservations/implementation/models/QuotaLimits.java","src/main/java/com/azure/resourcemanager/reservations/implementation/models/QuotaRequestDetailsList.java","src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationList.java","src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationOrderList.java","src/main/java/com/azure/resourcemanager/reservations/implementation/models/ReservationsListResult.java","src/main/java/com/azure/resourcemanager/reservations/implementation/package-info.java","src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservationList.java","src/main/java/com/azure/resourcemanager/reservations/models/AppliedReservations.java","src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/AppliedScopeType.java","src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/AvailableScopeRequestProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/BillingInformation.java","src/main/java/com/azure/resourcemanager/reservations/models/BillingPlan.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeOperationResultStatus.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeRequestProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchangeResponseProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateExchanges.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponseProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesBillingCurrencyTotal.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculatePriceResponsePropertiesPricingCurrencyTotal.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundRequestProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefundResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/CalculateRefunds.java","src/main/java/com/azure/resourcemanager/reservations/models/Catalog.java","src/main/java/com/azure/resourcemanager/reservations/models/CatalogMsrp.java","src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/ChangeDirectoryResult.java","src/main/java/com/azure/resourcemanager/reservations/models/Commitment.java","src/main/java/com/azure/resourcemanager/reservations/models/CommitmentGrain.java","src/main/java/com/azure/resourcemanager/reservations/models/CurrentQuotaLimitBase.java","src/main/java/com/azure/resourcemanager/reservations/models/ErrorResponseCode.java","src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/ExchangeOperationResultStatus.java","src/main/java/com/azure/resourcemanager/reservations/models/ExchangePolicyError.java","src/main/java/com/azure/resourcemanager/reservations/models/ExchangePolicyErrors.java","src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/ExchangeRequestProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/ExchangeResponseProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/Exchanges.java","src/main/java/com/azure/resourcemanager/reservations/models/ExtendedStatusInfo.java","src/main/java/com/azure/resourcemanager/reservations/models/InstanceFlexibility.java","src/main/java/com/azure/resourcemanager/reservations/models/MergeRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/reservations/models/OperationResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/OperationResultError.java","src/main/java/com/azure/resourcemanager/reservations/models/OperationStatus.java","src/main/java/com/azure/resourcemanager/reservations/models/Operations.java","src/main/java/com/azure/resourcemanager/reservations/models/PatchModel.java","src/main/java/com/azure/resourcemanager/reservations/models/PatchPropertiesRenewProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/PaymentDetail.java","src/main/java/com/azure/resourcemanager/reservations/models/PaymentStatus.java","src/main/java/com/azure/resourcemanager/reservations/models/Price.java","src/main/java/com/azure/resourcemanager/reservations/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/PurchaseRequestPropertiesReservedResourceProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/QuotaProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestDetails.java","src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestState.java","src/main/java/com/azure/resourcemanager/reservations/models/QuotaRequestStatus.java","src/main/java/com/azure/resourcemanager/reservations/models/Quotas.java","src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetHeaders.java","src/main/java/com/azure/resourcemanager/reservations/models/QuotasGetResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/RefundBillingInformation.java","src/main/java/com/azure/resourcemanager/reservations/models/RefundPolicyError.java","src/main/java/com/azure/resourcemanager/reservations/models/RefundPolicyResult.java","src/main/java/com/azure/resourcemanager/reservations/models/RefundPolicyResultProperty.java","src/main/java/com/azure/resourcemanager/reservations/models/RefundRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/RefundRequestProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/RefundResponseProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/RenewPropertiesResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/RenewPropertiesResponseBillingCurrencyTotal.java","src/main/java/com/azure/resourcemanager/reservations/models/RenewPropertiesResponsePricingCurrencyTotal.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationBillingPlan.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationMergeProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderBillingPlanInformation.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrderResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationOrders.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationResponse.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationResponseKind.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationSplitProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationStatusCode.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationSummary.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationSwapProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationTerm.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationToExchange.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationToPurchaseCalculateExchange.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationToPurchaseExchange.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationToReturn.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationToReturnForExchange.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationUtilizationAggregates.java","src/main/java/com/azure/resourcemanager/reservations/models/Reservations.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationsProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservationsPropertiesUtilization.java","src/main/java/com/azure/resourcemanager/reservations/models/ReservedResourceType.java","src/main/java/com/azure/resourcemanager/reservations/models/ResourceName.java","src/main/java/com/azure/resourcemanager/reservations/models/ResourceProviders.java","src/main/java/com/azure/resourcemanager/reservations/models/ResourceType.java","src/main/java/com/azure/resourcemanager/reservations/models/Returns.java","src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanPurchaseRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanTerm.java","src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseCalculateExchange.java","src/main/java/com/azure/resourcemanager/reservations/models/SavingsPlanToPurchaseExchange.java","src/main/java/com/azure/resourcemanager/reservations/models/ScopeProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/SkuCapability.java","src/main/java/com/azure/resourcemanager/reservations/models/SkuName.java","src/main/java/com/azure/resourcemanager/reservations/models/SkuProperty.java","src/main/java/com/azure/resourcemanager/reservations/models/SkuRestriction.java","src/main/java/com/azure/resourcemanager/reservations/models/SplitRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/SubRequest.java","src/main/java/com/azure/resourcemanager/reservations/models/SubscriptionScopeProperties.java","src/main/java/com/azure/resourcemanager/reservations/models/package-info.java","src/main/java/com/azure/resourcemanager/reservations/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-reservations/reflect-config.json b/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-reservations/reflect-config.json index 0637a088a01e..5f60e3098ada 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-reservations/reflect-config.json +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-reservations/reflect-config.json @@ -1 +1 @@ -[] \ No newline at end of file +[{"name":"com.azure.resourcemanager.reservations.models.ErrorResponseCode","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/azure-resourcemanager-reservations.properties b/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/azure-resourcemanager-reservations.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/resources/azure-resourcemanager-reservations.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/CalculateExchangePostSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/CalculateExchangePostSamples.java index 33b697bd9487..15b138e929b2 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/CalculateExchangePostSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/CalculateExchangePostSamples.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.reservations.generated; @@ -27,8 +27,7 @@ */ public final class CalculateExchangePostSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateExchange.json + * x-ms-original-file: 2022-11-01/CalculateExchange.json */ /** * Sample code: CalculateExchange. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/CalculateRefundPostSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/CalculateRefundPostSamples.java index 06573b69b68a..5fc5d2817908 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/CalculateRefundPostSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/CalculateRefundPostSamples.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.reservations.generated; @@ -13,8 +13,7 @@ */ public final class CalculateRefundPostSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/CalculateRefund.json + * x-ms-original-file: 2022-11-01/CalculateRefund.json */ /** * Sample code: CalculateRefund. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ExchangePostSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ExchangePostSamples.java index 3ea0c25ba777..d7f0b871491a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ExchangePostSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ExchangePostSamples.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.reservations.generated; @@ -12,8 +12,7 @@ */ public final class ExchangePostSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Exchange.json + * x-ms-original-file: 2022-11-01/Exchange.json */ /** * Sample code: Exchange. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/OperationListSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/OperationListSamples.java index e2ae132bc95c..aa4bc3e2a37d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/OperationListSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/OperationListSamples.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.reservations.generated; @@ -9,8 +9,7 @@ */ public final class OperationListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetOperations.json + * x-ms-original-file: 2022-11-01/GetOperations.json */ /** * Sample code: GetOperations. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaCreateOrUpdateSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaCreateOrUpdateSamples.java index bfd9c4677014..15902d09156a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaCreateOrUpdateSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaCreateOrUpdateSamples.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.reservations.generated; @@ -13,8 +13,7 @@ */ public final class QuotaCreateOrUpdateSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * putMachineLearningServicesQuotaRequestDedicated.json + * x-ms-original-file: 2020-10-25/putMachineLearningServicesQuotaRequestDedicated.json */ /** * Sample code: Quotas_Request_PutForMachineLearningServices_DedicatedResource. @@ -34,8 +33,7 @@ public static void quotasRequestPutForMachineLearningServicesDedicatedResource( } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * putMachineLearningServicesQuotaRequestLowPriority.json + * x-ms-original-file: 2020-10-25/putMachineLearningServicesQuotaRequestLowPriority.json */ /** * Sample code: Quotas_Request_PutForMachineLearningServices_LowPriorityResource. @@ -55,8 +53,7 @@ public static void quotasRequestPutForMachineLearningServicesLowPriorityResource } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * putComputeOneSkuQuotaRequest.json + * x-ms-original-file: 2020-10-25/putComputeOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Request_PutForCompute. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaGetSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaGetSamples.java index 56d58bb73b9a..4ba730e34a87 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaGetSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaGetSamples.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.reservations.generated; @@ -9,9 +9,7 @@ */ public final class QuotaGetSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getComputeOneSkuUsages. - * json + * x-ms-original-file: 2020-10-25/getComputeOneSkuUsages.json */ /** * Sample code: Quotas_Request_ForCompute. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaListSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaListSamples.java index 733b8c4abf4f..c61f7e8b6be6 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaListSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaListSamples.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.reservations.generated; @@ -9,8 +9,7 @@ */ public final class QuotaListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getComputeUsages.json + * x-ms-original-file: 2020-10-25/getComputeUsages.json */ /** * Sample code: Quotas_listUsagesForCompute. @@ -24,8 +23,7 @@ public static void quotasListUsagesForCompute(com.azure.resourcemanager.reservat } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * getMachineLearningServicesUsages.json + * x-ms-original-file: 2020-10-25/getMachineLearningServicesUsages.json */ /** * Sample code: Quotas_listUsagesMachineLearningServices. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetSamples.java index 6dda788696b9..e676e417e7a7 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetSamples.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.reservations.generated; @@ -9,8 +9,7 @@ */ public final class QuotaRequestStatusGetSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * getQuotaRequestStatusFailed.json + * x-ms-original-file: 2020-10-25/getQuotaRequestStatusFailed.json */ /** * Sample code: QuotaRequestFailed. @@ -24,8 +23,7 @@ public static void quotaRequestFailed(com.azure.resourcemanager.reservations.Res } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * getQuotaRequestStatusById.json + * x-ms-original-file: 2020-10-25/getQuotaRequestStatusById.json */ /** * Sample code: QuotaRequestStatus. @@ -39,8 +37,7 @@ public static void quotaRequestStatus(com.azure.resourcemanager.reservations.Res } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * getQuotaRequestStatusInProgress.json + * x-ms-original-file: 2020-10-25/getQuotaRequestStatusInProgress.json */ /** * Sample code: QuotaRequestInProgress. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListSamples.java index 3f971f08f16d..46ac5d8bc298 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListSamples.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.reservations.generated; @@ -9,9 +9,7 @@ */ public final class QuotaRequestStatusListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/getQuotaRequestsHistory - * .json + * x-ms-original-file: 2020-10-25/getQuotaRequestsHistory.json */ /** * Sample code: QuotaRequestHistory. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaUpdateSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaUpdateSamples.java index ba9c61493166..050ee5ef5767 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaUpdateSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/QuotaUpdateSamples.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.reservations.generated; @@ -13,8 +13,7 @@ */ public final class QuotaUpdateSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2020-10-25/examples/ - * patchComputeQuotaRequest.json + * x-ms-original-file: 2020-10-25/patchComputeQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForCompute. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationArchiveSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationArchiveSamples.java index 7d4eeb36c50b..069e0cfd39f6 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationArchiveSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationArchiveSamples.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.reservations.generated; @@ -9,8 +9,7 @@ */ public final class ReservationArchiveSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Archive.json + * x-ms-original-file: 2022-11-01/Archive.json */ /** * Sample code: Archive. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationAvailableScopesSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationAvailableScopesSamples.java index f22a79072450..9143d710c968 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationAvailableScopesSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationAvailableScopesSamples.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.reservations.generated; @@ -13,8 +13,7 @@ */ public final class ReservationAvailableScopesSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetAvailableScope.json + * x-ms-original-file: 2022-11-01/GetAvailableScope.json */ /** * Sample code: AvailableScopes. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationGetSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationGetSamples.java index 1cff423f5416..15a3f71b794c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationGetSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationGetSamples.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.reservations.generated; @@ -9,9 +9,7 @@ */ public final class ReservationGetSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationDetails. - * json + * x-ms-original-file: 2022-11-01/GetReservationDetails.json */ /** * Sample code: GetReservation. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListAllSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListAllSamples.java index 858701e33e0c..94bf80706ee5 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListAllSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListAllSamples.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.reservations.generated; @@ -9,8 +9,7 @@ */ public final class ReservationListAllSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservations.json + * x-ms-original-file: 2022-11-01/GetReservations.json */ /** * Sample code: ReservationListAll. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListRevisionsSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListRevisionsSamples.java index 1a1d38fec4c2..03369e9194c0 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListRevisionsSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListRevisionsSamples.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.reservations.generated; @@ -9,9 +9,7 @@ */ public final class ReservationListRevisionsSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationRevisions - * .json + * x-ms-original-file: 2022-11-01/GetReservationRevisions.json */ /** * Sample code: ReservationRevisions. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListSamples.java index 15130bad2c58..dc696a11de84 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationListSamples.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.reservations.generated; @@ -9,8 +9,7 @@ */ public final class ReservationListSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * GetReservationsFromOrder.json + * x-ms-original-file: 2022-11-01/GetReservationsFromOrder.json */ /** * Sample code: ReservationList. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationMergeSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationMergeSamples.java index 5e75adaf33dc..9a5deaad2e1e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationMergeSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationMergeSamples.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.reservations.generated; @@ -12,8 +12,7 @@ */ public final class ReservationMergeSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/MergeReservations.json + * x-ms-original-file: 2022-11-01/MergeReservations.json */ /** * Sample code: Merge. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderCalculateSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderCalculateSamples.java index 1acf1dd31de9..e94222aca0c3 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderCalculateSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderCalculateSamples.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.reservations.generated; @@ -18,8 +18,7 @@ */ public final class ReservationOrderCalculateSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * CalculateReservationOrder.json + * x-ms-original-file: 2022-11-01/CalculateReservationOrder.json */ /** * Sample code: CalculatePrice. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderChangeDirectorySamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderChangeDirectorySamples.java index 5b81c68bb299..468122160aff 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderChangeDirectorySamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderChangeDirectorySamples.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.reservations.generated; @@ -11,8 +11,7 @@ */ public final class ReservationOrderChangeDirectorySamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * ChangeDirectoryReservationOrder.json + * x-ms-original-file: 2022-11-01/ChangeDirectoryReservationOrder.json */ /** * Sample code: ChangeDirectory. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderGetSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderGetSamples.java index 2343656bddce..1b959d83be4d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderGetSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderGetSamples.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.reservations.generated; @@ -9,8 +9,7 @@ */ public final class ReservationOrderGetSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * GetReservationOrderDetailsWithExpandPlanInformation.json + * x-ms-original-file: 2022-11-01/GetReservationOrderDetailsWithExpandPlanInformation.json */ /** * Sample code: GetReservationWithExpandPayments. @@ -24,8 +23,7 @@ public final class ReservationOrderGetSamples { } /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * GetReservationOrderDetails.json + * x-ms-original-file: 2022-11-01/GetReservationOrderDetails.json */ /** * Sample code: GetReservationOrder. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderListSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderListSamples.java index a858b84754ff..02190c367712 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderListSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderListSamples.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.reservations.generated; @@ -9,9 +9,7 @@ */ public final class ReservationOrderListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetReservationOrders. - * json + * x-ms-original-file: 2022-11-01/GetReservationOrders.json */ /** * Sample code: ReservationOrderList. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderPurchaseSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderPurchaseSamples.java index 598f0dfa3d6a..0be1a393cd9b 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderPurchaseSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationOrderPurchaseSamples.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.reservations.generated; @@ -18,8 +18,7 @@ */ public final class ReservationOrderPurchaseSamples { /* - * x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ - * PurchaseReservationOrder.json + * x-ms-original-file: 2022-11-01/PurchaseReservationOrder.json */ /** * Sample code: Purchase. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationSplitSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationSplitSamples.java index 5f834ccaee5b..0df07c0ad646 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationSplitSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationSplitSamples.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.reservations.generated; @@ -12,8 +12,7 @@ */ public final class ReservationSplitSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/SplitReservation.json + * x-ms-original-file: 2022-11-01/SplitReservation.json */ /** * Sample code: Split. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationUnarchiveSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationUnarchiveSamples.java index 7815dc10e3c0..0b35580f6c49 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationUnarchiveSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationUnarchiveSamples.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.reservations.generated; @@ -9,8 +9,7 @@ */ public final class ReservationUnarchiveSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Unarchive.json + * x-ms-original-file: 2022-11-01/Unarchive.json */ /** * Sample code: Unarchive. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationUpdateSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationUpdateSamples.java index 2483f84a8e28..722218e2accc 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationUpdateSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReservationUpdateSamples.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.reservations.generated; @@ -13,8 +13,7 @@ */ public final class ReservationUpdateSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/UpdateReservation.json + * x-ms-original-file: 2022-11-01/UpdateReservation.json */ /** * Sample code: PatchReservation. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ResourceProviderGetAppliedReservationListSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ResourceProviderGetAppliedReservationListSamples.java index 56a38ad5739b..f2bf0ecd18d4 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ResourceProviderGetAppliedReservationListSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ResourceProviderGetAppliedReservationListSamples.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.reservations.generated; @@ -9,9 +9,7 @@ */ public final class ResourceProviderGetAppliedReservationListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetAppliedReservations. - * json + * x-ms-original-file: 2022-11-01/GetAppliedReservations.json */ /** * Sample code: AppliedReservationList. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ResourceProviderListSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ResourceProviderListSamples.java index 57732ffd09aa..203ba80219e9 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ResourceProviderListSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ResourceProviderListSamples.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.reservations.generated; @@ -9,8 +9,7 @@ */ public final class ResourceProviderListSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/GetCatalog.json + * x-ms-original-file: 2022-11-01/GetCatalog.json */ /** * Sample code: Catalog. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReturnPostSamples.java b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReturnPostSamples.java index ee17850a9090..b76f25f472ef 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReturnPostSamples.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/samples/java/com/azure/resourcemanager/reservations/generated/ReturnPostSamples.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.reservations.generated; @@ -13,8 +13,7 @@ */ public final class ReturnPostSamples { /* - * x-ms-original-file: - * specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/Return.json + * x-ms-original-file: 2022-11-01/Return.json */ /** * Sample code: Return a reservation. diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationListTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationListTests.java index fb205cb8c2cf..ca9017537a97 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationListTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationListTests.java @@ -1,31 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.models.AppliedReservationList; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class AppliedReservationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AppliedReservationList model - = BinaryData.fromString("{\"value\":[\"khmsbz\",\"hcrzevd\",\"hlxaolthqtr\"],\"nextLink\":\"jbp\"}") + = BinaryData.fromString("{\"value\":[\"ljlahbcryf\",\"dfdosygexp\"],\"nextLink\":\"jakhmsbzjh\"}") .toObject(AppliedReservationList.class); - Assertions.assertEquals("khmsbz", model.value().get(0)); - Assertions.assertEquals("jbp", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppliedReservationList model - = new AppliedReservationList().withValue(Arrays.asList("khmsbz", "hcrzevd", "hlxaolthqtr")) - .withNextLink("jbp"); - model = BinaryData.fromObject(model).toObject(AppliedReservationList.class); - Assertions.assertEquals("khmsbz", model.value().get(0)); - Assertions.assertEquals("jbp", model.nextLink()); + Assertions.assertEquals("ljlahbcryf", model.value().get(0)); + Assertions.assertEquals("jakhmsbzjh", model.nextLink()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsInnerTests.java index 301895d38748..9c1a275920dd 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsInnerTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsInnerTests.java @@ -1,31 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.fluent.models.AppliedReservationsInner; -import com.azure.resourcemanager.reservations.models.AppliedReservationList; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class AppliedReservationsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AppliedReservationsInner model = BinaryData.fromString( - "{\"id\":\"yahux\",\"name\":\"pmqnja\",\"type\":\"ixjsprozvcputeg\",\"properties\":{\"reservationOrderIds\":{\"value\":[\"datscmd\",\"pjhulsuuvmkj\"],\"nextLink\":\"k\"}}}") + "{\"id\":\"nyejhkryhtnap\",\"name\":\"wlokjyem\",\"type\":\"vnipjox\",\"properties\":{\"reservationOrderIds\":{\"value\":[\"gejspodmailzyde\",\"o\",\"wyahuxinpmqnja\"],\"nextLink\":\"ixjsprozvcputeg\"}}}") .toObject(AppliedReservationsInner.class); - Assertions.assertEquals("datscmd", model.reservationOrderIds().value().get(0)); - Assertions.assertEquals("k", model.reservationOrderIds().nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppliedReservationsInner model = new AppliedReservationsInner().withReservationOrderIds( - new AppliedReservationList().withValue(Arrays.asList("datscmd", "pjhulsuuvmkj")).withNextLink("k")); - model = BinaryData.fromObject(model).toObject(AppliedReservationsInner.class); - Assertions.assertEquals("datscmd", model.reservationOrderIds().value().get(0)); - Assertions.assertEquals("k", model.reservationOrderIds().nextLink()); + Assertions.assertEquals("gejspodmailzyde", model.reservationOrderIds().value().get(0)); + Assertions.assertEquals("ixjsprozvcputeg", model.reservationOrderIds().nextLink()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsPropertiesTests.java index 3db756f0bbd6..a551513d5c68 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedReservationsPropertiesTests.java @@ -1,32 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.fluent.models.AppliedReservationsProperties; -import com.azure.resourcemanager.reservations.models.AppliedReservationList; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class AppliedReservationsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AppliedReservationsProperties model = BinaryData.fromString( - "{\"reservationOrderIds\":{\"value\":[\"dio\",\"jpslwejd\",\"vwryoqpso\",\"cctazakljlahbc\"],\"nextLink\":\"ffdfdosygexpa\"}}") + "{\"reservationOrderIds\":{\"value\":[\"fdatsc\",\"dvpjhulsuuvmk\",\"ozkrwfndiodjpslw\"],\"nextLink\":\"dpvwryoqpsoaccta\"}}") .toObject(AppliedReservationsProperties.class); - Assertions.assertEquals("dio", model.reservationOrderIds().value().get(0)); - Assertions.assertEquals("ffdfdosygexpa", model.reservationOrderIds().nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AppliedReservationsProperties model = new AppliedReservationsProperties().withReservationOrderIds( - new AppliedReservationList().withValue(Arrays.asList("dio", "jpslwejd", "vwryoqpso", "cctazakljlahbc")) - .withNextLink("ffdfdosygexpa")); - model = BinaryData.fromObject(model).toObject(AppliedReservationsProperties.class); - Assertions.assertEquals("dio", model.reservationOrderIds().value().get(0)); - Assertions.assertEquals("ffdfdosygexpa", model.reservationOrderIds().nextLink()); + Assertions.assertEquals("fdatsc", model.reservationOrderIds().value().get(0)); + Assertions.assertEquals("dpvwryoqpsoaccta", model.reservationOrderIds().nextLink()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedScopePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedScopePropertiesTests.java index 4780df6773e2..db564bc9e1c0 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedScopePropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AppliedScopePropertiesTests.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.reservations.generated; @@ -12,27 +12,27 @@ public final class AppliedScopePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AppliedScopeProperties model = BinaryData.fromString( - "{\"tenantId\":\"p\",\"managementGroupId\":\"bdkvwrwjf\",\"subscriptionId\":\"snhu\",\"resourceGroupId\":\"eltmrldhugjzzdat\",\"displayName\":\"hocdgeab\"}") + "{\"tenantId\":\"sounqecanoaeu\",\"managementGroupId\":\"hy\",\"subscriptionId\":\"trpmo\",\"resourceGroupId\":\"mcmatuokthfuiu\",\"displayName\":\"dsfcpkvxodpuoz\"}") .toObject(AppliedScopeProperties.class); - Assertions.assertEquals("p", model.tenantId()); - Assertions.assertEquals("bdkvwrwjf", model.managementGroupId()); - Assertions.assertEquals("snhu", model.subscriptionId()); - Assertions.assertEquals("eltmrldhugjzzdat", model.resourceGroupId()); - Assertions.assertEquals("hocdgeab", model.displayName()); + Assertions.assertEquals("sounqecanoaeu", model.tenantId()); + Assertions.assertEquals("hy", model.managementGroupId()); + Assertions.assertEquals("trpmo", model.subscriptionId()); + Assertions.assertEquals("mcmatuokthfuiu", model.resourceGroupId()); + Assertions.assertEquals("dsfcpkvxodpuoz", model.displayName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AppliedScopeProperties model = new AppliedScopeProperties().withTenantId("p") - .withManagementGroupId("bdkvwrwjf") - .withSubscriptionId("snhu") - .withResourceGroupId("eltmrldhugjzzdat") - .withDisplayName("hocdgeab"); + AppliedScopeProperties model = new AppliedScopeProperties().withTenantId("sounqecanoaeu") + .withManagementGroupId("hy") + .withSubscriptionId("trpmo") + .withResourceGroupId("mcmatuokthfuiu") + .withDisplayName("dsfcpkvxodpuoz"); model = BinaryData.fromObject(model).toObject(AppliedScopeProperties.class); - Assertions.assertEquals("p", model.tenantId()); - Assertions.assertEquals("bdkvwrwjf", model.managementGroupId()); - Assertions.assertEquals("snhu", model.subscriptionId()); - Assertions.assertEquals("eltmrldhugjzzdat", model.resourceGroupId()); - Assertions.assertEquals("hocdgeab", model.displayName()); + Assertions.assertEquals("sounqecanoaeu", model.tenantId()); + Assertions.assertEquals("hy", model.managementGroupId()); + Assertions.assertEquals("trpmo", model.subscriptionId()); + Assertions.assertEquals("mcmatuokthfuiu", model.resourceGroupId()); + Assertions.assertEquals("dsfcpkvxodpuoz", model.displayName()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopePropertiesInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopePropertiesInnerTests.java index 26da1a36bd85..37bbeaa22ea0 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopePropertiesInnerTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopePropertiesInnerTests.java @@ -1,35 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.fluent.models.AvailableScopePropertiesInner; -import com.azure.resourcemanager.reservations.models.ScopeProperties; -import com.azure.resourcemanager.reservations.models.SubscriptionScopeProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class AvailableScopePropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AvailableScopePropertiesInner model = BinaryData.fromString( - "{\"properties\":{\"scopes\":[{\"scope\":\"xbmtqioqjz\",\"valid\":false},{\"scope\":\"muf\",\"valid\":false},{\"scope\":\"oizh\",\"valid\":false}]}}") - .toObject(AvailableScopePropertiesInner.class); - Assertions.assertEquals("xbmtqioqjz", model.properties().scopes().get(0).scope()); - Assertions.assertEquals(false, model.properties().scopes().get(0).valid()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { AvailableScopePropertiesInner model - = new AvailableScopePropertiesInner().withProperties(new SubscriptionScopeProperties() - .withScopes(Arrays.asList(new ScopeProperties().withScope("xbmtqioqjz").withValid(false), - new ScopeProperties().withScope("muf").withValid(false), - new ScopeProperties().withScope("oizh").withValid(false)))); - model = BinaryData.fromObject(model).toObject(AvailableScopePropertiesInner.class); - Assertions.assertEquals("xbmtqioqjz", model.properties().scopes().get(0).scope()); - Assertions.assertEquals(false, model.properties().scopes().get(0).valid()); + = BinaryData.fromString("{\"properties\":{\"scopes\":[{\"scope\":\"wpn\",\"valid\":false}]}}") + .toObject(AvailableScopePropertiesInner.class); + Assertions.assertEquals("wpn", model.properties().scopes().get(0).scope()); + Assertions.assertFalse(model.properties().scopes().get(0).valid()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestPropertiesTests.java index 41e072808306..4ae9d9e5b7b5 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestPropertiesTests.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.reservations.generated; @@ -13,16 +13,15 @@ public final class AvailableScopeRequestPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AvailableScopeRequestProperties model - = BinaryData.fromString("{\"scopes\":[\"zopbsphrupidgs\",\"bb\",\"jhphoyc\",\"sx\"]}") - .toObject(AvailableScopeRequestProperties.class); - Assertions.assertEquals("zopbsphrupidgs", model.scopes().get(0)); + = BinaryData.fromString("{\"scopes\":[\"nxdhbt\"]}").toObject(AvailableScopeRequestProperties.class); + Assertions.assertEquals("nxdhbt", model.scopes().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AvailableScopeRequestProperties model - = new AvailableScopeRequestProperties().withScopes(Arrays.asList("zopbsphrupidgs", "bb", "jhphoyc", "sx")); + = new AvailableScopeRequestProperties().withScopes(Arrays.asList("nxdhbt")); model = BinaryData.fromObject(model).toObject(AvailableScopeRequestProperties.class); - Assertions.assertEquals("zopbsphrupidgs", model.scopes().get(0)); + Assertions.assertEquals("nxdhbt", model.scopes().get(0)); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestTests.java index 9d8db727efc7..2791c3a10e17 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/AvailableScopeRequestTests.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.reservations.generated; @@ -13,16 +13,16 @@ public final class AvailableScopeRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AvailableScopeRequest model = BinaryData.fromString("{\"properties\":{\"scopes\":[\"quvgjxpybczme\"]}}") - .toObject(AvailableScopeRequest.class); - Assertions.assertEquals("quvgjxpybczme", model.properties().scopes().get(0)); + AvailableScopeRequest model + = BinaryData.fromString("{\"properties\":{\"scopes\":[\"fcnj\"]}}").toObject(AvailableScopeRequest.class); + Assertions.assertEquals("fcnj", model.properties().scopes().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AvailableScopeRequest model = new AvailableScopeRequest() - .withProperties(new AvailableScopeRequestProperties().withScopes(Arrays.asList("quvgjxpybczme"))); + .withProperties(new AvailableScopeRequestProperties().withScopes(Arrays.asList("fcnj"))); model = BinaryData.fromObject(model).toObject(AvailableScopeRequest.class); - Assertions.assertEquals("quvgjxpybczme", model.properties().scopes().get(0)); + Assertions.assertEquals("fcnj", model.properties().scopes().get(0)); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestPropertiesTests.java index 063f6a47eeb2..236c9d0a774f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestPropertiesTests.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.reservations.generated; @@ -13,21 +13,21 @@ public final class CalculateRefundRequestPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CalculateRefundRequestProperties model = BinaryData.fromString( - "{\"scope\":\"smx\",\"reservationToReturn\":{\"reservationId\":\"mpvecxgodebfqk\",\"quantity\":897407586}}") + "{\"scope\":\"n\",\"reservationToReturn\":{\"reservationId\":\"isxyawjoyaqcslyj\",\"quantity\":383766185}}") .toObject(CalculateRefundRequestProperties.class); - Assertions.assertEquals("smx", model.scope()); - Assertions.assertEquals("mpvecxgodebfqk", model.reservationToReturn().reservationId()); - Assertions.assertEquals(897407586, model.reservationToReturn().quantity()); + Assertions.assertEquals("n", model.scope()); + Assertions.assertEquals("isxyawjoyaqcslyj", model.reservationToReturn().reservationId()); + Assertions.assertEquals(383766185, model.reservationToReturn().quantity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CalculateRefundRequestProperties model = new CalculateRefundRequestProperties().withScope("smx") + CalculateRefundRequestProperties model = new CalculateRefundRequestProperties().withScope("n") .withReservationToReturn( - new ReservationToReturn().withReservationId("mpvecxgodebfqk").withQuantity(897407586)); + new ReservationToReturn().withReservationId("isxyawjoyaqcslyj").withQuantity(383766185)); model = BinaryData.fromObject(model).toObject(CalculateRefundRequestProperties.class); - Assertions.assertEquals("smx", model.scope()); - Assertions.assertEquals("mpvecxgodebfqk", model.reservationToReturn().reservationId()); - Assertions.assertEquals(897407586, model.reservationToReturn().quantity()); + Assertions.assertEquals("n", model.scope()); + Assertions.assertEquals("isxyawjoyaqcslyj", model.reservationToReturn().reservationId()); + Assertions.assertEquals(383766185, model.reservationToReturn().quantity()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestTests.java index 47f6a4371d35..1e1e1e499ff7 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CalculateRefundRequestTests.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.reservations.generated; @@ -14,24 +14,24 @@ public final class CalculateRefundRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CalculateRefundRequest model = BinaryData.fromString( - "{\"id\":\"ljyoxgvcltb\",\"properties\":{\"scope\":\"c\",\"reservationToReturn\":{\"reservationId\":\"jeszzhbijhtxfv\",\"quantity\":667929438}}}") + "{\"id\":\"jyofdxluusdtto\",\"properties\":{\"scope\":\"boekqvkel\",\"reservationToReturn\":{\"reservationId\":\"vbxwyjsflhh\",\"quantity\":799818448}}}") .toObject(CalculateRefundRequest.class); - Assertions.assertEquals("ljyoxgvcltb", model.id()); - Assertions.assertEquals("c", model.properties().scope()); - Assertions.assertEquals("jeszzhbijhtxfv", model.properties().reservationToReturn().reservationId()); - Assertions.assertEquals(667929438, model.properties().reservationToReturn().quantity()); + Assertions.assertEquals("jyofdxluusdtto", model.id()); + Assertions.assertEquals("boekqvkel", model.properties().scope()); + Assertions.assertEquals("vbxwyjsflhh", model.properties().reservationToReturn().reservationId()); + Assertions.assertEquals(799818448, model.properties().reservationToReturn().quantity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CalculateRefundRequest model = new CalculateRefundRequest().withId("ljyoxgvcltb") - .withProperties(new CalculateRefundRequestProperties().withScope("c") + CalculateRefundRequest model = new CalculateRefundRequest().withId("jyofdxluusdtto") + .withProperties(new CalculateRefundRequestProperties().withScope("boekqvkel") .withReservationToReturn( - new ReservationToReturn().withReservationId("jeszzhbijhtxfv").withQuantity(667929438))); + new ReservationToReturn().withReservationId("vbxwyjsflhh").withQuantity(799818448))); model = BinaryData.fromObject(model).toObject(CalculateRefundRequest.class); - Assertions.assertEquals("ljyoxgvcltb", model.id()); - Assertions.assertEquals("c", model.properties().scope()); - Assertions.assertEquals("jeszzhbijhtxfv", model.properties().reservationToReturn().reservationId()); - Assertions.assertEquals(667929438, model.properties().reservationToReturn().quantity()); + Assertions.assertEquals("jyofdxluusdtto", model.id()); + Assertions.assertEquals("boekqvkel", model.properties().scope()); + Assertions.assertEquals("vbxwyjsflhh", model.properties().reservationToReturn().reservationId()); + Assertions.assertEquals(799818448, model.properties().reservationToReturn().quantity()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryRequestTests.java index 30795d4ff791..807ae97c2ab7 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryRequestTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryRequestTests.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.reservations.generated; @@ -12,14 +12,14 @@ public final class ChangeDirectoryRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ChangeDirectoryRequest model - = BinaryData.fromString("{\"destinationTenantId\":\"piexpbtgiw\"}").toObject(ChangeDirectoryRequest.class); - Assertions.assertEquals("piexpbtgiw", model.destinationTenantId()); + = BinaryData.fromString("{\"destinationTenantId\":\"wuwprzqlv\"}").toObject(ChangeDirectoryRequest.class); + Assertions.assertEquals("wuwprzqlv", model.destinationTenantId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ChangeDirectoryRequest model = new ChangeDirectoryRequest().withDestinationTenantId("piexpbtgiw"); + ChangeDirectoryRequest model = new ChangeDirectoryRequest().withDestinationTenantId("wuwprzqlv"); model = BinaryData.fromObject(model).toObject(ChangeDirectoryRequest.class); - Assertions.assertEquals("piexpbtgiw", model.destinationTenantId()); + Assertions.assertEquals("wuwprzqlv", model.destinationTenantId()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResponseInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResponseInnerTests.java index eb1282cf8e05..876f267101f5 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResponseInnerTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResponseInnerTests.java @@ -1,59 +1,26 @@ // 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.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.fluent.models.ChangeDirectoryResponseInner; -import com.azure.resourcemanager.reservations.models.ChangeDirectoryResult; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ChangeDirectoryResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ChangeDirectoryResponseInner model = BinaryData.fromString( - "{\"reservationOrder\":{\"id\":\"enwash\",\"name\":\"dtkcnqxwbpokulp\",\"isSucceeded\":false,\"error\":\"aasipqi\"},\"reservations\":[{\"id\":\"uqerpqlpqwc\",\"name\":\"uqgbdbutauvfbt\",\"isSucceeded\":true,\"error\":\"h\"},{\"id\":\"ykojoxafnndlpic\",\"name\":\"o\",\"isSucceeded\":false,\"error\":\"dyh\"},{\"id\":\"kkpwdreqnovvq\",\"name\":\"vljxywsu\",\"isSucceeded\":false,\"error\":\"s\"}]}") + "{\"reservationOrder\":{\"id\":\"lupj\",\"name\":\"hfxobbcswsrtj\",\"isSucceeded\":true,\"error\":\"rbpbewtghfgblcg\"},\"reservations\":[{\"id\":\"lvqhjkbegibtnmx\",\"name\":\"bwwaloa\",\"isSucceeded\":true,\"error\":\"wrtz\"},{\"id\":\"zg\",\"name\":\"zmh\",\"isSucceeded\":false,\"error\":\"gmtsavjcbpwxqpsr\"},{\"id\":\"ftguv\",\"name\":\"uhprwmdyvxqt\",\"isSucceeded\":false,\"error\":\"ww\"},{\"id\":\"yqbexrmcqibycno\",\"name\":\"knme\",\"isSucceeded\":true,\"error\":\"zvahapjy\"}]}") .toObject(ChangeDirectoryResponseInner.class); - Assertions.assertEquals("enwash", model.reservationOrder().id()); - Assertions.assertEquals("dtkcnqxwbpokulp", model.reservationOrder().name()); - Assertions.assertEquals(false, model.reservationOrder().isSucceeded()); - Assertions.assertEquals("aasipqi", model.reservationOrder().error()); - Assertions.assertEquals("uqerpqlpqwc", model.reservations().get(0).id()); - Assertions.assertEquals("uqgbdbutauvfbt", model.reservations().get(0).name()); - Assertions.assertEquals(true, model.reservations().get(0).isSucceeded()); - Assertions.assertEquals("h", model.reservations().get(0).error()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChangeDirectoryResponseInner model = new ChangeDirectoryResponseInner() - .withReservationOrder(new ChangeDirectoryResult().withId("enwash") - .withName("dtkcnqxwbpokulp") - .withIsSucceeded(false) - .withError("aasipqi")) - .withReservations(Arrays.asList( - new ChangeDirectoryResult().withId("uqerpqlpqwc") - .withName("uqgbdbutauvfbt") - .withIsSucceeded(true) - .withError("h"), - new ChangeDirectoryResult().withId("ykojoxafnndlpic") - .withName("o") - .withIsSucceeded(false) - .withError("dyh"), - new ChangeDirectoryResult().withId("kkpwdreqnovvq") - .withName("vljxywsu") - .withIsSucceeded(false) - .withError("s"))); - model = BinaryData.fromObject(model).toObject(ChangeDirectoryResponseInner.class); - Assertions.assertEquals("enwash", model.reservationOrder().id()); - Assertions.assertEquals("dtkcnqxwbpokulp", model.reservationOrder().name()); - Assertions.assertEquals(false, model.reservationOrder().isSucceeded()); - Assertions.assertEquals("aasipqi", model.reservationOrder().error()); - Assertions.assertEquals("uqerpqlpqwc", model.reservations().get(0).id()); - Assertions.assertEquals("uqgbdbutauvfbt", model.reservations().get(0).name()); - Assertions.assertEquals(true, model.reservations().get(0).isSucceeded()); - Assertions.assertEquals("h", model.reservations().get(0).error()); + Assertions.assertEquals("lupj", model.reservationOrder().id()); + Assertions.assertEquals("hfxobbcswsrtj", model.reservationOrder().name()); + Assertions.assertTrue(model.reservationOrder().isSucceeded()); + Assertions.assertEquals("rbpbewtghfgblcg", model.reservationOrder().error()); + Assertions.assertEquals("lvqhjkbegibtnmx", model.reservations().get(0).id()); + Assertions.assertEquals("bwwaloa", model.reservations().get(0).name()); + Assertions.assertTrue(model.reservations().get(0).isSucceeded()); + Assertions.assertEquals("wrtz", model.reservations().get(0).error()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResultTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResultTests.java index d9f3d74a06f7..541b6596e4bf 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResultTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ChangeDirectoryResultTests.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.reservations.generated; @@ -12,24 +12,11 @@ public final class ChangeDirectoryResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ChangeDirectoryResult model = BinaryData - .fromString("{\"id\":\"sytgadgvraea\",\"name\":\"e\",\"isSucceeded\":false,\"error\":\"rrwlquuijfqkace\"}") + .fromString("{\"id\":\"pvgqzcjrvxdjzlm\",\"name\":\"xkvugfhzov\",\"isSucceeded\":true,\"error\":\"zunlu\"}") .toObject(ChangeDirectoryResult.class); - Assertions.assertEquals("sytgadgvraea", model.id()); - Assertions.assertEquals("e", model.name()); - Assertions.assertEquals(false, model.isSucceeded()); - Assertions.assertEquals("rrwlquuijfqkace", model.error()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChangeDirectoryResult model = new ChangeDirectoryResult().withId("sytgadgvraea") - .withName("e") - .withIsSucceeded(false) - .withError("rrwlquuijfqkace"); - model = BinaryData.fromObject(model).toObject(ChangeDirectoryResult.class); - Assertions.assertEquals("sytgadgvraea", model.id()); - Assertions.assertEquals("e", model.name()); - Assertions.assertEquals(false, model.isSucceeded()); - Assertions.assertEquals("rrwlquuijfqkace", model.error()); + Assertions.assertEquals("pvgqzcjrvxdjzlm", model.id()); + Assertions.assertEquals("xkvugfhzov", model.name()); + Assertions.assertTrue(model.isSucceeded()); + Assertions.assertEquals("zunlu", model.error()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CurrentQuotaLimitBaseInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CurrentQuotaLimitBaseInnerTests.java index c5cafa9d3ed7..b53d723bb90a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CurrentQuotaLimitBaseInnerTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/CurrentQuotaLimitBaseInnerTests.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.reservations.generated; @@ -15,26 +15,26 @@ public final class CurrentQuotaLimitBaseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CurrentQuotaLimitBaseInner model = BinaryData.fromString( - "{\"properties\":{\"limit\":288092317,\"currentValue\":1703781779,\"unit\":\"bjibwwiftohq\",\"name\":{\"value\":\"uvksgplsaknynfsy\",\"localizedValue\":\"jphuopxodlqi\"},\"resourceType\":\"shared\",\"quotaPeriod\":\"rz\",\"properties\":\"dataleosjswsrms\"},\"id\":\"yzrpzbchckqqzq\",\"name\":\"ox\",\"type\":\"ysuiizynkedya\"}") + "{\"properties\":{\"limit\":1759677036,\"currentValue\":352301275,\"unit\":\"l\",\"name\":{\"value\":\"dj\",\"localizedValue\":\"lkhbz\"},\"resourceType\":\"lowPriority\",\"quotaPeriod\":\"gzgqexzlo\",\"properties\":\"\\\"datascpai\\\"\"},\"id\":\"hhbcsglummajtjao\",\"name\":\"xobnbdxkqpxok\",\"type\":\"jionpimexgstxgc\"}") .toObject(CurrentQuotaLimitBaseInner.class); - Assertions.assertEquals(288092317, model.properties().limit()); - Assertions.assertEquals("bjibwwiftohq", model.properties().unit()); - Assertions.assertEquals("uvksgplsaknynfsy", model.properties().name().value()); - Assertions.assertEquals(ResourceType.SHARED, model.properties().resourceType()); + Assertions.assertEquals(1759677036, model.properties().limit()); + Assertions.assertEquals("l", model.properties().unit()); + Assertions.assertEquals("dj", model.properties().name().value()); + Assertions.assertEquals(ResourceType.LOW_PRIORITY, model.properties().resourceType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CurrentQuotaLimitBaseInner model - = new CurrentQuotaLimitBaseInner().withProperties(new QuotaProperties().withLimit(288092317) - .withUnit("bjibwwiftohq") - .withName(new ResourceName().withValue("uvksgplsaknynfsy")) - .withResourceType(ResourceType.SHARED) - .withProperties("dataleosjswsrms")); + = new CurrentQuotaLimitBaseInner().withProperties(new QuotaProperties().withLimit(1759677036) + .withUnit("l") + .withName(new ResourceName().withValue("dj")) + .withResourceType(ResourceType.LOW_PRIORITY) + .withProperties("\"datascpai\"")); model = BinaryData.fromObject(model).toObject(CurrentQuotaLimitBaseInner.class); - Assertions.assertEquals(288092317, model.properties().limit()); - Assertions.assertEquals("bjibwwiftohq", model.properties().unit()); - Assertions.assertEquals("uvksgplsaknynfsy", model.properties().name().value()); - Assertions.assertEquals(ResourceType.SHARED, model.properties().resourceType()); + Assertions.assertEquals(1759677036, model.properties().limit()); + Assertions.assertEquals("l", model.properties().unit()); + Assertions.assertEquals("dj", model.properties().name().value()); + Assertions.assertEquals(ResourceType.LOW_PRIORITY, model.properties().resourceType()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestPropertiesTests.java index c0c2cf31d9f6..2157c65c66d2 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestPropertiesTests.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.reservations.generated; @@ -12,14 +12,14 @@ public final class ExchangeRequestPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExchangeRequestProperties model - = BinaryData.fromString("{\"sessionId\":\"bqdxbx\"}").toObject(ExchangeRequestProperties.class); - Assertions.assertEquals("bqdxbx", model.sessionId()); + = BinaryData.fromString("{\"sessionId\":\"wvgpiohg\"}").toObject(ExchangeRequestProperties.class); + Assertions.assertEquals("wvgpiohg", model.sessionId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExchangeRequestProperties model = new ExchangeRequestProperties().withSessionId("bqdxbx"); + ExchangeRequestProperties model = new ExchangeRequestProperties().withSessionId("wvgpiohg"); model = BinaryData.fromObject(model).toObject(ExchangeRequestProperties.class); - Assertions.assertEquals("bqdxbx", model.sessionId()); + Assertions.assertEquals("wvgpiohg", model.sessionId()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestTests.java index 3db7229c94b9..859067777733 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ExchangeRequestTests.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.reservations.generated; @@ -13,15 +13,15 @@ public final class ExchangeRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExchangeRequest model - = BinaryData.fromString("{\"properties\":{\"sessionId\":\"dkwobdagx\"}}").toObject(ExchangeRequest.class); - Assertions.assertEquals("dkwobdagx", model.properties().sessionId()); + = BinaryData.fromString("{\"properties\":{\"sessionId\":\"aayg\"}}").toObject(ExchangeRequest.class); + Assertions.assertEquals("aayg", model.properties().sessionId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ExchangeRequest model - = new ExchangeRequest().withProperties(new ExchangeRequestProperties().withSessionId("dkwobdagx")); + = new ExchangeRequest().withProperties(new ExchangeRequestProperties().withSessionId("aayg")); model = BinaryData.fromObject(model).toObject(ExchangeRequest.class); - Assertions.assertEquals("dkwobdagx", model.properties().sessionId()); + Assertions.assertEquals("aayg", model.properties().sessionId()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergePropertiesTests.java index 9967a3a81710..d7f2a6db5e27 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergePropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergePropertiesTests.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.reservations.generated; @@ -12,17 +12,15 @@ public final class MergePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MergeProperties model = BinaryData - .fromString("{\"sources\":[\"tkftutqxlngx\",\"efgugnxk\",\"xdqmidtthzrvqdra\",\"hjybigehoqfbo\"]}") - .toObject(MergeProperties.class); - Assertions.assertEquals("tkftutqxlngx", model.sources().get(0)); + MergeProperties model + = BinaryData.fromString("{\"sources\":[\"wbme\",\"hseyvju\"]}").toObject(MergeProperties.class); + Assertions.assertEquals("wbme", model.sources().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MergeProperties model = new MergeProperties() - .withSources(Arrays.asList("tkftutqxlngx", "efgugnxk", "xdqmidtthzrvqdra", "hjybigehoqfbo")); + MergeProperties model = new MergeProperties().withSources(Arrays.asList("wbme", "hseyvju")); model = BinaryData.fromObject(model).toObject(MergeProperties.class); - Assertions.assertEquals("tkftutqxlngx", model.sources().get(0)); + Assertions.assertEquals("wbme", model.sources().get(0)); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergeRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergeRequestTests.java index 27f58cda2537..3f4109e5127f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergeRequestTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/MergeRequestTests.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.reservations.generated; @@ -13,14 +13,15 @@ public final class MergeRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MergeRequest model - = BinaryData.fromString("{\"properties\":{\"sources\":[\"ayvvtpgvdf\"]}}").toObject(MergeRequest.class); - Assertions.assertEquals("ayvvtpgvdf", model.sources().get(0)); + = BinaryData.fromString("{\"properties\":{\"sources\":[\"bkyvp\",\"ca\",\"uzbpzkafku\",\"b\"]}}") + .toObject(MergeRequest.class); + Assertions.assertEquals("bkyvp", model.sources().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MergeRequest model = new MergeRequest().withSources(Arrays.asList("ayvvtpgvdf")); + MergeRequest model = new MergeRequest().withSources(Arrays.asList("bkyvp", "ca", "uzbpzkafku", "b")); model = BinaryData.fromObject(model).toObject(MergeRequest.class); - Assertions.assertEquals("ayvvtpgvdf", model.sources().get(0)); + Assertions.assertEquals("bkyvp", model.sources().get(0)); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationDisplayTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationDisplayTests.java index 2fa9bebbbd64..ab625901fab6 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationDisplayTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationDisplayTests.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.reservations.generated; @@ -12,24 +12,11 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"wutttxfvjrbi\",\"resource\":\"hxepcyvahfnlj\",\"operation\":\"qxj\",\"description\":\"ujqgidok\"}") + "{\"provider\":\"cpc\",\"resource\":\"hurzafblj\",\"operation\":\"pbtoqcjmkl\",\"description\":\"vbqid\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("wutttxfvjrbi", model.provider()); - Assertions.assertEquals("hxepcyvahfnlj", model.resource()); - Assertions.assertEquals("qxj", model.operation()); - Assertions.assertEquals("ujqgidok", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("wutttxfvjrbi") - .withResource("hxepcyvahfnlj") - .withOperation("qxj") - .withDescription("ujqgidok"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("wutttxfvjrbi", model.provider()); - Assertions.assertEquals("hxepcyvahfnlj", model.resource()); - Assertions.assertEquals("qxj", model.operation()); - Assertions.assertEquals("ujqgidok", model.description()); + Assertions.assertEquals("cpc", model.provider()); + Assertions.assertEquals("hurzafblj", model.resource()); + Assertions.assertEquals("pbtoqcjmkl", model.operation()); + Assertions.assertEquals("vbqid", model.description()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationListTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationListTests.java index 9d8eb2756c6c..1e3174fc5d65 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationListTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationListTests.java @@ -1,76 +1,26 @@ // 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.reservations.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.reservations.models.OperationDisplay; -import com.azure.resourcemanager.reservations.models.OperationList; -import java.util.Arrays; +import com.azure.resourcemanager.reservations.implementation.models.OperationList; import org.junit.jupiter.api.Assertions; public final class OperationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationList model = BinaryData.fromString( - "{\"value\":[{\"name\":\"byao\",\"isDataAction\":false,\"display\":{\"provider\":\"sonpclhocohs\",\"resource\":\"ev\",\"operation\":\"ggzfbu\",\"description\":\"mvfaxkffeiith\"},\"origin\":\"m\",\"properties\":\"datayvshxmz\"},{\"name\":\"bzoggigrx\",\"isDataAction\":false,\"display\":{\"provider\":\"jx\",\"resource\":\"nspydptkoenkoukn\",\"operation\":\"dwtiukbldngkp\",\"description\":\"ipazyxoegukgjnpi\"},\"origin\":\"gygev\",\"properties\":\"datantypmrbpizcdrqj\"},{\"name\":\"pyd\",\"isDataAction\":true,\"display\":{\"provider\":\"de\",\"resource\":\"jzicwifsjt\",\"operation\":\"zfbishcbkhaj\",\"description\":\"yeamdphagalpb\"},\"origin\":\"wgipwhono\",\"properties\":\"datagshwankixz\"},{\"name\":\"njeputtmrywn\",\"isDataAction\":true,\"display\":{\"provider\":\"tiyqzrnkcqv\",\"resource\":\"lwh\",\"operation\":\"sicohoqqnwvlry\",\"description\":\"w\"},\"origin\":\"eun\",\"properties\":\"dataqhgyxzkonocukok\"}],\"nextLink\":\"axuconuq\"}") + "{\"value\":[{\"name\":\"s\",\"isDataAction\":false,\"display\":{\"provider\":\"uxig\",\"resource\":\"jgzjaoyfhrtx\",\"operation\":\"n\",\"description\":\"kujysvlejuvfq\"},\"origin\":\"rlyxwjkcprbnw\",\"properties\":\"\\\"datagjvtbv\\\"\"},{\"name\":\"sszdnru\",\"isDataAction\":true,\"display\":{\"provider\":\"muouqfp\",\"resource\":\"zw\",\"operation\":\"g\",\"description\":\"tnwu\"},\"origin\":\"gazxuf\",\"properties\":\"\\\"datauckyf\\\"\"},{\"name\":\"rfidfvzwdz\",\"isDataAction\":false,\"display\":{\"provider\":\"wisdkft\",\"resource\":\"xmnteiwaop\",\"operation\":\"mijcmmxdcufufs\",\"description\":\"ymzidn\"},\"origin\":\"zcxtbzsgfyccsn\",\"properties\":\"\\\"datamdwzjeiachboo\\\"\"}],\"nextLink\":\"lnrosfqp\"}") .toObject(OperationList.class); - Assertions.assertEquals("byao", model.value().get(0).name()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("sonpclhocohs", model.value().get(0).display().provider()); - Assertions.assertEquals("ev", model.value().get(0).display().resource()); - Assertions.assertEquals("ggzfbu", model.value().get(0).display().operation()); - Assertions.assertEquals("mvfaxkffeiith", model.value().get(0).display().description()); - Assertions.assertEquals("m", model.value().get(0).origin()); - Assertions.assertEquals("axuconuq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = new OperationList().withValue(Arrays.asList( - new OperationResponseInner().withName("byao") - .withIsDataAction(false) - .withDisplay(new OperationDisplay().withProvider("sonpclhocohs") - .withResource("ev") - .withOperation("ggzfbu") - .withDescription("mvfaxkffeiith")) - .withOrigin("m") - .withProperties("datayvshxmz"), - new OperationResponseInner().withName("bzoggigrx") - .withIsDataAction(false) - .withDisplay(new OperationDisplay().withProvider("jx") - .withResource("nspydptkoenkoukn") - .withOperation("dwtiukbldngkp") - .withDescription("ipazyxoegukgjnpi")) - .withOrigin("gygev") - .withProperties("datantypmrbpizcdrqj"), - new OperationResponseInner().withName("pyd") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("de") - .withResource("jzicwifsjt") - .withOperation("zfbishcbkhaj") - .withDescription("yeamdphagalpb")) - .withOrigin("wgipwhono") - .withProperties("datagshwankixz"), - new OperationResponseInner().withName("njeputtmrywn") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("tiyqzrnkcqv") - .withResource("lwh") - .withOperation("sicohoqqnwvlry") - .withDescription("w")) - .withOrigin("eun") - .withProperties("dataqhgyxzkonocukok"))) - .withNextLink("axuconuq"); - model = BinaryData.fromObject(model).toObject(OperationList.class); - Assertions.assertEquals("byao", model.value().get(0).name()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("sonpclhocohs", model.value().get(0).display().provider()); - Assertions.assertEquals("ev", model.value().get(0).display().resource()); - Assertions.assertEquals("ggzfbu", model.value().get(0).display().operation()); - Assertions.assertEquals("mvfaxkffeiith", model.value().get(0).display().description()); - Assertions.assertEquals("m", model.value().get(0).origin()); - Assertions.assertEquals("axuconuq", model.nextLink()); + Assertions.assertEquals("s", model.value().get(0).name()); + Assertions.assertFalse(model.value().get(0).isDataAction()); + Assertions.assertEquals("uxig", model.value().get(0).display().provider()); + Assertions.assertEquals("jgzjaoyfhrtx", model.value().get(0).display().resource()); + Assertions.assertEquals("n", model.value().get(0).display().operation()); + Assertions.assertEquals("kujysvlejuvfq", model.value().get(0).display().description()); + Assertions.assertEquals("rlyxwjkcprbnw", model.value().get(0).origin()); + Assertions.assertEquals("lnrosfqp", model.nextLink()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationResponseInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationResponseInnerTests.java index cb1668eca3a7..fde6b219c754 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationResponseInnerTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationResponseInnerTests.java @@ -1,46 +1,25 @@ // 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.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.reservations.models.OperationDisplay; import org.junit.jupiter.api.Assertions; public final class OperationResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationResponseInner model = BinaryData.fromString( - "{\"name\":\"fkbey\",\"isDataAction\":true,\"display\":{\"provider\":\"jmwvvj\",\"resource\":\"tcxsenhwlrs\",\"operation\":\"rzpwvlqdqgbiq\",\"description\":\"ihkaetcktvfc\"},\"origin\":\"fsnkymuctq\",\"properties\":\"datafbebrjcxer\"}") + "{\"name\":\"ehzzvypyqrim\",\"isDataAction\":true,\"display\":{\"provider\":\"swjdkirso\",\"resource\":\"qxhcrmn\",\"operation\":\"jtckwhdso\",\"description\":\"iy\"},\"origin\":\"jxsqwpgrjbz\",\"properties\":\"\\\"datarcjxvsnbyxqabn\\\"\"}") .toObject(OperationResponseInner.class); - Assertions.assertEquals("fkbey", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("jmwvvj", model.display().provider()); - Assertions.assertEquals("tcxsenhwlrs", model.display().resource()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.display().operation()); - Assertions.assertEquals("ihkaetcktvfc", model.display().description()); - Assertions.assertEquals("fsnkymuctq", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResponseInner model = new OperationResponseInner().withName("fkbey") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("jmwvvj") - .withResource("tcxsenhwlrs") - .withOperation("rzpwvlqdqgbiq") - .withDescription("ihkaetcktvfc")) - .withOrigin("fsnkymuctq") - .withProperties("datafbebrjcxer"); - model = BinaryData.fromObject(model).toObject(OperationResponseInner.class); - Assertions.assertEquals("fkbey", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("jmwvvj", model.display().provider()); - Assertions.assertEquals("tcxsenhwlrs", model.display().resource()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.display().operation()); - Assertions.assertEquals("ihkaetcktvfc", model.display().description()); - Assertions.assertEquals("fsnkymuctq", model.origin()); + Assertions.assertEquals("ehzzvypyqrim", model.name()); + Assertions.assertTrue(model.isDataAction()); + Assertions.assertEquals("swjdkirso", model.display().provider()); + Assertions.assertEquals("qxhcrmn", model.display().resource()); + Assertions.assertEquals("jtckwhdso", model.display().operation()); + Assertions.assertEquals("iy", model.display().description()); + Assertions.assertEquals("jxsqwpgrjbz", model.origin()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationsListMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationsListMockTests.java index ac36ccf67fe7..bbaba497f73d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationsListMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/OperationsListMockTests.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.reservations.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.reservations.ReservationsManager; import com.azure.resourcemanager.reservations.models.OperationResponse; @@ -22,23 +22,23 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"fi\",\"isDataAction\":true,\"display\":{\"provider\":\"uzaofjchvcyyy\",\"resource\":\"gdotcubiipuipwo\",\"operation\":\"nmacj\",\"description\":\"nizshqvcim\"},\"origin\":\"vfgmblrrilby\",\"properties\":\"dataxsmiccwrwfscjf\"}]}"; + = "{\"value\":[{\"name\":\"ygqukyhejh\",\"isDataAction\":false,\"display\":{\"provider\":\"fpel\",\"resource\":\"p\",\"operation\":\"ksrpqv\",\"description\":\"zraehtwd\"},\"origin\":\"ftswibyrcdlbhsh\",\"properties\":\"\\\"datap\\\"\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ReservationsManager manager = ReservationsManager.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("fi", response.iterator().next().name()); - Assertions.assertEquals(true, response.iterator().next().isDataAction()); - Assertions.assertEquals("uzaofjchvcyyy", response.iterator().next().display().provider()); - Assertions.assertEquals("gdotcubiipuipwo", response.iterator().next().display().resource()); - Assertions.assertEquals("nmacj", response.iterator().next().display().operation()); - Assertions.assertEquals("nizshqvcim", response.iterator().next().display().description()); - Assertions.assertEquals("vfgmblrrilby", response.iterator().next().origin()); + Assertions.assertEquals("ygqukyhejh", response.iterator().next().name()); + Assertions.assertFalse(response.iterator().next().isDataAction()); + Assertions.assertEquals("fpel", response.iterator().next().display().provider()); + Assertions.assertEquals("p", response.iterator().next().display().resource()); + Assertions.assertEquals("ksrpqv", response.iterator().next().display().operation()); + Assertions.assertEquals("zraehtwd", response.iterator().next().display().description()); + Assertions.assertEquals("ftswibyrcdlbhsh", response.iterator().next().origin()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchModelTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchModelTests.java index 64949a9fedfd..789bea5ae5c6 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchModelTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchModelTests.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.reservations.generated; @@ -24,121 +24,121 @@ public final class PatchModelTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PatchModel model = BinaryData.fromString( - "{\"properties\":{\"appliedScopeType\":\"Shared\",\"appliedScopes\":[\"xaqwoochcbonqv\"],\"appliedScopeProperties\":{\"tenantId\":\"lrxnjeaseiphe\",\"managementGroupId\":\"lokeyy\",\"subscriptionId\":\"nj\",\"resourceGroupId\":\"lwtgrhpdj\",\"displayName\":\"umasxazjpq\"},\"instanceFlexibility\":\"On\",\"name\":\"alhbx\",\"renew\":false,\"renewProperties\":{\"purchaseProperties\":{\"sku\":{\"name\":\"v\"},\"location\":\"dgwdslfhot\",\"properties\":{\"reservedResourceType\":\"SuseLinux\",\"billingScopeId\":\"pwlbjnpg\",\"term\":\"P5Y\",\"billingPlan\":\"Monthly\",\"quantity\":587661863,\"displayName\":\"xnltyfsoppu\",\"appliedScopeType\":\"Single\",\"appliedScopes\":[\"zwdejbavor\",\"zdmohctbqvu\"],\"appliedScopeProperties\":{\"tenantId\":\"dndnvow\",\"managementGroupId\":\"jjugwdkcglhslaz\",\"subscriptionId\":\"yggdtjixh\",\"resourceGroupId\":\"uofqwe\",\"displayName\":\"hmenevfyexfwhybc\"},\"renew\":false,\"reservedResourceProperties\":{\"instanceFlexibility\":\"On\"},\"reviewDateTime\":\"2021-12-10T22:53:58Z\"}}},\"reviewDateTime\":\"2020-12-31T22:16:40Z\"}}") + "{\"properties\":{\"appliedScopeType\":\"ManagementGroup\",\"appliedScopes\":[\"lyaxuc\",\"nuqszfkbey\",\"ewrmjmwvvjektc\"],\"appliedScopeProperties\":{\"tenantId\":\"nhwlrsffrzpwvl\",\"managementGroupId\":\"q\",\"subscriptionId\":\"iqylihkaetck\",\"resourceGroupId\":\"fcivfsnkym\",\"displayName\":\"tqhjfbebrjcx\"},\"instanceFlexibility\":\"Off\",\"name\":\"wutttxfvjrbi\",\"renew\":true,\"renewProperties\":{\"purchaseProperties\":{\"sku\":{\"name\":\"yva\"},\"location\":\"nljky\",\"properties\":{\"reservedResourceType\":\"AppService\",\"billingScopeId\":\"ujqgidok\",\"term\":\"P3Y\",\"billingPlan\":\"Monthly\",\"quantity\":1125977089,\"displayName\":\"vcltbgsncgh\",\"appliedScopeType\":\"ManagementGroup\",\"appliedScopes\":[\"zhbijhtxfv\"],\"appliedScopeProperties\":{\"tenantId\":\"fsm\",\"managementGroupId\":\"eh\",\"subscriptionId\":\"vecxgodebfqkk\",\"resourceGroupId\":\"mpukgriw\",\"displayName\":\"zlfbxzpuzycispnq\"},\"renew\":true,\"reservedResourceProperties\":{\"instanceFlexibility\":\"Off\"},\"reviewDateTime\":\"2021-02-20T05:08:15Z\"}}},\"reviewDateTime\":\"2021-02-05T07:41:31Z\"}}") .toObject(PatchModel.class); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("xaqwoochcbonqv", model.appliedScopes().get(0)); - Assertions.assertEquals("lrxnjeaseiphe", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("lokeyy", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("nj", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("lwtgrhpdj", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("umasxazjpq", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(InstanceFlexibility.ON, model.instanceFlexibility()); - Assertions.assertEquals("alhbx", model.name()); - Assertions.assertEquals(false, model.renew()); - Assertions.assertEquals("v", model.renewProperties().purchaseProperties().sku().name()); - Assertions.assertEquals("dgwdslfhot", model.renewProperties().purchaseProperties().location()); - Assertions.assertEquals(ReservedResourceType.SUSE_LINUX, + Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); + Assertions.assertEquals("lyaxuc", model.appliedScopes().get(0)); + Assertions.assertEquals("nhwlrsffrzpwvl", model.appliedScopeProperties().tenantId()); + Assertions.assertEquals("q", model.appliedScopeProperties().managementGroupId()); + Assertions.assertEquals("iqylihkaetck", model.appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("fcivfsnkym", model.appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("tqhjfbebrjcx", model.appliedScopeProperties().displayName()); + Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); + Assertions.assertEquals("wutttxfvjrbi", model.name()); + Assertions.assertTrue(model.renew()); + Assertions.assertEquals("yva", model.renewProperties().purchaseProperties().sku().name()); + Assertions.assertEquals("nljky", model.renewProperties().purchaseProperties().location()); + Assertions.assertEquals(ReservedResourceType.APP_SERVICE, model.renewProperties().purchaseProperties().reservedResourceType()); - Assertions.assertEquals("pwlbjnpg", model.renewProperties().purchaseProperties().billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.renewProperties().purchaseProperties().term()); + Assertions.assertEquals("ujqgidok", model.renewProperties().purchaseProperties().billingScopeId()); + Assertions.assertEquals(ReservationTerm.P3Y, model.renewProperties().purchaseProperties().term()); Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.renewProperties().purchaseProperties().billingPlan()); - Assertions.assertEquals(587661863, model.renewProperties().purchaseProperties().quantity()); - Assertions.assertEquals("xnltyfsoppu", model.renewProperties().purchaseProperties().displayName()); - Assertions.assertEquals(AppliedScopeType.SINGLE, + Assertions.assertEquals(1125977089, model.renewProperties().purchaseProperties().quantity()); + Assertions.assertEquals("vcltbgsncgh", model.renewProperties().purchaseProperties().displayName()); + Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.renewProperties().purchaseProperties().appliedScopeType()); - Assertions.assertEquals("zwdejbavor", model.renewProperties().purchaseProperties().appliedScopes().get(0)); - Assertions.assertEquals("dndnvow", + Assertions.assertEquals("zhbijhtxfv", model.renewProperties().purchaseProperties().appliedScopes().get(0)); + Assertions.assertEquals("fsm", model.renewProperties().purchaseProperties().appliedScopeProperties().tenantId()); - Assertions.assertEquals("jjugwdkcglhslaz", + Assertions.assertEquals("eh", model.renewProperties().purchaseProperties().appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("yggdtjixh", + Assertions.assertEquals("vecxgodebfqkk", model.renewProperties().purchaseProperties().appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("uofqwe", + Assertions.assertEquals("mpukgriw", model.renewProperties().purchaseProperties().appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("hmenevfyexfwhybc", + Assertions.assertEquals("zlfbxzpuzycispnq", model.renewProperties().purchaseProperties().appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renewProperties().purchaseProperties().renew()); - Assertions.assertEquals(InstanceFlexibility.ON, + Assertions.assertTrue(model.renewProperties().purchaseProperties().renew()); + Assertions.assertEquals(InstanceFlexibility.OFF, model.renewProperties().purchaseProperties().reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-10T22:53:58Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T05:08:15Z"), model.renewProperties().purchaseProperties().reviewDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-31T22:16:40Z"), model.reviewDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-05T07:41:31Z"), model.reviewDateTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PatchModel model = new PatchModel().withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList("xaqwoochcbonqv")) - .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("lrxnjeaseiphe") - .withManagementGroupId("lokeyy") - .withSubscriptionId("nj") - .withResourceGroupId("lwtgrhpdj") - .withDisplayName("umasxazjpq")) - .withInstanceFlexibility(InstanceFlexibility.ON) - .withName("alhbx") - .withRenew(false) + PatchModel model = new PatchModel().withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP) + .withAppliedScopes(Arrays.asList("lyaxuc", "nuqszfkbey", "ewrmjmwvvjektc")) + .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("nhwlrsffrzpwvl") + .withManagementGroupId("q") + .withSubscriptionId("iqylihkaetck") + .withResourceGroupId("fcivfsnkym") + .withDisplayName("tqhjfbebrjcx")) + .withInstanceFlexibility(InstanceFlexibility.OFF) + .withName("wutttxfvjrbi") + .withRenew(true) .withRenewProperties(new PatchPropertiesRenewProperties() - .withPurchaseProperties(new PurchaseRequest().withSku(new SkuName().withName("v")) - .withLocation("dgwdslfhot") - .withReservedResourceType(ReservedResourceType.SUSE_LINUX) - .withBillingScopeId("pwlbjnpg") - .withTerm(ReservationTerm.P5Y) + .withPurchaseProperties(new PurchaseRequest().withSku(new SkuName().withName("yva")) + .withLocation("nljky") + .withReservedResourceType(ReservedResourceType.APP_SERVICE) + .withBillingScopeId("ujqgidok") + .withTerm(ReservationTerm.P3Y) .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withQuantity(587661863) - .withDisplayName("xnltyfsoppu") - .withAppliedScopeType(AppliedScopeType.SINGLE) - .withAppliedScopes(Arrays.asList("zwdejbavor", "zdmohctbqvu")) - .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("dndnvow") - .withManagementGroupId("jjugwdkcglhslaz") - .withSubscriptionId("yggdtjixh") - .withResourceGroupId("uofqwe") - .withDisplayName("hmenevfyexfwhybc")) - .withRenew(false) + .withQuantity(1125977089) + .withDisplayName("vcltbgsncgh") + .withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP) + .withAppliedScopes(Arrays.asList("zhbijhtxfv")) + .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("fsm") + .withManagementGroupId("eh") + .withSubscriptionId("vecxgodebfqkk") + .withResourceGroupId("mpukgriw") + .withDisplayName("zlfbxzpuzycispnq")) + .withRenew(true) .withReservedResourceProperties(new PurchaseRequestPropertiesReservedResourceProperties() - .withInstanceFlexibility(InstanceFlexibility.ON)) - .withReviewDateTime(OffsetDateTime.parse("2021-12-10T22:53:58Z")))) - .withReviewDateTime(OffsetDateTime.parse("2020-12-31T22:16:40Z")); + .withInstanceFlexibility(InstanceFlexibility.OFF)) + .withReviewDateTime(OffsetDateTime.parse("2021-02-20T05:08:15Z")))) + .withReviewDateTime(OffsetDateTime.parse("2021-02-05T07:41:31Z")); model = BinaryData.fromObject(model).toObject(PatchModel.class); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("xaqwoochcbonqv", model.appliedScopes().get(0)); - Assertions.assertEquals("lrxnjeaseiphe", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("lokeyy", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("nj", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("lwtgrhpdj", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("umasxazjpq", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(InstanceFlexibility.ON, model.instanceFlexibility()); - Assertions.assertEquals("alhbx", model.name()); - Assertions.assertEquals(false, model.renew()); - Assertions.assertEquals("v", model.renewProperties().purchaseProperties().sku().name()); - Assertions.assertEquals("dgwdslfhot", model.renewProperties().purchaseProperties().location()); - Assertions.assertEquals(ReservedResourceType.SUSE_LINUX, + Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); + Assertions.assertEquals("lyaxuc", model.appliedScopes().get(0)); + Assertions.assertEquals("nhwlrsffrzpwvl", model.appliedScopeProperties().tenantId()); + Assertions.assertEquals("q", model.appliedScopeProperties().managementGroupId()); + Assertions.assertEquals("iqylihkaetck", model.appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("fcivfsnkym", model.appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("tqhjfbebrjcx", model.appliedScopeProperties().displayName()); + Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); + Assertions.assertEquals("wutttxfvjrbi", model.name()); + Assertions.assertTrue(model.renew()); + Assertions.assertEquals("yva", model.renewProperties().purchaseProperties().sku().name()); + Assertions.assertEquals("nljky", model.renewProperties().purchaseProperties().location()); + Assertions.assertEquals(ReservedResourceType.APP_SERVICE, model.renewProperties().purchaseProperties().reservedResourceType()); - Assertions.assertEquals("pwlbjnpg", model.renewProperties().purchaseProperties().billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.renewProperties().purchaseProperties().term()); + Assertions.assertEquals("ujqgidok", model.renewProperties().purchaseProperties().billingScopeId()); + Assertions.assertEquals(ReservationTerm.P3Y, model.renewProperties().purchaseProperties().term()); Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.renewProperties().purchaseProperties().billingPlan()); - Assertions.assertEquals(587661863, model.renewProperties().purchaseProperties().quantity()); - Assertions.assertEquals("xnltyfsoppu", model.renewProperties().purchaseProperties().displayName()); - Assertions.assertEquals(AppliedScopeType.SINGLE, + Assertions.assertEquals(1125977089, model.renewProperties().purchaseProperties().quantity()); + Assertions.assertEquals("vcltbgsncgh", model.renewProperties().purchaseProperties().displayName()); + Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.renewProperties().purchaseProperties().appliedScopeType()); - Assertions.assertEquals("zwdejbavor", model.renewProperties().purchaseProperties().appliedScopes().get(0)); - Assertions.assertEquals("dndnvow", + Assertions.assertEquals("zhbijhtxfv", model.renewProperties().purchaseProperties().appliedScopes().get(0)); + Assertions.assertEquals("fsm", model.renewProperties().purchaseProperties().appliedScopeProperties().tenantId()); - Assertions.assertEquals("jjugwdkcglhslaz", + Assertions.assertEquals("eh", model.renewProperties().purchaseProperties().appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("yggdtjixh", + Assertions.assertEquals("vecxgodebfqkk", model.renewProperties().purchaseProperties().appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("uofqwe", + Assertions.assertEquals("mpukgriw", model.renewProperties().purchaseProperties().appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("hmenevfyexfwhybc", + Assertions.assertEquals("zlfbxzpuzycispnq", model.renewProperties().purchaseProperties().appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renewProperties().purchaseProperties().renew()); - Assertions.assertEquals(InstanceFlexibility.ON, + Assertions.assertTrue(model.renewProperties().purchaseProperties().renew()); + Assertions.assertEquals(InstanceFlexibility.OFF, model.renewProperties().purchaseProperties().reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-10T22:53:58Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T05:08:15Z"), model.renewProperties().purchaseProperties().reviewDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-31T22:16:40Z"), model.reviewDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-05T07:41:31Z"), model.reviewDateTime()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesRenewPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesRenewPropertiesTests.java index 0900a13daa06..6e3a2547526f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesRenewPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesRenewPropertiesTests.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.reservations.generated; @@ -23,76 +23,74 @@ public final class PatchPropertiesRenewPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PatchPropertiesRenewProperties model = BinaryData.fromString( - "{\"purchaseProperties\":{\"sku\":{\"name\":\"uxh\"},\"location\":\"udxorrqn\",\"properties\":{\"reservedResourceType\":\"MySql\",\"billingScopeId\":\"vyifqrvkdvjsl\",\"term\":\"P5Y\",\"billingPlan\":\"Monthly\",\"quantity\":146352395,\"displayName\":\"atkpnp\",\"appliedScopeType\":\"Shared\",\"appliedScopes\":[\"bczw\",\"ruwiqzbqjvsov\",\"yokacspkw\"],\"appliedScopeProperties\":{\"tenantId\":\"dobpxjmflbvvn\",\"managementGroupId\":\"rkcciwwzjuqk\",\"subscriptionId\":\"sa\",\"resourceGroupId\":\"wkuofoskghsauu\",\"displayName\":\"jmvxie\"},\"renew\":false,\"reservedResourceProperties\":{\"instanceFlexibility\":\"Off\"},\"reviewDateTime\":\"2021-02-15T23:42:02Z\"}}}") + "{\"purchaseProperties\":{\"sku\":{\"name\":\"wz\"},\"location\":\"dbpgnxytxhp\",\"properties\":{\"reservedResourceType\":\"SqlDatabases\",\"billingScopeId\":\"fzab\",\"term\":\"P3Y\",\"billingPlan\":\"Upfront\",\"quantity\":1848229806,\"displayName\":\"ctyqik\",\"appliedScopeType\":\"Single\",\"appliedScopes\":[\"plwzbhvgyugu\",\"svmkfssxquk\"],\"appliedScopeProperties\":{\"tenantId\":\"l\",\"managementGroupId\":\"gsxnkjzkdeslpv\",\"subscriptionId\":\"pwiyig\",\"resourceGroupId\":\"pkdwzbai\",\"displayName\":\"bbaumnyquped\"},\"renew\":false,\"reservedResourceProperties\":{\"instanceFlexibility\":\"Off\"},\"reviewDateTime\":\"2021-01-27T09:46:32Z\"}}}") .toObject(PatchPropertiesRenewProperties.class); - Assertions.assertEquals("uxh", model.purchaseProperties().sku().name()); - Assertions.assertEquals("udxorrqn", model.purchaseProperties().location()); - Assertions.assertEquals(ReservedResourceType.MY_SQL, model.purchaseProperties().reservedResourceType()); - Assertions.assertEquals("vyifqrvkdvjsl", model.purchaseProperties().billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.purchaseProperties().term()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.purchaseProperties().billingPlan()); - Assertions.assertEquals(146352395, model.purchaseProperties().quantity()); - Assertions.assertEquals("atkpnp", model.purchaseProperties().displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.purchaseProperties().appliedScopeType()); - Assertions.assertEquals("bczw", model.purchaseProperties().appliedScopes().get(0)); - Assertions.assertEquals("dobpxjmflbvvn", model.purchaseProperties().appliedScopeProperties().tenantId()); - Assertions.assertEquals("rkcciwwzjuqk", + Assertions.assertEquals("wz", model.purchaseProperties().sku().name()); + Assertions.assertEquals("dbpgnxytxhp", model.purchaseProperties().location()); + Assertions.assertEquals(ReservedResourceType.SQL_DATABASES, model.purchaseProperties().reservedResourceType()); + Assertions.assertEquals("fzab", model.purchaseProperties().billingScopeId()); + Assertions.assertEquals(ReservationTerm.P3Y, model.purchaseProperties().term()); + Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.purchaseProperties().billingPlan()); + Assertions.assertEquals(1848229806, model.purchaseProperties().quantity()); + Assertions.assertEquals("ctyqik", model.purchaseProperties().displayName()); + Assertions.assertEquals(AppliedScopeType.SINGLE, model.purchaseProperties().appliedScopeType()); + Assertions.assertEquals("plwzbhvgyugu", model.purchaseProperties().appliedScopes().get(0)); + Assertions.assertEquals("l", model.purchaseProperties().appliedScopeProperties().tenantId()); + Assertions.assertEquals("gsxnkjzkdeslpv", model.purchaseProperties().appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("sa", model.purchaseProperties().appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("wkuofoskghsauu", - model.purchaseProperties().appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("jmvxie", model.purchaseProperties().appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.purchaseProperties().renew()); + Assertions.assertEquals("pwiyig", model.purchaseProperties().appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("pkdwzbai", model.purchaseProperties().appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("bbaumnyquped", model.purchaseProperties().appliedScopeProperties().displayName()); + Assertions.assertFalse(model.purchaseProperties().renew()); Assertions.assertEquals(InstanceFlexibility.OFF, model.purchaseProperties().reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T23:42:02Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-01-27T09:46:32Z"), model.purchaseProperties().reviewDateTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PatchPropertiesRenewProperties model = new PatchPropertiesRenewProperties() - .withPurchaseProperties(new PurchaseRequest().withSku(new SkuName().withName("uxh")) - .withLocation("udxorrqn") - .withReservedResourceType(ReservedResourceType.MY_SQL) - .withBillingScopeId("vyifqrvkdvjsl") - .withTerm(ReservationTerm.P5Y) - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withQuantity(146352395) - .withDisplayName("atkpnp") - .withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList("bczw", "ruwiqzbqjvsov", "yokacspkw")) - .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("dobpxjmflbvvn") - .withManagementGroupId("rkcciwwzjuqk") - .withSubscriptionId("sa") - .withResourceGroupId("wkuofoskghsauu") - .withDisplayName("jmvxie")) + .withPurchaseProperties(new PurchaseRequest().withSku(new SkuName().withName("wz")) + .withLocation("dbpgnxytxhp") + .withReservedResourceType(ReservedResourceType.SQL_DATABASES) + .withBillingScopeId("fzab") + .withTerm(ReservationTerm.P3Y) + .withBillingPlan(ReservationBillingPlan.UPFRONT) + .withQuantity(1848229806) + .withDisplayName("ctyqik") + .withAppliedScopeType(AppliedScopeType.SINGLE) + .withAppliedScopes(Arrays.asList("plwzbhvgyugu", "svmkfssxquk")) + .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("l") + .withManagementGroupId("gsxnkjzkdeslpv") + .withSubscriptionId("pwiyig") + .withResourceGroupId("pkdwzbai") + .withDisplayName("bbaumnyquped")) .withRenew(false) .withReservedResourceProperties(new PurchaseRequestPropertiesReservedResourceProperties() .withInstanceFlexibility(InstanceFlexibility.OFF)) - .withReviewDateTime(OffsetDateTime.parse("2021-02-15T23:42:02Z"))); + .withReviewDateTime(OffsetDateTime.parse("2021-01-27T09:46:32Z"))); model = BinaryData.fromObject(model).toObject(PatchPropertiesRenewProperties.class); - Assertions.assertEquals("uxh", model.purchaseProperties().sku().name()); - Assertions.assertEquals("udxorrqn", model.purchaseProperties().location()); - Assertions.assertEquals(ReservedResourceType.MY_SQL, model.purchaseProperties().reservedResourceType()); - Assertions.assertEquals("vyifqrvkdvjsl", model.purchaseProperties().billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.purchaseProperties().term()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.purchaseProperties().billingPlan()); - Assertions.assertEquals(146352395, model.purchaseProperties().quantity()); - Assertions.assertEquals("atkpnp", model.purchaseProperties().displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.purchaseProperties().appliedScopeType()); - Assertions.assertEquals("bczw", model.purchaseProperties().appliedScopes().get(0)); - Assertions.assertEquals("dobpxjmflbvvn", model.purchaseProperties().appliedScopeProperties().tenantId()); - Assertions.assertEquals("rkcciwwzjuqk", + Assertions.assertEquals("wz", model.purchaseProperties().sku().name()); + Assertions.assertEquals("dbpgnxytxhp", model.purchaseProperties().location()); + Assertions.assertEquals(ReservedResourceType.SQL_DATABASES, model.purchaseProperties().reservedResourceType()); + Assertions.assertEquals("fzab", model.purchaseProperties().billingScopeId()); + Assertions.assertEquals(ReservationTerm.P3Y, model.purchaseProperties().term()); + Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.purchaseProperties().billingPlan()); + Assertions.assertEquals(1848229806, model.purchaseProperties().quantity()); + Assertions.assertEquals("ctyqik", model.purchaseProperties().displayName()); + Assertions.assertEquals(AppliedScopeType.SINGLE, model.purchaseProperties().appliedScopeType()); + Assertions.assertEquals("plwzbhvgyugu", model.purchaseProperties().appliedScopes().get(0)); + Assertions.assertEquals("l", model.purchaseProperties().appliedScopeProperties().tenantId()); + Assertions.assertEquals("gsxnkjzkdeslpv", model.purchaseProperties().appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("sa", model.purchaseProperties().appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("wkuofoskghsauu", - model.purchaseProperties().appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("jmvxie", model.purchaseProperties().appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.purchaseProperties().renew()); + Assertions.assertEquals("pwiyig", model.purchaseProperties().appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("pkdwzbai", model.purchaseProperties().appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("bbaumnyquped", model.purchaseProperties().appliedScopeProperties().displayName()); + Assertions.assertFalse(model.purchaseProperties().renew()); Assertions.assertEquals(InstanceFlexibility.OFF, model.purchaseProperties().reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T23:42:02Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-01-27T09:46:32Z"), model.purchaseProperties().reviewDateTime()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesTests.java index ab66582597a5..a62718ebd64d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PatchPropertiesTests.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.reservations.generated; @@ -24,123 +24,121 @@ public final class PatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PatchProperties model = BinaryData.fromString( - "{\"appliedScopeType\":\"Shared\",\"appliedScopes\":[\"amdecte\",\"f\"],\"appliedScopeProperties\":{\"tenantId\":\"cj\",\"managementGroupId\":\"pvhez\",\"subscriptionId\":\"gqhcjrefovg\",\"resourceGroupId\":\"qsl\",\"displayName\":\"yvxyqjp\"},\"instanceFlexibility\":\"Off\",\"name\":\"tpngjcrcczsqpjh\",\"renew\":false,\"renewProperties\":{\"purchaseProperties\":{\"sku\":{\"name\":\"ysou\"},\"location\":\"e\",\"properties\":{\"reservedResourceType\":\"AzureDataExplorer\",\"billingScopeId\":\"eupfhyhltrpm\",\"term\":\"P5Y\",\"billingPlan\":\"Upfront\",\"quantity\":684041749,\"displayName\":\"u\",\"appliedScopeType\":\"Single\",\"appliedScopes\":[\"uiuaodsfcpkvxodp\"],\"appliedScopeProperties\":{\"tenantId\":\"myzydagfuaxbez\",\"managementGroupId\":\"uokktwhrdxwz\",\"subscriptionId\":\"q\",\"resourceGroupId\":\"bsureximo\",\"displayName\":\"ocfs\"},\"renew\":false,\"reservedResourceProperties\":{\"instanceFlexibility\":\"Off\"},\"reviewDateTime\":\"2021-01-31T18:49:05Z\"}}},\"reviewDateTime\":\"2021-10-14T00:14:42Z\"}") + "{\"appliedScopeType\":\"ManagementGroup\",\"appliedScopes\":[\"bnuqqkpik\",\"drgvtqagn\",\"uynhijg\"],\"appliedScopeProperties\":{\"tenantId\":\"bfs\",\"managementGroupId\":\"rbu\",\"subscriptionId\":\"cvpnazzmhjrunmpx\",\"resourceGroupId\":\"dbhrbnlankxm\",\"displayName\":\"k\"},\"instanceFlexibility\":\"Off\",\"name\":\"nbtkcxywnytnr\",\"renew\":true,\"renewProperties\":{\"purchaseProperties\":{\"sku\":{\"name\":\"ybyxc\"},\"location\":\"clha\",\"properties\":{\"reservedResourceType\":\"CosmosDb\",\"billingScopeId\":\"b\",\"term\":\"P1Y\",\"billingPlan\":\"Monthly\",\"quantity\":2142840160,\"displayName\":\"ktsthsucocmny\",\"appliedScopeType\":\"Single\",\"appliedScopes\":[\"bt\"],\"appliedScopeProperties\":{\"tenantId\":\"qpuedckzywbiex\",\"managementGroupId\":\"eyueaxibxujwb\",\"subscriptionId\":\"walm\",\"resourceGroupId\":\"yoxa\",\"displayName\":\"dkzjancuxrh\"},\"renew\":true,\"reservedResourceProperties\":{\"instanceFlexibility\":\"On\"},\"reviewDateTime\":\"2021-09-04T15:02:23Z\"}}},\"reviewDateTime\":\"2021-05-15T09:34:46Z\"}") .toObject(PatchProperties.class); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("amdecte", model.appliedScopes().get(0)); - Assertions.assertEquals("cj", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("pvhez", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("gqhcjrefovg", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("qsl", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("yvxyqjp", model.appliedScopeProperties().displayName()); + Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); + Assertions.assertEquals("bnuqqkpik", model.appliedScopes().get(0)); + Assertions.assertEquals("bfs", model.appliedScopeProperties().tenantId()); + Assertions.assertEquals("rbu", model.appliedScopeProperties().managementGroupId()); + Assertions.assertEquals("cvpnazzmhjrunmpx", model.appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("dbhrbnlankxm", model.appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("k", model.appliedScopeProperties().displayName()); Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); - Assertions.assertEquals("tpngjcrcczsqpjh", model.name()); - Assertions.assertEquals(false, model.renew()); - Assertions.assertEquals("ysou", model.renewProperties().purchaseProperties().sku().name()); - Assertions.assertEquals("e", model.renewProperties().purchaseProperties().location()); - Assertions.assertEquals(ReservedResourceType.AZURE_DATA_EXPLORER, + Assertions.assertEquals("nbtkcxywnytnr", model.name()); + Assertions.assertTrue(model.renew()); + Assertions.assertEquals("ybyxc", model.renewProperties().purchaseProperties().sku().name()); + Assertions.assertEquals("clha", model.renewProperties().purchaseProperties().location()); + Assertions.assertEquals(ReservedResourceType.COSMOS_DB, model.renewProperties().purchaseProperties().reservedResourceType()); - Assertions.assertEquals("eupfhyhltrpm", model.renewProperties().purchaseProperties().billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.renewProperties().purchaseProperties().term()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, + Assertions.assertEquals("b", model.renewProperties().purchaseProperties().billingScopeId()); + Assertions.assertEquals(ReservationTerm.P1Y, model.renewProperties().purchaseProperties().term()); + Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.renewProperties().purchaseProperties().billingPlan()); - Assertions.assertEquals(684041749, model.renewProperties().purchaseProperties().quantity()); - Assertions.assertEquals("u", model.renewProperties().purchaseProperties().displayName()); + Assertions.assertEquals(2142840160, model.renewProperties().purchaseProperties().quantity()); + Assertions.assertEquals("ktsthsucocmny", model.renewProperties().purchaseProperties().displayName()); Assertions.assertEquals(AppliedScopeType.SINGLE, model.renewProperties().purchaseProperties().appliedScopeType()); - Assertions.assertEquals("uiuaodsfcpkvxodp", - model.renewProperties().purchaseProperties().appliedScopes().get(0)); - Assertions.assertEquals("myzydagfuaxbez", + Assertions.assertEquals("bt", model.renewProperties().purchaseProperties().appliedScopes().get(0)); + Assertions.assertEquals("qpuedckzywbiex", model.renewProperties().purchaseProperties().appliedScopeProperties().tenantId()); - Assertions.assertEquals("uokktwhrdxwz", + Assertions.assertEquals("eyueaxibxujwb", model.renewProperties().purchaseProperties().appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("q", + Assertions.assertEquals("walm", model.renewProperties().purchaseProperties().appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("bsureximo", + Assertions.assertEquals("yoxa", model.renewProperties().purchaseProperties().appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("ocfs", + Assertions.assertEquals("dkzjancuxrh", model.renewProperties().purchaseProperties().appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renewProperties().purchaseProperties().renew()); - Assertions.assertEquals(InstanceFlexibility.OFF, + Assertions.assertTrue(model.renewProperties().purchaseProperties().renew()); + Assertions.assertEquals(InstanceFlexibility.ON, model.renewProperties().purchaseProperties().reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T18:49:05Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-04T15:02:23Z"), model.renewProperties().purchaseProperties().reviewDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-14T00:14:42Z"), model.reviewDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T09:34:46Z"), model.reviewDateTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PatchProperties model = new PatchProperties().withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList("amdecte", "f")) - .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("cj") - .withManagementGroupId("pvhez") - .withSubscriptionId("gqhcjrefovg") - .withResourceGroupId("qsl") - .withDisplayName("yvxyqjp")) + PatchProperties model = new PatchProperties().withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP) + .withAppliedScopes(Arrays.asList("bnuqqkpik", "drgvtqagn", "uynhijg")) + .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("bfs") + .withManagementGroupId("rbu") + .withSubscriptionId("cvpnazzmhjrunmpx") + .withResourceGroupId("dbhrbnlankxm") + .withDisplayName("k")) .withInstanceFlexibility(InstanceFlexibility.OFF) - .withName("tpngjcrcczsqpjh") - .withRenew(false) + .withName("nbtkcxywnytnr") + .withRenew(true) .withRenewProperties(new PatchPropertiesRenewProperties() - .withPurchaseProperties(new PurchaseRequest().withSku(new SkuName().withName("ysou")) - .withLocation("e") - .withReservedResourceType(ReservedResourceType.AZURE_DATA_EXPLORER) - .withBillingScopeId("eupfhyhltrpm") - .withTerm(ReservationTerm.P5Y) - .withBillingPlan(ReservationBillingPlan.UPFRONT) - .withQuantity(684041749) - .withDisplayName("u") + .withPurchaseProperties(new PurchaseRequest().withSku(new SkuName().withName("ybyxc")) + .withLocation("clha") + .withReservedResourceType(ReservedResourceType.COSMOS_DB) + .withBillingScopeId("b") + .withTerm(ReservationTerm.P1Y) + .withBillingPlan(ReservationBillingPlan.MONTHLY) + .withQuantity(2142840160) + .withDisplayName("ktsthsucocmny") .withAppliedScopeType(AppliedScopeType.SINGLE) - .withAppliedScopes(Arrays.asList("uiuaodsfcpkvxodp")) - .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("myzydagfuaxbez") - .withManagementGroupId("uokktwhrdxwz") - .withSubscriptionId("q") - .withResourceGroupId("bsureximo") - .withDisplayName("ocfs")) - .withRenew(false) + .withAppliedScopes(Arrays.asList("bt")) + .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("qpuedckzywbiex") + .withManagementGroupId("eyueaxibxujwb") + .withSubscriptionId("walm") + .withResourceGroupId("yoxa") + .withDisplayName("dkzjancuxrh")) + .withRenew(true) .withReservedResourceProperties(new PurchaseRequestPropertiesReservedResourceProperties() - .withInstanceFlexibility(InstanceFlexibility.OFF)) - .withReviewDateTime(OffsetDateTime.parse("2021-01-31T18:49:05Z")))) - .withReviewDateTime(OffsetDateTime.parse("2021-10-14T00:14:42Z")); + .withInstanceFlexibility(InstanceFlexibility.ON)) + .withReviewDateTime(OffsetDateTime.parse("2021-09-04T15:02:23Z")))) + .withReviewDateTime(OffsetDateTime.parse("2021-05-15T09:34:46Z")); model = BinaryData.fromObject(model).toObject(PatchProperties.class); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("amdecte", model.appliedScopes().get(0)); - Assertions.assertEquals("cj", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("pvhez", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("gqhcjrefovg", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("qsl", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("yvxyqjp", model.appliedScopeProperties().displayName()); + Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); + Assertions.assertEquals("bnuqqkpik", model.appliedScopes().get(0)); + Assertions.assertEquals("bfs", model.appliedScopeProperties().tenantId()); + Assertions.assertEquals("rbu", model.appliedScopeProperties().managementGroupId()); + Assertions.assertEquals("cvpnazzmhjrunmpx", model.appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("dbhrbnlankxm", model.appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("k", model.appliedScopeProperties().displayName()); Assertions.assertEquals(InstanceFlexibility.OFF, model.instanceFlexibility()); - Assertions.assertEquals("tpngjcrcczsqpjh", model.name()); - Assertions.assertEquals(false, model.renew()); - Assertions.assertEquals("ysou", model.renewProperties().purchaseProperties().sku().name()); - Assertions.assertEquals("e", model.renewProperties().purchaseProperties().location()); - Assertions.assertEquals(ReservedResourceType.AZURE_DATA_EXPLORER, + Assertions.assertEquals("nbtkcxywnytnr", model.name()); + Assertions.assertTrue(model.renew()); + Assertions.assertEquals("ybyxc", model.renewProperties().purchaseProperties().sku().name()); + Assertions.assertEquals("clha", model.renewProperties().purchaseProperties().location()); + Assertions.assertEquals(ReservedResourceType.COSMOS_DB, model.renewProperties().purchaseProperties().reservedResourceType()); - Assertions.assertEquals("eupfhyhltrpm", model.renewProperties().purchaseProperties().billingScopeId()); - Assertions.assertEquals(ReservationTerm.P5Y, model.renewProperties().purchaseProperties().term()); - Assertions.assertEquals(ReservationBillingPlan.UPFRONT, + Assertions.assertEquals("b", model.renewProperties().purchaseProperties().billingScopeId()); + Assertions.assertEquals(ReservationTerm.P1Y, model.renewProperties().purchaseProperties().term()); + Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.renewProperties().purchaseProperties().billingPlan()); - Assertions.assertEquals(684041749, model.renewProperties().purchaseProperties().quantity()); - Assertions.assertEquals("u", model.renewProperties().purchaseProperties().displayName()); + Assertions.assertEquals(2142840160, model.renewProperties().purchaseProperties().quantity()); + Assertions.assertEquals("ktsthsucocmny", model.renewProperties().purchaseProperties().displayName()); Assertions.assertEquals(AppliedScopeType.SINGLE, model.renewProperties().purchaseProperties().appliedScopeType()); - Assertions.assertEquals("uiuaodsfcpkvxodp", - model.renewProperties().purchaseProperties().appliedScopes().get(0)); - Assertions.assertEquals("myzydagfuaxbez", + Assertions.assertEquals("bt", model.renewProperties().purchaseProperties().appliedScopes().get(0)); + Assertions.assertEquals("qpuedckzywbiex", model.renewProperties().purchaseProperties().appliedScopeProperties().tenantId()); - Assertions.assertEquals("uokktwhrdxwz", + Assertions.assertEquals("eyueaxibxujwb", model.renewProperties().purchaseProperties().appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("q", + Assertions.assertEquals("walm", model.renewProperties().purchaseProperties().appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("bsureximo", + Assertions.assertEquals("yoxa", model.renewProperties().purchaseProperties().appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("ocfs", + Assertions.assertEquals("dkzjancuxrh", model.renewProperties().purchaseProperties().appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renewProperties().purchaseProperties().renew()); - Assertions.assertEquals(InstanceFlexibility.OFF, + Assertions.assertTrue(model.renewProperties().purchaseProperties().renew()); + Assertions.assertEquals(InstanceFlexibility.ON, model.renewProperties().purchaseProperties().reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T18:49:05Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-04T15:02:23Z"), model.renewProperties().purchaseProperties().reviewDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-14T00:14:42Z"), model.reviewDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T09:34:46Z"), model.reviewDateTime()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesReservedResourcePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesReservedResourcePropertiesTests.java index cbb5df7821fe..3a7f7186fb2b 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesReservedResourcePropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesReservedResourcePropertiesTests.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.reservations.generated; diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesTests.java index 9699400e921f..1fec2b25dcc1 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestPropertiesTests.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.reservations.generated; @@ -21,62 +21,62 @@ public final class PurchaseRequestPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PurchaseRequestProperties model = BinaryData.fromString( - "{\"reservedResourceType\":\"SqlDataWarehouse\",\"billingScopeId\":\"e\",\"term\":\"P5Y\",\"billingPlan\":\"Monthly\",\"quantity\":915193606,\"displayName\":\"v\",\"appliedScopeType\":\"Single\",\"appliedScopes\":[\"ulngsntn\",\"ybkzgcwr\",\"clxxwrljdo\",\"skcqvkocrcjd\"],\"appliedScopeProperties\":{\"tenantId\":\"nh\",\"managementGroupId\":\"njbiksqrglssain\",\"subscriptionId\":\"jwnzlljfmp\",\"resourceGroupId\":\"ebvmgxsabkyqd\",\"displayName\":\"jitcjczdzevn\"},\"renew\":false,\"reservedResourceProperties\":{\"instanceFlexibility\":\"On\"},\"reviewDateTime\":\"2021-04-18T17:34:07Z\"}") + "{\"reservedResourceType\":\"AppService\",\"billingScopeId\":\"jnspydp\",\"term\":\"P5Y\",\"billingPlan\":\"Upfront\",\"quantity\":368872056,\"displayName\":\"knvudwtiukb\",\"appliedScopeType\":\"Single\",\"appliedScopes\":[\"pocipazyxoegu\"],\"appliedScopeProperties\":{\"tenantId\":\"npiucgygevqznty\",\"managementGroupId\":\"rbpizc\",\"subscriptionId\":\"qjsdpydnfyhxdeo\",\"resourceGroupId\":\"zi\",\"displayName\":\"ifsjttgzfbishcb\"},\"renew\":true,\"reservedResourceProperties\":{\"instanceFlexibility\":\"On\"},\"reviewDateTime\":\"2020-12-31T23:44:32Z\"}") .toObject(PurchaseRequestProperties.class); - Assertions.assertEquals(ReservedResourceType.SQL_DATA_WAREHOUSE, model.reservedResourceType()); - Assertions.assertEquals("e", model.billingScopeId()); + Assertions.assertEquals(ReservedResourceType.APP_SERVICE, model.reservedResourceType()); + Assertions.assertEquals("jnspydp", model.billingScopeId()); Assertions.assertEquals(ReservationTerm.P5Y, model.term()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.billingPlan()); - Assertions.assertEquals(915193606, model.quantity()); - Assertions.assertEquals("v", model.displayName()); + Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.billingPlan()); + Assertions.assertEquals(368872056, model.quantity()); + Assertions.assertEquals("knvudwtiukb", model.displayName()); Assertions.assertEquals(AppliedScopeType.SINGLE, model.appliedScopeType()); - Assertions.assertEquals("ulngsntn", model.appliedScopes().get(0)); - Assertions.assertEquals("nh", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("njbiksqrglssain", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("jwnzlljfmp", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("ebvmgxsabkyqd", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("jitcjczdzevn", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renew()); + Assertions.assertEquals("pocipazyxoegu", model.appliedScopes().get(0)); + Assertions.assertEquals("npiucgygevqznty", model.appliedScopeProperties().tenantId()); + Assertions.assertEquals("rbpizc", model.appliedScopeProperties().managementGroupId()); + Assertions.assertEquals("qjsdpydnfyhxdeo", model.appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("zi", model.appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("ifsjttgzfbishcb", model.appliedScopeProperties().displayName()); + Assertions.assertTrue(model.renew()); Assertions.assertEquals(InstanceFlexibility.ON, model.reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T17:34:07Z"), model.reviewDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-31T23:44:32Z"), model.reviewDateTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PurchaseRequestProperties model - = new PurchaseRequestProperties().withReservedResourceType(ReservedResourceType.SQL_DATA_WAREHOUSE) - .withBillingScopeId("e") + = new PurchaseRequestProperties().withReservedResourceType(ReservedResourceType.APP_SERVICE) + .withBillingScopeId("jnspydp") .withTerm(ReservationTerm.P5Y) - .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withQuantity(915193606) - .withDisplayName("v") + .withBillingPlan(ReservationBillingPlan.UPFRONT) + .withQuantity(368872056) + .withDisplayName("knvudwtiukb") .withAppliedScopeType(AppliedScopeType.SINGLE) - .withAppliedScopes(Arrays.asList("ulngsntn", "ybkzgcwr", "clxxwrljdo", "skcqvkocrcjd")) - .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("nh") - .withManagementGroupId("njbiksqrglssain") - .withSubscriptionId("jwnzlljfmp") - .withResourceGroupId("ebvmgxsabkyqd") - .withDisplayName("jitcjczdzevn")) - .withRenew(false) + .withAppliedScopes(Arrays.asList("pocipazyxoegu")) + .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("npiucgygevqznty") + .withManagementGroupId("rbpizc") + .withSubscriptionId("qjsdpydnfyhxdeo") + .withResourceGroupId("zi") + .withDisplayName("ifsjttgzfbishcb")) + .withRenew(true) .withReservedResourceProperties(new PurchaseRequestPropertiesReservedResourceProperties() .withInstanceFlexibility(InstanceFlexibility.ON)) - .withReviewDateTime(OffsetDateTime.parse("2021-04-18T17:34:07Z")); + .withReviewDateTime(OffsetDateTime.parse("2020-12-31T23:44:32Z")); model = BinaryData.fromObject(model).toObject(PurchaseRequestProperties.class); - Assertions.assertEquals(ReservedResourceType.SQL_DATA_WAREHOUSE, model.reservedResourceType()); - Assertions.assertEquals("e", model.billingScopeId()); + Assertions.assertEquals(ReservedResourceType.APP_SERVICE, model.reservedResourceType()); + Assertions.assertEquals("jnspydp", model.billingScopeId()); Assertions.assertEquals(ReservationTerm.P5Y, model.term()); - Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.billingPlan()); - Assertions.assertEquals(915193606, model.quantity()); - Assertions.assertEquals("v", model.displayName()); + Assertions.assertEquals(ReservationBillingPlan.UPFRONT, model.billingPlan()); + Assertions.assertEquals(368872056, model.quantity()); + Assertions.assertEquals("knvudwtiukb", model.displayName()); Assertions.assertEquals(AppliedScopeType.SINGLE, model.appliedScopeType()); - Assertions.assertEquals("ulngsntn", model.appliedScopes().get(0)); - Assertions.assertEquals("nh", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("njbiksqrglssain", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("jwnzlljfmp", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("ebvmgxsabkyqd", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("jitcjczdzevn", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renew()); + Assertions.assertEquals("pocipazyxoegu", model.appliedScopes().get(0)); + Assertions.assertEquals("npiucgygevqznty", model.appliedScopeProperties().tenantId()); + Assertions.assertEquals("rbpizc", model.appliedScopeProperties().managementGroupId()); + Assertions.assertEquals("qjsdpydnfyhxdeo", model.appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("zi", model.appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("ifsjttgzfbishcb", model.appliedScopeProperties().displayName()); + Assertions.assertTrue(model.renew()); Assertions.assertEquals(InstanceFlexibility.ON, model.reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T17:34:07Z"), model.reviewDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-31T23:44:32Z"), model.reviewDateTime()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestTests.java index 23a4101ee745..170092b5c70a 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/PurchaseRequestTests.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.reservations.generated; @@ -22,67 +22,67 @@ public final class PurchaseRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PurchaseRequest model = BinaryData.fromString( - "{\"sku\":{\"name\":\"s\"},\"location\":\"zgvfcjrwz\",\"properties\":{\"reservedResourceType\":\"AzureFiles\",\"billingScopeId\":\"felluwfzitonpe\",\"term\":\"P3Y\",\"billingPlan\":\"Monthly\",\"quantity\":2024627015,\"displayName\":\"ofpdvh\",\"appliedScopeType\":\"Shared\",\"appliedScopes\":[\"pini\",\"mayhuybbkpodepoo\"],\"appliedScopeProperties\":{\"tenantId\":\"uvamiheognarxzxt\",\"managementGroupId\":\"o\",\"subscriptionId\":\"si\",\"resourceGroupId\":\"evcciqihnhun\",\"displayName\":\"wjzrnfygxgisp\"},\"renew\":false,\"reservedResourceProperties\":{\"instanceFlexibility\":\"On\"},\"reviewDateTime\":\"2021-09-18T00:19:24Z\"}}") + "{\"sku\":{\"name\":\"sovmyokacspkwl\"},\"location\":\"dobpxjmflbvvn\",\"properties\":{\"reservedResourceType\":\"DedicatedHost\",\"billingScopeId\":\"ciwwzjuqkhr\",\"term\":\"P3Y\",\"billingPlan\":\"Monthly\",\"quantity\":481973669,\"displayName\":\"foskghsauuimj\",\"appliedScopeType\":\"ManagementGroup\",\"appliedScopes\":[\"duugidyjr\",\"f\"],\"appliedScopeProperties\":{\"tenantId\":\"osvexcsonpclhoc\",\"managementGroupId\":\"slkevle\",\"subscriptionId\":\"zfbuhf\",\"resourceGroupId\":\"faxkffeii\",\"displayName\":\"lvmezyvshxmzsbbz\"},\"renew\":false,\"reservedResourceProperties\":{\"instanceFlexibility\":\"On\"},\"reviewDateTime\":\"2021-07-22T08:18:11Z\"}}") .toObject(PurchaseRequest.class); - Assertions.assertEquals("s", model.sku().name()); - Assertions.assertEquals("zgvfcjrwz", model.location()); - Assertions.assertEquals(ReservedResourceType.AZURE_FILES, model.reservedResourceType()); - Assertions.assertEquals("felluwfzitonpe", model.billingScopeId()); + Assertions.assertEquals("sovmyokacspkwl", model.sku().name()); + Assertions.assertEquals("dobpxjmflbvvn", model.location()); + Assertions.assertEquals(ReservedResourceType.DEDICATED_HOST, model.reservedResourceType()); + Assertions.assertEquals("ciwwzjuqkhr", model.billingScopeId()); Assertions.assertEquals(ReservationTerm.P3Y, model.term()); Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.billingPlan()); - Assertions.assertEquals(2024627015, model.quantity()); - Assertions.assertEquals("ofpdvh", model.displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("pini", model.appliedScopes().get(0)); - Assertions.assertEquals("uvamiheognarxzxt", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("o", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("si", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("evcciqihnhun", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("wjzrnfygxgisp", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renew()); + Assertions.assertEquals(481973669, model.quantity()); + Assertions.assertEquals("foskghsauuimj", model.displayName()); + Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); + Assertions.assertEquals("duugidyjr", model.appliedScopes().get(0)); + Assertions.assertEquals("osvexcsonpclhoc", model.appliedScopeProperties().tenantId()); + Assertions.assertEquals("slkevle", model.appliedScopeProperties().managementGroupId()); + Assertions.assertEquals("zfbuhf", model.appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("faxkffeii", model.appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("lvmezyvshxmzsbbz", model.appliedScopeProperties().displayName()); + Assertions.assertFalse(model.renew()); Assertions.assertEquals(InstanceFlexibility.ON, model.reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T00:19:24Z"), model.reviewDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-22T08:18:11Z"), model.reviewDateTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PurchaseRequest model = new PurchaseRequest().withSku(new SkuName().withName("s")) - .withLocation("zgvfcjrwz") - .withReservedResourceType(ReservedResourceType.AZURE_FILES) - .withBillingScopeId("felluwfzitonpe") + PurchaseRequest model = new PurchaseRequest().withSku(new SkuName().withName("sovmyokacspkwl")) + .withLocation("dobpxjmflbvvn") + .withReservedResourceType(ReservedResourceType.DEDICATED_HOST) + .withBillingScopeId("ciwwzjuqkhr") .withTerm(ReservationTerm.P3Y) .withBillingPlan(ReservationBillingPlan.MONTHLY) - .withQuantity(2024627015) - .withDisplayName("ofpdvh") - .withAppliedScopeType(AppliedScopeType.SHARED) - .withAppliedScopes(Arrays.asList("pini", "mayhuybbkpodepoo")) - .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("uvamiheognarxzxt") - .withManagementGroupId("o") - .withSubscriptionId("si") - .withResourceGroupId("evcciqihnhun") - .withDisplayName("wjzrnfygxgisp")) + .withQuantity(481973669) + .withDisplayName("foskghsauuimj") + .withAppliedScopeType(AppliedScopeType.MANAGEMENT_GROUP) + .withAppliedScopes(Arrays.asList("duugidyjr", "f")) + .withAppliedScopeProperties(new AppliedScopeProperties().withTenantId("osvexcsonpclhoc") + .withManagementGroupId("slkevle") + .withSubscriptionId("zfbuhf") + .withResourceGroupId("faxkffeii") + .withDisplayName("lvmezyvshxmzsbbz")) .withRenew(false) .withReservedResourceProperties(new PurchaseRequestPropertiesReservedResourceProperties() .withInstanceFlexibility(InstanceFlexibility.ON)) - .withReviewDateTime(OffsetDateTime.parse("2021-09-18T00:19:24Z")); + .withReviewDateTime(OffsetDateTime.parse("2021-07-22T08:18:11Z")); model = BinaryData.fromObject(model).toObject(PurchaseRequest.class); - Assertions.assertEquals("s", model.sku().name()); - Assertions.assertEquals("zgvfcjrwz", model.location()); - Assertions.assertEquals(ReservedResourceType.AZURE_FILES, model.reservedResourceType()); - Assertions.assertEquals("felluwfzitonpe", model.billingScopeId()); + Assertions.assertEquals("sovmyokacspkwl", model.sku().name()); + Assertions.assertEquals("dobpxjmflbvvn", model.location()); + Assertions.assertEquals(ReservedResourceType.DEDICATED_HOST, model.reservedResourceType()); + Assertions.assertEquals("ciwwzjuqkhr", model.billingScopeId()); Assertions.assertEquals(ReservationTerm.P3Y, model.term()); Assertions.assertEquals(ReservationBillingPlan.MONTHLY, model.billingPlan()); - Assertions.assertEquals(2024627015, model.quantity()); - Assertions.assertEquals("ofpdvh", model.displayName()); - Assertions.assertEquals(AppliedScopeType.SHARED, model.appliedScopeType()); - Assertions.assertEquals("pini", model.appliedScopes().get(0)); - Assertions.assertEquals("uvamiheognarxzxt", model.appliedScopeProperties().tenantId()); - Assertions.assertEquals("o", model.appliedScopeProperties().managementGroupId()); - Assertions.assertEquals("si", model.appliedScopeProperties().subscriptionId()); - Assertions.assertEquals("evcciqihnhun", model.appliedScopeProperties().resourceGroupId()); - Assertions.assertEquals("wjzrnfygxgisp", model.appliedScopeProperties().displayName()); - Assertions.assertEquals(false, model.renew()); + Assertions.assertEquals(481973669, model.quantity()); + Assertions.assertEquals("foskghsauuimj", model.displayName()); + Assertions.assertEquals(AppliedScopeType.MANAGEMENT_GROUP, model.appliedScopeType()); + Assertions.assertEquals("duugidyjr", model.appliedScopes().get(0)); + Assertions.assertEquals("osvexcsonpclhoc", model.appliedScopeProperties().tenantId()); + Assertions.assertEquals("slkevle", model.appliedScopeProperties().managementGroupId()); + Assertions.assertEquals("zfbuhf", model.appliedScopeProperties().subscriptionId()); + Assertions.assertEquals("faxkffeii", model.appliedScopeProperties().resourceGroupId()); + Assertions.assertEquals("lvmezyvshxmzsbbz", model.appliedScopeProperties().displayName()); + Assertions.assertFalse(model.renew()); Assertions.assertEquals(InstanceFlexibility.ON, model.reservedResourceProperties().instanceFlexibility()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T00:19:24Z"), model.reviewDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-22T08:18:11Z"), model.reviewDateTime()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaLimitsTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaLimitsTests.java index e50e6f718dc8..bdfdaa68544e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaLimitsTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaLimitsTests.java @@ -1,50 +1,24 @@ // 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.reservations.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.CurrentQuotaLimitBaseInner; -import com.azure.resourcemanager.reservations.models.QuotaLimits; -import com.azure.resourcemanager.reservations.models.QuotaProperties; -import com.azure.resourcemanager.reservations.models.ResourceName; +import com.azure.resourcemanager.reservations.implementation.models.QuotaLimits; import com.azure.resourcemanager.reservations.models.ResourceType; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class QuotaLimitsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaLimits model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"limit\":1229233262,\"currentValue\":1580005747,\"unit\":\"ueedndrdvs\",\"name\":{\"value\":\"qqtch\",\"localizedValue\":\"lmfmtdaay\"},\"resourceType\":\"shared\",\"quotaPeriod\":\"vgpiohgwxrt\",\"properties\":\"datadxepxgyq\"},\"id\":\"gvr\",\"name\":\"mnpkukghimdblxg\",\"type\":\"imfnjhfjx\"},{\"properties\":{\"limit\":279128548,\"currentValue\":1364854501,\"unit\":\"oqreyfkzikfjawn\",\"name\":{\"value\":\"vxwc\",\"localizedValue\":\"lpcirelsf\"},\"resourceType\":\"standard\",\"quotaPeriod\":\"wabfatkl\",\"properties\":\"dataxbjhwuaanozjosph\"},\"id\":\"oulpjrv\",\"name\":\"ag\",\"type\":\"rvimjwosytxitcsk\"}],\"nextLink\":\"k\"}") + "{\"value\":[{\"properties\":{\"limit\":70113912,\"currentValue\":805352848,\"unit\":\"hd\",\"name\":{\"value\":\"bqe\",\"localizedValue\":\"nxqbzvddn\"},\"resourceType\":\"dedicated\",\"quotaPeriod\":\"eic\",\"properties\":\"\\\"dataw\\\"\"},\"id\":\"zao\",\"name\":\"vuhrhcffcyddgl\",\"type\":\"jthjqkwpyei\"},{\"properties\":{\"limit\":1907104888,\"currentValue\":1686193188,\"unit\":\"q\",\"name\":{\"value\":\"hix\",\"localizedValue\":\"gdtopbobjogh\"},\"resourceType\":\"standard\",\"quotaPeriod\":\"a\",\"properties\":\"\\\"datauhrzayvvt\\\"\"},\"id\":\"vdfgiotk\",\"name\":\"tutqxlngxlefgug\",\"type\":\"xkrxdqmi\"},{\"properties\":{\"limit\":1583346323,\"currentValue\":1570785735,\"unit\":\"qdrabhjybigehoqf\",\"name\":{\"value\":\"skanyk\",\"localizedValue\":\"lcuiywgqywgndr\"},\"resourceType\":\"lowPriority\",\"quotaPeriod\":\"zgpphrcgyncocpe\",\"properties\":\"\\\"datavmmcoofs\\\"\"},\"id\":\"zevgb\",\"name\":\"qjqabcypmivkwl\",\"type\":\"uvcc\"},{\"properties\":{\"limit\":1023174750,\"currentValue\":1347818370,\"unit\":\"cfionl\",\"name\":{\"value\":\"etqgtzxdpnq\",\"localizedValue\":\"qwxrjfeallnw\"},\"resourceType\":\"dedicated\",\"quotaPeriod\":\"snjampmng\",\"properties\":\"\\\"datascxaq\\\"\"},\"id\":\"ochcbonqvpkvl\",\"name\":\"xnj\",\"type\":\"ase\"}],\"nextLink\":\"heoflokeyyienjbd\"}") .toObject(QuotaLimits.class); - Assertions.assertEquals(1229233262, model.value().get(0).properties().limit()); - Assertions.assertEquals("ueedndrdvs", model.value().get(0).properties().unit()); - Assertions.assertEquals("qqtch", model.value().get(0).properties().name().value()); - Assertions.assertEquals(ResourceType.SHARED, model.value().get(0).properties().resourceType()); - Assertions.assertEquals("k", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaLimits model = new QuotaLimits().withValue(Arrays.asList( - new CurrentQuotaLimitBaseInner().withProperties(new QuotaProperties().withLimit(1229233262) - .withUnit("ueedndrdvs") - .withName(new ResourceName().withValue("qqtch")) - .withResourceType(ResourceType.SHARED) - .withProperties("datadxepxgyq")), - new CurrentQuotaLimitBaseInner().withProperties(new QuotaProperties().withLimit(279128548) - .withUnit("oqreyfkzikfjawn") - .withName(new ResourceName().withValue("vxwc")) - .withResourceType(ResourceType.STANDARD) - .withProperties("dataxbjhwuaanozjosph")))) - .withNextLink("k"); - model = BinaryData.fromObject(model).toObject(QuotaLimits.class); - Assertions.assertEquals(1229233262, model.value().get(0).properties().limit()); - Assertions.assertEquals("ueedndrdvs", model.value().get(0).properties().unit()); - Assertions.assertEquals("qqtch", model.value().get(0).properties().name().value()); - Assertions.assertEquals(ResourceType.SHARED, model.value().get(0).properties().resourceType()); - Assertions.assertEquals("k", model.nextLink()); + Assertions.assertEquals(70113912, model.value().get(0).properties().limit()); + Assertions.assertEquals("hd", model.value().get(0).properties().unit()); + Assertions.assertEquals("bqe", model.value().get(0).properties().name().value()); + Assertions.assertEquals(ResourceType.DEDICATED, model.value().get(0).properties().resourceType()); + Assertions.assertEquals("heoflokeyyienjbd", model.nextLink()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaPropertiesTests.java index e2dde2d61af5..e634fa04a196 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaPropertiesTests.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.reservations.generated; @@ -14,25 +14,25 @@ public final class QuotaPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaProperties model = BinaryData.fromString( - "{\"limit\":1415235910,\"currentValue\":613432064,\"unit\":\"mibzyhwitsmypyyn\",\"name\":{\"value\":\"pumnz\",\"localizedValue\":\"wznm\"},\"resourceType\":\"serviceSpecific\",\"quotaPeriod\":\"nsorgjhxbldt\",\"properties\":\"datawrlkdmtn\"}") + "{\"limit\":524649765,\"currentValue\":1465460192,\"unit\":\"ajrmvdjwzrlovmc\",\"name\":{\"value\":\"ijcoejctb\",\"localizedValue\":\"qsqsy\"},\"resourceType\":\"shared\",\"quotaPeriod\":\"fkgukdkexxppof\",\"properties\":\"\\\"dataaxcfjpgddtocjjx\\\"\"}") .toObject(QuotaProperties.class); - Assertions.assertEquals(1415235910, model.limit()); - Assertions.assertEquals("mibzyhwitsmypyyn", model.unit()); - Assertions.assertEquals("pumnz", model.name().value()); - Assertions.assertEquals(ResourceType.SERVICE_SPECIFIC, model.resourceType()); + Assertions.assertEquals(524649765, model.limit()); + Assertions.assertEquals("ajrmvdjwzrlovmc", model.unit()); + Assertions.assertEquals("ijcoejctb", model.name().value()); + Assertions.assertEquals(ResourceType.SHARED, model.resourceType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QuotaProperties model = new QuotaProperties().withLimit(1415235910) - .withUnit("mibzyhwitsmypyyn") - .withName(new ResourceName().withValue("pumnz")) - .withResourceType(ResourceType.SERVICE_SPECIFIC) - .withProperties("datawrlkdmtn"); + QuotaProperties model = new QuotaProperties().withLimit(524649765) + .withUnit("ajrmvdjwzrlovmc") + .withName(new ResourceName().withValue("ijcoejctb")) + .withResourceType(ResourceType.SHARED) + .withProperties("\"dataaxcfjpgddtocjjx\""); model = BinaryData.fromObject(model).toObject(QuotaProperties.class); - Assertions.assertEquals(1415235910, model.limit()); - Assertions.assertEquals("mibzyhwitsmypyyn", model.unit()); - Assertions.assertEquals("pumnz", model.name().value()); - Assertions.assertEquals(ResourceType.SERVICE_SPECIFIC, model.resourceType()); + Assertions.assertEquals(524649765, model.limit()); + Assertions.assertEquals("ajrmvdjwzrlovmc", model.unit()); + Assertions.assertEquals("ijcoejctb", model.name().value()); + Assertions.assertEquals(ResourceType.SHARED, model.resourceType()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsInnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsInnerTests.java index 6d976fcde7cc..f1c0167e0dec 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsInnerTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsInnerTests.java @@ -1,47 +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.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner; import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import com.azure.resourcemanager.reservations.models.ResourceName; -import com.azure.resourcemanager.reservations.models.SubRequest; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class QuotaRequestDetailsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaRequestDetailsInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"message\":\"ekkezzikhlyfjh\",\"requestSubmitTime\":\"2021-02-19T20:13:34Z\",\"value\":[{\"limit\":558583308,\"name\":{\"value\":\"nyga\",\"localizedValue\":\"idb\"},\"resourceType\":\"atpxl\",\"unit\":\"xcyjmoadsuvarmy\",\"provisioningState\":\"InProgress\",\"message\":\"sjqbjhhyxxrw\",\"subRequestId\":\"co\"},{\"limit\":381030924,\"name\":{\"value\":\"xkgymareqnajxqu\",\"localizedValue\":\"hky\"},\"resourceType\":\"beddgssofw\",\"unit\":\"zqalkrmnjijpx\",\"provisioningState\":\"Failed\",\"message\":\"udfnbyxba\",\"subRequestId\":\"bjyvay\"},{\"limit\":662894219,\"name\":{\"value\":\"zrtuzq\",\"localizedValue\":\"sexnevfdnw\"},\"resourceType\":\"mewzsyyc\",\"unit\":\"zsoibjudpfrxtr\",\"provisioningState\":\"Accepted\",\"message\":\"aytdwkqbrq\",\"subRequestId\":\"paxh\"}]},\"id\":\"xiilivpdtiirqt\",\"name\":\"qoaxoruzfgs\",\"type\":\"uyfxrxxleptramxj\"}") + "{\"properties\":{\"provisioningState\":\"Failed\",\"message\":\"dphlxaolt\",\"requestSubmitTime\":\"2021-05-12T15:20:54Z\",\"value\":[{\"limit\":607055364,\"name\":{\"value\":\"f\",\"localizedValue\":\"s\"},\"resourceType\":\"zgvfcjrwz\",\"unit\":\"xjtfelluwfzit\",\"provisioningState\":\"Accepted\",\"message\":\"qfpjk\",\"subRequestId\":\"xofpdvhpfxxypi\"},{\"limit\":7569944,\"name\":{\"value\":\"yhuybbkpod\",\"localizedValue\":\"ooginuvamih\"},\"resourceType\":\"gnarxzxtheo\",\"unit\":\"si\",\"provisioningState\":\"Succeeded\",\"message\":\"cciqihnhungbwjz\",\"subRequestId\":\"fygxgispemvtzfk\"},{\"limit\":77118274,\"name\":{\"value\":\"jofxqe\",\"localizedValue\":\"jaeq\"},\"resourceType\":\"qjbasvms\",\"unit\":\"qulngsntnbybkzgc\",\"provisioningState\":\"Invalid\",\"message\":\"lxxwrljdouskc\",\"subRequestId\":\"kocrcjdkwtnhx\"}]},\"id\":\"jbiksqrglssai\",\"name\":\"qpjwnzlljfm\",\"type\":\"pee\"}") .toObject(QuotaRequestDetailsInner.class); - Assertions.assertEquals(QuotaRequestState.SUCCEEDED, model.provisioningState()); - Assertions.assertEquals("nyga", model.value().get(0).name().value()); - Assertions.assertEquals("xcyjmoadsuvarmy", model.value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.IN_PROGRESS, model.value().get(0).provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestDetailsInner model - = new QuotaRequestDetailsInner().withProvisioningState(QuotaRequestState.SUCCEEDED) - .withValue(Arrays.asList( - new SubRequest().withName(new ResourceName().withValue("nyga")) - .withUnit("xcyjmoadsuvarmy") - .withProvisioningState(QuotaRequestState.IN_PROGRESS), - new SubRequest().withName(new ResourceName().withValue("xkgymareqnajxqu")) - .withUnit("zqalkrmnjijpx") - .withProvisioningState(QuotaRequestState.FAILED), - new SubRequest().withName(new ResourceName().withValue("zrtuzq")) - .withUnit("zsoibjudpfrxtr") - .withProvisioningState(QuotaRequestState.ACCEPTED))); - model = BinaryData.fromObject(model).toObject(QuotaRequestDetailsInner.class); - Assertions.assertEquals(QuotaRequestState.SUCCEEDED, model.provisioningState()); - Assertions.assertEquals("nyga", model.value().get(0).name().value()); - Assertions.assertEquals("xcyjmoadsuvarmy", model.value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.IN_PROGRESS, model.value().get(0).provisioningState()); + Assertions.assertEquals(QuotaRequestState.FAILED, model.provisioningState()); + Assertions.assertEquals("f", model.value().get(0).name().value()); + Assertions.assertEquals("xjtfelluwfzit", model.value().get(0).unit()); + Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.value().get(0).provisioningState()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsListTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsListTests.java index 6d02553637dd..831d794d23d1 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsListTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestDetailsListTests.java @@ -1,85 +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.reservations.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner; -import com.azure.resourcemanager.reservations.models.QuotaRequestDetailsList; +import com.azure.resourcemanager.reservations.implementation.models.QuotaRequestDetailsList; import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import com.azure.resourcemanager.reservations.models.ResourceName; -import com.azure.resourcemanager.reservations.models.SubRequest; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class QuotaRequestDetailsListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaRequestDetailsList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"message\":\"doaon\",\"requestSubmitTime\":\"2021-06-02T01:39:29Z\",\"value\":[{\"limit\":905406491,\"name\":{},\"resourceType\":\"tcje\",\"unit\":\"twwaezkojvdcpzf\",\"provisioningState\":\"Accepted\",\"message\":\"i\",\"subRequestId\":\"bxarzgszufoxci\"},{\"limit\":153808073,\"name\":{},\"resourceType\":\"oamciodh\",\"unit\":\"azxkhnzbonlwnto\",\"provisioningState\":\"Invalid\",\"message\":\"dwbwhkszzcmrvexz\",\"subRequestId\":\"bt\"}]},\"id\":\"gsfraoyzkoow\",\"name\":\"lmnguxaw\",\"type\":\"aldsy\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"message\":\"erqf\",\"requestSubmitTime\":\"2021-11-12T10:02:05Z\",\"value\":[{\"limit\":634741251,\"name\":{},\"resourceType\":\"kutwpf\",\"unit\":\"a\",\"provisioningState\":\"Accepted\",\"message\":\"skdsnfdsdoakg\",\"subRequestId\":\"lmkk\"},{\"limit\":1673981436,\"name\":{},\"resourceType\":\"hewpusdsttwv\",\"unit\":\"vbbejdcng\",\"provisioningState\":\"Succeeded\",\"message\":\"akufgmjz\",\"subRequestId\":\"rdgrtw\"},{\"limit\":196089645,\"name\":{},\"resourceType\":\"zkopb\",\"unit\":\"nrfdw\",\"provisioningState\":\"Accepted\",\"message\":\"hziuiefozbhdms\",\"subRequestId\":\"mzqhoftrmaequi\"},{\"limit\":1964875083,\"name\":{},\"resourceType\":\"slfaoqzpiyyl\",\"unit\":\"lnswhcc\",\"provisioningState\":\"Failed\",\"message\":\"aivwitqscywu\",\"subRequestId\":\"woluhczbwemhair\"}]},\"id\":\"brgz\",\"name\":\"wmsweypqwd\",\"type\":\"ggicccnxqhue\"},{\"properties\":{\"provisioningState\":\"Invalid\",\"message\":\"lstvlzywe\",\"requestSubmitTime\":\"2021-12-10T13:38:49Z\",\"value\":[{\"limit\":1008650845,\"name\":{},\"resourceType\":\"clusiy\",\"unit\":\"sfgytguslfead\",\"provisioningState\":\"InProgress\",\"message\":\"ukyhejhzis\",\"subRequestId\":\"fpel\"},{\"limit\":129297763,\"name\":{},\"resourceType\":\"ksrpqv\",\"unit\":\"zraehtwd\",\"provisioningState\":\"Accepted\",\"message\":\"swibyr\",\"subRequestId\":\"l\"},{\"limit\":1538697515,\"name\":{},\"resourceType\":\"wpracstwitykhev\",\"unit\":\"cedcpnmdy\",\"provisioningState\":\"Succeeded\",\"message\":\"zxltjcvn\",\"subRequestId\":\"tiugcxnav\"}]},\"id\":\"wxqibyq\",\"name\":\"nyowxwlmdjrkvfg\",\"type\":\"vfvpdbodaciz\"},{\"properties\":{\"provisioningState\":\"Failed\",\"message\":\"krribdeibqi\",\"requestSubmitTime\":\"2021-08-10T16:45:38Z\",\"value\":[{\"limit\":1573874006,\"name\":{},\"resourceType\":\"zwmk\",\"unit\":\"fajpjorwk\",\"provisioningState\":\"Accepted\",\"message\":\"gbijtjivfx\",\"subRequestId\":\"jabibsystawf\"},{\"limit\":2111279751,\"name\":{},\"resourceType\":\"kvpbjxbkzbz\",\"unit\":\"vncjabudurgk\",\"provisioningState\":\"InProgress\",\"message\":\"kzhjj\",\"subRequestId\":\"ffhmouwqlgzr\"},{\"limit\":1353078478,\"name\":{},\"resourceType\":\"ebizikayuh\",\"unit\":\"bjbsybb\",\"provisioningState\":\"Succeeded\",\"message\":\"t\",\"subRequestId\":\"gmfpgvmp\"},{\"limit\":299337354,\"name\":{},\"resourceType\":\"thaqfxssmwu\",\"unit\":\"bdsrez\",\"provisioningState\":\"InProgress\",\"message\":\"neuyow\",\"subRequestId\":\"d\"}]},\"id\":\"ytisibir\",\"name\":\"gpikpzimejza\",\"type\":\"lfzxiavrmbzonoki\"}],\"nextLink\":\"jq\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"InProgress\",\"message\":\"qedqytbciqfoufl\",\"requestSubmitTime\":\"2021-03-13T18:03:58Z\",\"value\":[{\"limit\":755106885,\"name\":{},\"resourceType\":\"mglougpbkw\",\"unit\":\"utduqktapspwgcu\",\"provisioningState\":\"Failed\",\"message\":\"mkdo\",\"subRequestId\":\"qw\"}]},\"id\":\"mdgbbjfdd\",\"name\":\"mbmbexppbh\",\"type\":\"q\"}],\"nextLink\":\"ol\"}") .toObject(QuotaRequestDetailsList.class); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.value().get(0).provisioningState()); - Assertions.assertEquals("twwaezkojvdcpzf", model.value().get(0).value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.value().get(0).value().get(0).provisioningState()); - Assertions.assertEquals("jq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestDetailsList model = new QuotaRequestDetailsList().withValue(Arrays.asList( - new QuotaRequestDetailsInner().withProvisioningState(QuotaRequestState.ACCEPTED) - .withValue(Arrays.asList( - new SubRequest().withName(new ResourceName()) - .withUnit("twwaezkojvdcpzf") - .withProvisioningState(QuotaRequestState.ACCEPTED), - new SubRequest().withName(new ResourceName()) - .withUnit("azxkhnzbonlwnto") - .withProvisioningState(QuotaRequestState.INVALID))), - new QuotaRequestDetailsInner().withProvisioningState(QuotaRequestState.ACCEPTED) - .withValue(Arrays.asList( - new SubRequest().withName(new ResourceName()) - .withUnit("a") - .withProvisioningState(QuotaRequestState.ACCEPTED), - new SubRequest().withName(new ResourceName()) - .withUnit("vbbejdcng") - .withProvisioningState(QuotaRequestState.SUCCEEDED), - new SubRequest().withName(new ResourceName()) - .withUnit("nrfdw") - .withProvisioningState(QuotaRequestState.ACCEPTED), - new SubRequest().withName(new ResourceName()) - .withUnit("lnswhcc") - .withProvisioningState(QuotaRequestState.FAILED))), - new QuotaRequestDetailsInner().withProvisioningState(QuotaRequestState.INVALID) - .withValue(Arrays.asList( - new SubRequest().withName(new ResourceName()) - .withUnit("sfgytguslfead") - .withProvisioningState(QuotaRequestState.IN_PROGRESS), - new SubRequest().withName(new ResourceName()) - .withUnit("zraehtwd") - .withProvisioningState(QuotaRequestState.ACCEPTED), - new SubRequest().withName(new ResourceName()) - .withUnit("cedcpnmdy") - .withProvisioningState(QuotaRequestState.SUCCEEDED))), - new QuotaRequestDetailsInner().withProvisioningState(QuotaRequestState.FAILED) - .withValue(Arrays.asList( - new SubRequest().withName(new ResourceName()) - .withUnit("fajpjorwk") - .withProvisioningState(QuotaRequestState.ACCEPTED), - new SubRequest().withName(new ResourceName()) - .withUnit("vncjabudurgk") - .withProvisioningState(QuotaRequestState.IN_PROGRESS), - new SubRequest().withName(new ResourceName()) - .withUnit("bjbsybb") - .withProvisioningState(QuotaRequestState.SUCCEEDED), - new SubRequest().withName(new ResourceName()) - .withUnit("bdsrez") - .withProvisioningState(QuotaRequestState.IN_PROGRESS))))) - .withNextLink("jq"); - model = BinaryData.fromObject(model).toObject(QuotaRequestDetailsList.class); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.value().get(0).provisioningState()); - Assertions.assertEquals("twwaezkojvdcpzf", model.value().get(0).value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.value().get(0).value().get(0).provisioningState()); - Assertions.assertEquals("jq", model.nextLink()); + Assertions.assertEquals(QuotaRequestState.IN_PROGRESS, model.value().get(0).provisioningState()); + Assertions.assertEquals("utduqktapspwgcu", model.value().get(0).value().get(0).unit()); + Assertions.assertEquals(QuotaRequestState.FAILED, model.value().get(0).value().get(0).provisioningState()); + Assertions.assertEquals("ol", model.nextLink()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestPropertiesTests.java index 50097c00aa97..dbc97d696f90 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestPropertiesTests.java @@ -1,49 +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.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestProperties; import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import com.azure.resourcemanager.reservations.models.ResourceName; -import com.azure.resourcemanager.reservations.models.SubRequest; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class QuotaRequestPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaRequestProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Succeeded\",\"message\":\"wnwxuqlcvyd\",\"requestSubmitTime\":\"2021-07-15T02:51:17Z\",\"value\":[{\"limit\":350928008,\"name\":{\"value\":\"jkniodko\",\"localizedValue\":\"bw\"},\"resourceType\":\"jhemms\",\"unit\":\"dkcrodt\",\"provisioningState\":\"Failed\",\"message\":\"wj\",\"subRequestId\":\"lt\"},{\"limit\":510695304,\"name\":{\"value\":\"efkdlf\",\"localizedValue\":\"kggkfpa\"},\"resourceType\":\"owpulpq\",\"unit\":\"ylsyxkqjnsje\",\"provisioningState\":\"Accepted\",\"message\":\"agxsdszuemps\",\"subRequestId\":\"kfzbeyvpnqicvi\"},{\"limit\":756169638,\"name\":{\"value\":\"xdxr\",\"localizedValue\":\"ukzclewyhmlwpaz\"},\"resourceType\":\"pofncck\",\"unit\":\"fz\",\"provisioningState\":\"Invalid\",\"message\":\"xbuy\",\"subRequestId\":\"xzfe\"},{\"limit\":608343994,\"name\":{\"value\":\"riolxorjalt\",\"localizedValue\":\"mncwsobqwcsdb\"},\"resourceType\":\"dcfhucqdpf\",\"unit\":\"glsbjjc\",\"provisioningState\":\"Succeeded\",\"message\":\"bvtvudutncormr\",\"subRequestId\":\"qtvcofudflvkgj\"}]}") + "{\"provisioningState\":\"Invalid\",\"message\":\"xsabkyqdu\",\"requestSubmitTime\":\"2021-07-17T19:18:59Z\",\"value\":[{\"limit\":1447556622,\"name\":{\"value\":\"zevndhkrwpdappds\",\"localizedValue\":\"kvwrwjfeu\"},\"resourceType\":\"hutje\",\"unit\":\"mrldhu\",\"provisioningState\":\"Succeeded\",\"message\":\"datqxhocdgeabl\",\"subRequestId\":\"huticndvkao\"}]}") .toObject(QuotaRequestProperties.class); - Assertions.assertEquals(QuotaRequestState.SUCCEEDED, model.provisioningState()); - Assertions.assertEquals("jkniodko", model.value().get(0).name().value()); - Assertions.assertEquals("dkcrodt", model.value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.FAILED, model.value().get(0).provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestProperties model = new QuotaRequestProperties().withProvisioningState(QuotaRequestState.SUCCEEDED) - .withValue(Arrays.asList( - new SubRequest().withName(new ResourceName().withValue("jkniodko")) - .withUnit("dkcrodt") - .withProvisioningState(QuotaRequestState.FAILED), - new SubRequest().withName(new ResourceName().withValue("efkdlf")) - .withUnit("ylsyxkqjnsje") - .withProvisioningState(QuotaRequestState.ACCEPTED), - new SubRequest().withName(new ResourceName().withValue("xdxr")) - .withUnit("fz") - .withProvisioningState(QuotaRequestState.INVALID), - new SubRequest().withName(new ResourceName().withValue("riolxorjalt")) - .withUnit("glsbjjc") - .withProvisioningState(QuotaRequestState.SUCCEEDED))); - model = BinaryData.fromObject(model).toObject(QuotaRequestProperties.class); - Assertions.assertEquals(QuotaRequestState.SUCCEEDED, model.provisioningState()); - Assertions.assertEquals("jkniodko", model.value().get(0).name().value()); - Assertions.assertEquals("dkcrodt", model.value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.FAILED, model.value().get(0).provisioningState()); + Assertions.assertEquals(QuotaRequestState.INVALID, model.provisioningState()); + Assertions.assertEquals("zevndhkrwpdappds", model.value().get(0).name().value()); + Assertions.assertEquals("mrldhu", model.value().get(0).unit()); + Assertions.assertEquals(QuotaRequestState.SUCCEEDED, model.value().get(0).provisioningState()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusDetailsTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusDetailsTests.java deleted file mode 100644 index a6cc532c42cb..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusDetailsTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestStatusDetails; - -public final class QuotaRequestStatusDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaRequestStatusDetails model - = BinaryData.fromString("{\"provisioningState\":\"Invalid\",\"message\":\"iccjzkzivgvvcna\"}") - .toObject(QuotaRequestStatusDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestStatusDetails model = new QuotaRequestStatusDetails(); - model = BinaryData.fromObject(model).toObject(QuotaRequestStatusDetails.class); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetWithResponseMockTests.java index d0077059fe6c..c6a0127a98bc 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetWithResponseMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.reservations.ReservationsManager; import com.azure.resourcemanager.reservations.models.QuotaRequestDetails; @@ -22,23 +22,23 @@ public final class QuotaRequestStatusGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Failed\",\"message\":\"kadpysown\",\"requestSubmitTime\":\"2021-03-28T18:59:19Z\",\"value\":[{\"limit\":792325056,\"name\":{\"value\":\"qctojcmisof\",\"localizedValue\":\"ypefojyqdhcupl\"},\"resourceType\":\"lcwkhihihlhz\",\"unit\":\"qtz\",\"provisioningState\":\"InProgress\",\"message\":\"nowc\",\"subRequestId\":\"fgmvecactxmwo\"},{\"limit\":966273213,\"name\":{\"value\":\"cluqovekqvgqo\",\"localizedValue\":\"ifzmpjwyivqi\"},\"resourceType\":\"xcvhrfs\",\"unit\":\"uagrttikteusqc\",\"provisioningState\":\"Accepted\",\"message\":\"klxubyja\",\"subRequestId\":\"mmfblcqcuubgqib\"}]},\"id\":\"talmett\",\"name\":\"wgdsl\",\"type\":\"xih\"}"; + = "{\"properties\":{\"provisioningState\":\"Failed\",\"message\":\"cofudflvkgjub\",\"requestSubmitTime\":\"2021-11-23T16:21:59Z\",\"value\":[{\"limit\":1588096441,\"name\":{\"value\":\"znqntoru\",\"localizedValue\":\"gsahmkycgrauw\"},\"resourceType\":\"etaebu\",\"unit\":\"vdmovsmzlxwabm\",\"provisioningState\":\"Accepted\",\"message\":\"kif\",\"subRequestId\":\"tpuqujmq\"},{\"limit\":1609409452,\"name\":{\"value\":\"tndoaongbjc\",\"localizedValue\":\"ujitcjedftww\"},\"resourceType\":\"zkoj\",\"unit\":\"c\",\"provisioningState\":\"InProgress\",\"message\":\"qouicybxarzgsz\",\"subRequestId\":\"oxciqopidoamcio\"},{\"limit\":1660457179,\"name\":{\"value\":\"zxkhnzbonlwnto\",\"localizedValue\":\"okdwb\"},\"resourceType\":\"kszzcmrvexztv\",\"unit\":\"qgsfraoyzkoow\",\"provisioningState\":\"Failed\",\"message\":\"guxawqaldsyuuxi\",\"subRequestId\":\"rqf\"}]},\"id\":\"wyznkbyku\",\"name\":\"wpfhpagmhrskd\",\"type\":\"nfd\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ReservationsManager manager = ReservationsManager.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)); QuotaRequestDetails response = manager.quotaRequestStatus() - .getWithResponse("wiuagydwqf", "ylyrfgiagtco", "ocqwogfnzjvus", "zldmozuxy", + .getWithResponse("bqwcsdbnwdcf", "ucqdpfuvglsb", "jcanvxbvtvudut", "cormr", com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(QuotaRequestState.FAILED, response.provisioningState()); - Assertions.assertEquals("qctojcmisof", response.value().get(0).name().value()); - Assertions.assertEquals("qtz", response.value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.IN_PROGRESS, response.value().get(0).provisioningState()); + Assertions.assertEquals("znqntoru", response.value().get(0).name().value()); + Assertions.assertEquals("vdmovsmzlxwabm", response.value().get(0).unit()); + Assertions.assertEquals(QuotaRequestState.ACCEPTED, response.value().get(0).provisioningState()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListMockTests.java index 18239972f090..019f69275a37 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestStatusListMockTests.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.reservations.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.reservations.ReservationsManager; import com.azure.resourcemanager.reservations.models.QuotaRequestDetails; @@ -23,23 +23,23 @@ public final class QuotaRequestStatusListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Invalid\",\"message\":\"cjbtrgaehvvib\",\"requestSubmitTime\":\"2021-06-30T16:55:59Z\",\"value\":[{\"limit\":564299595,\"name\":{\"value\":\"eitpkxztmo\",\"localizedValue\":\"klf\"},\"resourceType\":\"dgfcwqmp\",\"unit\":\"aqxzhemjyho\",\"provisioningState\":\"Failed\",\"message\":\"wtwko\",\"subRequestId\":\"wculkbaw\"}]},\"id\":\"fajnjwltlwtjjguk\",\"name\":\"alhsnvkc\",\"type\":\"mxzrpoa\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"InProgress\",\"message\":\"aenuuz\",\"requestSubmitTime\":\"2021-07-21T23:33:14Z\",\"value\":[{\"limit\":1224978784,\"name\":{\"value\":\"dwoyuhhziuiefoz\",\"localizedValue\":\"dmsmlm\"},\"resourceType\":\"hoftr\",\"unit\":\"equi\",\"provisioningState\":\"Invalid\",\"message\":\"cslfaoqzpiyylha\",\"subRequestId\":\"swhccsphk\"},{\"limit\":185919180,\"name\":{\"value\":\"tqscywug\",\"localizedValue\":\"oluhczbwemh\"},\"resourceType\":\"rsbrgzdwm\",\"unit\":\"eypqwdxggicccn\",\"provisioningState\":\"InProgress\",\"message\":\"exmk\",\"subRequestId\":\"lstvlzywe\"}]},\"id\":\"zrncsdt\",\"name\":\"lusiy\",\"type\":\"bsfgytguslfea\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ReservationsManager manager = ReservationsManager.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.quotaRequestStatus() - .list("rmooizqse", "pxiutc", "apzhyrpetoge", "joxslhvnhla", 1064191938, "q", + .list("doakgtdlmkkzevdl", "ewpusdsttwvogvb", "ejdcngqqmoakuf", "m", 328261823, "rwr", com.azure.core.util.Context.NONE); - Assertions.assertEquals(QuotaRequestState.INVALID, response.iterator().next().provisioningState()); - Assertions.assertEquals("eitpkxztmo", response.iterator().next().value().get(0).name().value()); - Assertions.assertEquals("aqxzhemjyho", response.iterator().next().value().get(0).unit()); - Assertions.assertEquals(QuotaRequestState.FAILED, + Assertions.assertEquals(QuotaRequestState.IN_PROGRESS, response.iterator().next().provisioningState()); + Assertions.assertEquals("dwoyuhhziuiefoz", response.iterator().next().value().get(0).name().value()); + Assertions.assertEquals("equi", response.iterator().next().value().get(0).unit()); + Assertions.assertEquals(QuotaRequestState.INVALID, response.iterator().next().value().get(0).provisioningState()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestSubmitResponse201InnerTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestSubmitResponse201InnerTests.java deleted file mode 100644 index 5e3e2308110b..000000000000 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotaRequestSubmitResponse201InnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.reservations.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestSubmitResponse201Inner; - -public final class QuotaRequestSubmitResponse201InnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaRequestSubmitResponse201Inner model = BinaryData.fromString( - "{\"id\":\"cogjltdtbn\",\"name\":\"adoocrkvc\",\"type\":\"hnvpamqgxq\",\"properties\":{\"provisioningState\":\"Accepted\",\"message\":\"kywggxkallatmel\"}}") - .toObject(QuotaRequestSubmitResponse201Inner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaRequestSubmitResponse201Inner model = new QuotaRequestSubmitResponse201Inner(); - model = BinaryData.fromObject(model).toObject(QuotaRequestSubmitResponse201Inner.class); - } -} diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasCreateOrUpdateMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasCreateOrUpdateMockTests.java index 25026079be54..a40465d1467d 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasCreateOrUpdateMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.reservations.ReservationsManager; import com.azure.resourcemanager.reservations.models.CurrentQuotaLimitBase; @@ -24,28 +24,28 @@ public final class QuotasCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"limit\":1922486723,\"currentValue\":1078649712,\"unit\":\"srvhmgorffuki\",\"name\":{\"value\":\"w\",\"localizedValue\":\"hwplefaxvx\"},\"resourceType\":\"standard\",\"quotaPeriod\":\"tg\",\"properties\":\"datanzeyqxtjj\"},\"id\":\"zqlqhyc\",\"name\":\"vodggxdbee\",\"type\":\"mieknlraria\"}"; + = "{\"properties\":{\"limit\":1165278651,\"currentValue\":1282361088,\"unit\":\"owueluqh\",\"name\":{\"value\":\"hxvrhmzkwpjg\",\"localizedValue\":\"spughftqsxhq\"},\"resourceType\":\"shared\",\"quotaPeriod\":\"ukndxdigrjgu\",\"properties\":\"\\\"datazdmsyqtfi\\\"\"},\"id\":\"hbotzingamvppho\",\"name\":\"zqzudph\",\"type\":\"amvdkfwynwcvtbv\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ReservationsManager manager = ReservationsManager.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)); CurrentQuotaLimitBase response = manager.quotas() - .define("vgtrdcnifmzzs") - .withExistingLocation("ppnvdxz", "hihfrbbcevqagtlt", "hlfkqojpy") - .withProperties(new QuotaProperties().withLimit(599707965) - .withUnit("suxmpraf") - .withName(new ResourceName().withValue("khocxvdfffwaf")) - .withResourceType(ResourceType.STANDARD) - .withProperties("datahcxgkmoyx")) + .define("mejzanlfzxia") + .withExistingLocation("zpdrhneu", "owqkdwytisi", "ircgpikpz") + .withProperties(new QuotaProperties().withLimit(1513194356) + .withUnit("okixrjqcir") + .withName(new ResourceName().withValue("frl")) + .withResourceType(ResourceType.LOW_PRIORITY) + .withProperties("\"dataflsjc\"")) .create(); - Assertions.assertEquals(1922486723, response.properties().limit()); - Assertions.assertEquals("srvhmgorffuki", response.properties().unit()); - Assertions.assertEquals("w", response.properties().name().value()); - Assertions.assertEquals(ResourceType.STANDARD, response.properties().resourceType()); + Assertions.assertEquals(1165278651, response.properties().limit()); + Assertions.assertEquals("owueluqh", response.properties().unit()); + Assertions.assertEquals("hxvrhmzkwpjg", response.properties().name().value()); + Assertions.assertEquals(ResourceType.SHARED, response.properties().resourceType()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasGetWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasGetWithResponseMockTests.java index 39001b80445a..abf621e7c734 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasGetWithResponseMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.reservations.ReservationsManager; import com.azure.resourcemanager.reservations.models.CurrentQuotaLimitBase; @@ -22,22 +22,22 @@ public final class QuotasGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"limit\":800770493,\"currentValue\":254109783,\"unit\":\"utnwytpzdmovzvf\",\"name\":{\"value\":\"wzqa\",\"localizedValue\":\"lgzurig\"},\"resourceType\":\"dedicated\",\"quotaPeriod\":\"xndticokpvzmlqtm\",\"properties\":\"datagxobfirclnp\"},\"id\":\"ciayzriykhya\",\"name\":\"fvjlboxqvkjlmx\",\"type\":\"omdynhdwdigum\"}"; + = "{\"properties\":{\"limit\":2069746819,\"currentValue\":373918830,\"unit\":\"vnhltiugcx\",\"name\":{\"value\":\"vwxqibyqunyo\",\"localizedValue\":\"wlmdjrkv\"},\"resourceType\":\"serviceSpecific\",\"quotaPeriod\":\"fvpdbo\",\"properties\":\"\\\"datacizsjqlhkrribdei\\\"\"},\"id\":\"ipqkghvxndzwm\",\"name\":\"refajpjorwkqnyh\",\"type\":\"b\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ReservationsManager manager = ReservationsManager.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)); CurrentQuotaLimitBase response = manager.quotas() - .getWithResponse("ztcktyh", "tqedcgzulwm", "rqzz", "rjvpglydzgkrvqee", com.azure.core.util.Context.NONE) + .getWithResponse("acstwityk", "evxccedcp", "md", "odn", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(800770493, response.properties().limit()); - Assertions.assertEquals("utnwytpzdmovzvf", response.properties().unit()); - Assertions.assertEquals("wzqa", response.properties().name().value()); - Assertions.assertEquals(ResourceType.DEDICATED, response.properties().resourceType()); + Assertions.assertEquals(2069746819, response.properties().limit()); + Assertions.assertEquals("vnhltiugcx", response.properties().unit()); + Assertions.assertEquals("vwxqibyqunyo", response.properties().name().value()); + Assertions.assertEquals(ResourceType.SERVICE_SPECIFIC, response.properties().resourceType()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasListMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasListMockTests.java index 7e0c7883caa6..8a6c0a5ae29e 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasListMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/QuotasListMockTests.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.reservations.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.reservations.ReservationsManager; import com.azure.resourcemanager.reservations.models.CurrentQuotaLimitBase; @@ -23,21 +23,21 @@ public final class QuotasListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"limit\":743389184,\"currentValue\":217945747,\"unit\":\"qyuvvfonkp\",\"name\":{\"value\":\"yik\",\"localizedValue\":\"lauyav\"},\"resourceType\":\"standard\",\"quotaPeriod\":\"ncstt\",\"properties\":\"datafybvpoek\"},\"id\":\"sgsgbdhu\",\"name\":\"qgnjdgkynscli\",\"type\":\"hzvhxnkomtkubo\"}]}"; + = "{\"value\":[{\"properties\":{\"limit\":1731157683,\"currentValue\":2005315516,\"unit\":\"zkdvncja\",\"name\":{\"value\":\"urgkakmokzhjjk\",\"localizedValue\":\"fhmouwq\"},\"resourceType\":\"shared\",\"quotaPeriod\":\"fzeeyebizik\",\"properties\":\"\\\"datauhqlbjbsybbqwrvt\\\"\"},\"id\":\"gmfpgvmp\",\"name\":\"paslthaqfxssmwu\",\"type\":\"wbdsr\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ReservationsManager manager = ReservationsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.quotas().list("nraauzz", "tj", "zysdzh", com.azure.core.util.Context.NONE); + = manager.quotas().list("j", "jivfxzsjabib", "ystawfsdjpvkvp", com.azure.core.util.Context.NONE); - Assertions.assertEquals(743389184, response.iterator().next().properties().limit()); - Assertions.assertEquals("qyuvvfonkp", response.iterator().next().properties().unit()); - Assertions.assertEquals("yik", response.iterator().next().properties().name().value()); - Assertions.assertEquals(ResourceType.STANDARD, response.iterator().next().properties().resourceType()); + Assertions.assertEquals(1731157683, response.iterator().next().properties().limit()); + Assertions.assertEquals("zkdvncja", response.iterator().next().properties().unit()); + Assertions.assertEquals("urgkakmokzhjjk", response.iterator().next().properties().name().value()); + Assertions.assertEquals(ResourceType.SHARED, response.iterator().next().properties().resourceType()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestPropertiesTests.java index 91d49d611671..c8292fff3d64 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestPropertiesTests.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.reservations.generated; @@ -13,26 +13,26 @@ public final class RefundRequestPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RefundRequestProperties model = BinaryData.fromString( - "{\"sessionId\":\"nlqidybyxczf\",\"scope\":\"haaxdbabphl\",\"reservationToReturn\":{\"reservationId\":\"lfktsths\",\"quantity\":2034865697},\"returnReason\":\"mnyyazt\"}") + "{\"sessionId\":\"mjh\",\"scope\":\"j\",\"reservationToReturn\":{\"reservationId\":\"u\",\"quantity\":709411733},\"returnReason\":\"r\"}") .toObject(RefundRequestProperties.class); - Assertions.assertEquals("nlqidybyxczf", model.sessionId()); - Assertions.assertEquals("haaxdbabphl", model.scope()); - Assertions.assertEquals("lfktsths", model.reservationToReturn().reservationId()); - Assertions.assertEquals(2034865697, model.reservationToReturn().quantity()); - Assertions.assertEquals("mnyyazt", model.returnReason()); + Assertions.assertEquals("mjh", model.sessionId()); + Assertions.assertEquals("j", model.scope()); + Assertions.assertEquals("u", model.reservationToReturn().reservationId()); + Assertions.assertEquals(709411733, model.reservationToReturn().quantity()); + Assertions.assertEquals("r", model.returnReason()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RefundRequestProperties model = new RefundRequestProperties().withSessionId("nlqidybyxczf") - .withScope("haaxdbabphl") - .withReservationToReturn(new ReservationToReturn().withReservationId("lfktsths").withQuantity(2034865697)) - .withReturnReason("mnyyazt"); + RefundRequestProperties model = new RefundRequestProperties().withSessionId("mjh") + .withScope("j") + .withReservationToReturn(new ReservationToReturn().withReservationId("u").withQuantity(709411733)) + .withReturnReason("r"); model = BinaryData.fromObject(model).toObject(RefundRequestProperties.class); - Assertions.assertEquals("nlqidybyxczf", model.sessionId()); - Assertions.assertEquals("haaxdbabphl", model.scope()); - Assertions.assertEquals("lfktsths", model.reservationToReturn().reservationId()); - Assertions.assertEquals(2034865697, model.reservationToReturn().quantity()); - Assertions.assertEquals("mnyyazt", model.returnReason()); + Assertions.assertEquals("mjh", model.sessionId()); + Assertions.assertEquals("j", model.scope()); + Assertions.assertEquals("u", model.reservationToReturn().reservationId()); + Assertions.assertEquals(709411733, model.reservationToReturn().quantity()); + Assertions.assertEquals("r", model.returnReason()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestTests.java index d3ad86aa6e46..c0bb1a094021 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/RefundRequestTests.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.reservations.generated; @@ -14,26 +14,28 @@ public final class RefundRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RefundRequest model = BinaryData.fromString( - "{\"properties\":{\"sessionId\":\"l\",\"scope\":\"kx\",\"reservationToReturn\":{\"reservationId\":\"k\",\"quantity\":1438226066},\"returnReason\":\"nbtkcxywnytnr\"}}") + "{\"properties\":{\"sessionId\":\"uaopppcqeq\",\"scope\":\"lzdahzxctobgbkdm\",\"reservationToReturn\":{\"reservationId\":\"postmgrcfbunrm\",\"quantity\":1710295425},\"returnReason\":\"hkxbpv\"}}") .toObject(RefundRequest.class); - Assertions.assertEquals("l", model.properties().sessionId()); - Assertions.assertEquals("kx", model.properties().scope()); - Assertions.assertEquals("k", model.properties().reservationToReturn().reservationId()); - Assertions.assertEquals(1438226066, model.properties().reservationToReturn().quantity()); - Assertions.assertEquals("nbtkcxywnytnr", model.properties().returnReason()); + Assertions.assertEquals("uaopppcqeq", model.properties().sessionId()); + Assertions.assertEquals("lzdahzxctobgbkdm", model.properties().scope()); + Assertions.assertEquals("postmgrcfbunrm", model.properties().reservationToReturn().reservationId()); + Assertions.assertEquals(1710295425, model.properties().reservationToReturn().quantity()); + Assertions.assertEquals("hkxbpv", model.properties().returnReason()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RefundRequest model = new RefundRequest().withProperties(new RefundRequestProperties().withSessionId("l") - .withScope("kx") - .withReservationToReturn(new ReservationToReturn().withReservationId("k").withQuantity(1438226066)) - .withReturnReason("nbtkcxywnytnr")); + RefundRequest model + = new RefundRequest().withProperties(new RefundRequestProperties().withSessionId("uaopppcqeq") + .withScope("lzdahzxctobgbkdm") + .withReservationToReturn( + new ReservationToReturn().withReservationId("postmgrcfbunrm").withQuantity(1710295425)) + .withReturnReason("hkxbpv")); model = BinaryData.fromObject(model).toObject(RefundRequest.class); - Assertions.assertEquals("l", model.properties().sessionId()); - Assertions.assertEquals("kx", model.properties().scope()); - Assertions.assertEquals("k", model.properties().reservationToReturn().reservationId()); - Assertions.assertEquals(1438226066, model.properties().reservationToReturn().quantity()); - Assertions.assertEquals("nbtkcxywnytnr", model.properties().returnReason()); + Assertions.assertEquals("uaopppcqeq", model.properties().sessionId()); + Assertions.assertEquals("lzdahzxctobgbkdm", model.properties().scope()); + Assertions.assertEquals("postmgrcfbunrm", model.properties().reservationToReturn().reservationId()); + Assertions.assertEquals(1710295425, model.properties().reservationToReturn().quantity()); + Assertions.assertEquals("hkxbpv", model.properties().returnReason()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationMergePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationMergePropertiesTests.java index 5019b7cc3e5c..36d2d768da61 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationMergePropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationMergePropertiesTests.java @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.models.ReservationMergeProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ReservationMergePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ReservationMergeProperties model = BinaryData.fromString( - "{\"mergeDestination\":\"zcxtbzsgfyccsn\",\"mergeSources\":[\"dwzjeiach\",\"oosflnr\",\"sfqpteehz\",\"vypyqrimzinpv\"]}") + ReservationMergeProperties model = BinaryData + .fromString("{\"mergeDestination\":\"c\",\"mergeSources\":[\"fovgmkqsleyyvxy\",\"jpkcattpng\"]}") .toObject(ReservationMergeProperties.class); - Assertions.assertEquals("zcxtbzsgfyccsn", model.mergeDestination()); - Assertions.assertEquals("dwzjeiach", model.mergeSources().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationMergeProperties model = new ReservationMergeProperties().withMergeDestination("zcxtbzsgfyccsn") - .withMergeSources(Arrays.asList("dwzjeiach", "oosflnr", "sfqpteehz", "vypyqrimzinpv")); - model = BinaryData.fromObject(model).toObject(ReservationMergeProperties.class); - Assertions.assertEquals("zcxtbzsgfyccsn", model.mergeDestination()); - Assertions.assertEquals("dwzjeiach", model.mergeSources().get(0)); + Assertions.assertEquals("c", model.mergeDestination()); + Assertions.assertEquals("fovgmkqsleyyvxy", model.mergeSources().get(0)); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersChangeDirectoryWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersChangeDirectoryWithResponseMockTests.java index 942d99ffc5c7..21d79f1c8dc2 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersChangeDirectoryWithResponseMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationOrdersChangeDirectoryWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.reservations.ReservationsManager; import com.azure.resourcemanager.reservations.models.ChangeDirectoryRequest; @@ -22,27 +22,27 @@ public final class ReservationOrdersChangeDirectoryWithResponseMockTests { @Test public void testChangeDirectoryWithResponse() throws Exception { String responseStr - = "{\"reservationOrder\":{\"id\":\"epn\",\"name\":\"jcrxgibbdaxcon\",\"isSucceeded\":false,\"error\":\"uors\"},\"reservations\":[{\"id\":\"wbqpl\",\"name\":\"vnuuepzl\",\"isSucceeded\":false,\"error\":\"zsoldwey\"},{\"id\":\"dunvmnnrwrbiorkt\",\"name\":\"ywjhhgdnhx\",\"isSucceeded\":true,\"error\":\"fomiloxgg\"}]}"; + = "{\"reservationOrder\":{\"id\":\"sdshmkxmaehvb\",\"name\":\"uripltfnhtba\",\"isSucceeded\":false,\"error\":\"ywrckp\"},\"reservations\":[{\"id\":\"hpluodpvruudlg\",\"name\":\"bth\",\"isSucceeded\":false,\"error\":\"ktst\"},{\"id\":\"xeclzedqbcvhzlhp\",\"name\":\"dqkdlwwqfbu\",\"isSucceeded\":false,\"error\":\"trqjfsmlmbtx\"},{\"id\":\"gfwsrtaw\",\"name\":\"ezbrhubskh\",\"isSucceeded\":false,\"error\":\"oookkqfq\"},{\"id\":\"vleo\",\"name\":\"ml\",\"isSucceeded\":true,\"error\":\"qzfavyv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ReservationsManager manager = ReservationsManager.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)); ChangeDirectoryResponse response = manager.reservationOrders() - .changeDirectoryWithResponse("duvwpklvxwmygd", - new ChangeDirectoryRequest().withDestinationTenantId("gpqch"), com.azure.core.util.Context.NONE) + .changeDirectoryWithResponse("kwcf", new ChangeDirectoryRequest().withDestinationTenantId("ljyxgtczhe"), + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("epn", response.reservationOrder().id()); - Assertions.assertEquals("jcrxgibbdaxcon", response.reservationOrder().name()); - Assertions.assertEquals(false, response.reservationOrder().isSucceeded()); - Assertions.assertEquals("uors", response.reservationOrder().error()); - Assertions.assertEquals("wbqpl", response.reservations().get(0).id()); - Assertions.assertEquals("vnuuepzl", response.reservations().get(0).name()); - Assertions.assertEquals(false, response.reservations().get(0).isSucceeded()); - Assertions.assertEquals("zsoldwey", response.reservations().get(0).error()); + Assertions.assertEquals("sdshmkxmaehvb", response.reservationOrder().id()); + Assertions.assertEquals("uripltfnhtba", response.reservationOrder().name()); + Assertions.assertFalse(response.reservationOrder().isSucceeded()); + Assertions.assertEquals("ywrckp", response.reservationOrder().error()); + Assertions.assertEquals("hpluodpvruudlg", response.reservations().get(0).id()); + Assertions.assertEquals("bth", response.reservations().get(0).name()); + Assertions.assertFalse(response.reservations().get(0).isSucceeded()); + Assertions.assertEquals("ktst", response.reservations().get(0).error()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSplitPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSplitPropertiesTests.java index dad18a090f0a..e51f6aebc842 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSplitPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSplitPropertiesTests.java @@ -1,31 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.models.ReservationSplitProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ReservationSplitPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ReservationSplitProperties model - = BinaryData.fromString("{\"splitDestinations\":[\"mijcmmxdcufufs\"],\"splitSource\":\"ymzidn\"}") - .toObject(ReservationSplitProperties.class); - Assertions.assertEquals("mijcmmxdcufufs", model.splitDestinations().get(0)); - Assertions.assertEquals("ymzidn", model.splitSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSplitProperties model - = new ReservationSplitProperties().withSplitDestinations(Arrays.asList("mijcmmxdcufufs")) - .withSplitSource("ymzidn"); - model = BinaryData.fromObject(model).toObject(ReservationSplitProperties.class); - Assertions.assertEquals("mijcmmxdcufufs", model.splitDestinations().get(0)); - Assertions.assertEquals("ymzidn", model.splitSource()); + ReservationSplitProperties model = BinaryData + .fromString( + "{\"splitDestinations\":[\"ybcibvyvdcsit\",\"nnaamdectehfiqsc\"],\"splitSource\":\"ypvhezrkg\"}") + .toObject(ReservationSplitProperties.class); + Assertions.assertEquals("ybcibvyvdcsit", model.splitDestinations().get(0)); + Assertions.assertEquals("ypvhezrkg", model.splitSource()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSummaryTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSummaryTests.java index af835903d9d5..af0ea2033881 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSummaryTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSummaryTests.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.reservations.generated; @@ -11,13 +11,7 @@ public final class ReservationSummaryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReservationSummary model = BinaryData.fromString( - "{\"succeededCount\":65.17869,\"failedCount\":88.90607,\"expiringCount\":91.838905,\"expiredCount\":63.2669,\"pendingCount\":91.96146,\"cancelledCount\":32.27721,\"processingCount\":29.596352,\"warningCount\":21.768867,\"noBenefitCount\":31.161303}") + "{\"succeededCount\":26.122677,\"failedCount\":87.8571,\"expiringCount\":17.03214,\"expiredCount\":66.0326,\"pendingCount\":4.213333,\"cancelledCount\":1.9824147,\"processingCount\":51.820545,\"warningCount\":16.159456,\"noBenefitCount\":62.93017}") .toObject(ReservationSummary.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSummary model = new ReservationSummary(); - model = BinaryData.fromObject(model).toObject(ReservationSummary.class); - } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSwapPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSwapPropertiesTests.java index 008d95821b68..a6441aa6a6e9 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSwapPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationSwapPropertiesTests.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.reservations.generated; @@ -12,18 +12,9 @@ public final class ReservationSwapPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReservationSwapProperties model - = BinaryData.fromString("{\"swapSource\":\"jdkirsoodqx\",\"swapDestination\":\"rmnohj\"}") + = BinaryData.fromString("{\"swapSource\":\"rcczsqpjhvmd\",\"swapDestination\":\"v\"}") .toObject(ReservationSwapProperties.class); - Assertions.assertEquals("jdkirsoodqx", model.swapSource()); - Assertions.assertEquals("rmnohj", model.swapDestination()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSwapProperties model - = new ReservationSwapProperties().withSwapSource("jdkirsoodqx").withSwapDestination("rmnohj"); - model = BinaryData.fromObject(model).toObject(ReservationSwapProperties.class); - Assertions.assertEquals("jdkirsoodqx", model.swapSource()); - Assertions.assertEquals("rmnohj", model.swapDestination()); + Assertions.assertEquals("rcczsqpjhvmd", model.swapSource()); + Assertions.assertEquals("v", model.swapDestination()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationToReturnTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationToReturnTests.java index c025e4d75d27..06d70725ddad 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationToReturnTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationToReturnTests.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.reservations.generated; @@ -11,19 +11,17 @@ public final class ReservationToReturnTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ReservationToReturn model - = BinaryData.fromString("{\"reservationId\":\"pukgriwflzlfb\",\"quantity\":599393599}") - .toObject(ReservationToReturn.class); - Assertions.assertEquals("pukgriwflzlfb", model.reservationId()); - Assertions.assertEquals(599393599, model.quantity()); + ReservationToReturn model = BinaryData.fromString("{\"reservationId\":\"dzyexznelixh\",\"quantity\":417791826}") + .toObject(ReservationToReturn.class); + Assertions.assertEquals("dzyexznelixh", model.reservationId()); + Assertions.assertEquals(417791826, model.quantity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ReservationToReturn model - = new ReservationToReturn().withReservationId("pukgriwflzlfb").withQuantity(599393599); + ReservationToReturn model = new ReservationToReturn().withReservationId("dzyexznelixh").withQuantity(417791826); model = BinaryData.fromObject(model).toObject(ReservationToReturn.class); - Assertions.assertEquals("pukgriwflzlfb", model.reservationId()); - Assertions.assertEquals(599393599, model.quantity()); + Assertions.assertEquals("dzyexznelixh", model.reservationId()); + Assertions.assertEquals(417791826, model.quantity()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationUtilizationAggregatesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationUtilizationAggregatesTests.java index ab1950ee097b..95de93ef2e43 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationUtilizationAggregatesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationUtilizationAggregatesTests.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.reservations.generated; @@ -11,14 +11,7 @@ public final class ReservationUtilizationAggregatesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReservationUtilizationAggregates model = BinaryData - .fromString( - "{\"grain\":88.15669,\"grainUnit\":\"npzaoq\",\"value\":97.4391,\"valueUnit\":\"hcffcyddglmjthjq\"}") + .fromString("{\"grain\":53.199524,\"grainUnit\":\"w\",\"value\":17.096388,\"valueUnit\":\"nmmqhgyxzkon\"}") .toObject(ReservationUtilizationAggregates.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationUtilizationAggregates model = new ReservationUtilizationAggregates(); - model = BinaryData.fromObject(model).toObject(ReservationUtilizationAggregates.class); - } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsArchiveWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsArchiveWithResponseMockTests.java index 202d35603875..70884927f7c0 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsArchiveWithResponseMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsArchiveWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.reservations.ReservationsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testArchiveWithResponse() throws Exception { ReservationsManager manager = ReservationsManager.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)); - manager.reservations().archiveWithResponse("h", "qknfd", com.azure.core.util.Context.NONE); + manager.reservations().archiveWithResponse("eozphv", "auyqncygupkv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsAvailableScopesMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsAvailableScopesMockTests.java index e83554080490..d50d3896b3e6 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsAvailableScopesMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsAvailableScopesMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.reservations.ReservationsManager; import com.azure.resourcemanager.reservations.models.AvailableScopeProperties; @@ -23,23 +23,22 @@ public final class ReservationsAvailableScopesMockTests { @Test public void testAvailableScopes() throws Exception { - String responseStr - = "{\"properties\":{\"scopes\":[{\"scope\":\"ofel\",\"valid\":true},{\"scope\":\"qmqhldvriii\",\"valid\":true},{\"scope\":\"lg\",\"valid\":true}]}}"; + String responseStr = "{\"properties\":{\"scopes\":[{\"scope\":\"tedltmmj\",\"valid\":true}]}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ReservationsManager manager = ReservationsManager.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)); AvailableScopeProperties response = manager.reservations() - .availableScopes("irgzp", "rlazszrnw", - new AvailableScopeRequest().withProperties( - new AvailableScopeRequestProperties().withScopes(Arrays.asList("dfpwpjylwbtlhfls", "cdhszf"))), + .availableScopes("nfaazpxdtnkdmkq", "jlwuenvrkp", + new AvailableScopeRequest().withProperties(new AvailableScopeRequestProperties() + .withScopes(Arrays.asList("ibreb", "aays", "kixqtnqtt", "zlwfffiakp"))), com.azure.core.util.Context.NONE); - Assertions.assertEquals("ofel", response.properties().scopes().get(0).scope()); - Assertions.assertEquals(true, response.properties().scopes().get(0).valid()); + Assertions.assertEquals("tedltmmj", response.properties().scopes().get(0).scope()); + Assertions.assertTrue(response.properties().scopes().get(0).valid()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsPropertiesUtilizationTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsPropertiesUtilizationTests.java index 03345c713f32..fadd0d6f85b4 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsPropertiesUtilizationTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsPropertiesUtilizationTests.java @@ -1,26 +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.reservations.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ReservationUtilizationAggregates; import com.azure.resourcemanager.reservations.models.ReservationsPropertiesUtilization; -import java.util.Arrays; public final class ReservationsPropertiesUtilizationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReservationsPropertiesUtilization model = BinaryData.fromString( - "{\"trend\":\"sycbkbfk\",\"aggregates\":[{\"grain\":47.4825,\"grainUnit\":\"xxppofm\",\"value\":3.7147582,\"valueUnit\":\"fjpgddtocjjxhvp\"},{\"grain\":41.112267,\"grainUnit\":\"xhdzxibqeojnx\",\"value\":96.80261,\"valueUnit\":\"ddntwndei\"}]}") + "{\"trend\":\"pbuxwgipwhon\",\"aggregates\":[{\"grain\":86.52048,\"grainUnit\":\"wankixzbi\",\"value\":93.49366,\"valueUnit\":\"uttmrywnuzoqft\"},{\"grain\":81.39922,\"grainUnit\":\"rnkcqvyxlw\",\"value\":73.18531,\"valueUnit\":\"icohoqqnwvl\"}]}") .toObject(ReservationsPropertiesUtilization.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationsPropertiesUtilization model = new ReservationsPropertiesUtilization().withAggregates( - Arrays.asList(new ReservationUtilizationAggregates(), new ReservationUtilizationAggregates())); - model = BinaryData.fromObject(model).toObject(ReservationsPropertiesUtilization.class); - } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsUnarchiveWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsUnarchiveWithResponseMockTests.java index 17fcceaf935f..97b671f85fed 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsUnarchiveWithResponseMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ReservationsUnarchiveWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.reservations.ReservationsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testUnarchiveWithResponse() throws Exception { ReservationsManager manager = ReservationsManager.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)); - manager.reservations().unarchiveWithResponse("twjchrdg", "ihxumwctondzj", com.azure.core.util.Context.NONE); + manager.reservations().unarchiveWithResponse("p", "dscwxqupevzhf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceNameTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceNameTests.java index 59f0d79475b4..335b572672d7 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceNameTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceNameTests.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.reservations.generated; @@ -11,15 +11,15 @@ public final class ResourceNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceName model - = BinaryData.fromString("{\"value\":\"ok\",\"localizedValue\":\"llxdyhgs\"}").toObject(ResourceName.class); - Assertions.assertEquals("ok", model.value()); + ResourceName model = BinaryData.fromString("{\"value\":\"dlikwyqkgfgibma\",\"localizedValue\":\"akeqs\"}") + .toObject(ResourceName.class); + Assertions.assertEquals("dlikwyqkgfgibma", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceName model = new ResourceName().withValue("ok"); + ResourceName model = new ResourceName().withValue("dlikwyqkgfgibma"); model = BinaryData.fromObject(model).toObject(ResourceName.class); - Assertions.assertEquals("ok", model.value()); + Assertions.assertEquals("dlikwyqkgfgibma", model.value()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceProvidersGetAppliedReservationListWithResponseMockTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceProvidersGetAppliedReservationListWithResponseMockTests.java index b7823800d2c3..b4b68f22fa8c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceProvidersGetAppliedReservationListWithResponseMockTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ResourceProvidersGetAppliedReservationListWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.reservations.ReservationsManager; import com.azure.resourcemanager.reservations.models.AppliedReservations; @@ -21,20 +21,20 @@ public final class ResourceProvidersGetAppliedReservationListWithResponseMockTes @Test public void testGetAppliedReservationListWithResponse() throws Exception { String responseStr - = "{\"id\":\"t\",\"name\":\"rtwnawjslbi\",\"type\":\"ojgcyzt\",\"properties\":{\"reservationOrderIds\":{\"value\":[\"baeqphc\",\"qnrnrpxehuwryk\",\"gaifmvik\"],\"nextLink\":\"ydv\"}}}"; + = "{\"id\":\"kzclewyh\",\"name\":\"wp\",\"type\":\"tzpofncckwyfzq\",\"properties\":{\"reservationOrderIds\":{\"value\":[\"uyqaxzfeqztppr\"],\"nextLink\":\"lxorjaltolmncws\"}}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); ReservationsManager manager = ReservationsManager.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)); AppliedReservations response = manager.resourceProviders() - .getAppliedReservationListWithResponse("fceacvlhvygd", com.azure.core.util.Context.NONE) + .getAppliedReservationListWithResponse("nqicvinvkjjxdxrb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("baeqphc", response.reservationOrderIds().value().get(0)); - Assertions.assertEquals("ydv", response.reservationOrderIds().nextLink()); + Assertions.assertEquals("uyqaxzfeqztppr", response.reservationOrderIds().value().get(0)); + Assertions.assertEquals("lxorjaltolmncws", response.reservationOrderIds().nextLink()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ScopePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ScopePropertiesTests.java index 114adfd6a779..4e229ef0b096 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ScopePropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/ScopePropertiesTests.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.reservations.generated; @@ -12,16 +12,8 @@ public final class ScopePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScopeProperties model - = BinaryData.fromString("{\"scope\":\"nq\",\"valid\":true}").toObject(ScopeProperties.class); - Assertions.assertEquals("nq", model.scope()); - Assertions.assertEquals(true, model.valid()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScopeProperties model = new ScopeProperties().withScope("nq").withValid(true); - model = BinaryData.fromObject(model).toObject(ScopeProperties.class); - Assertions.assertEquals("nq", model.scope()); - Assertions.assertEquals(true, model.valid()); + = BinaryData.fromString("{\"scope\":\"ocqxtccmg\",\"valid\":false}").toObject(ScopeProperties.class); + Assertions.assertEquals("ocqxtccmg", model.scope()); + Assertions.assertFalse(model.valid()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuCapabilityTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuCapabilityTests.java index d0d411404f9a..bf4011f96f49 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuCapabilityTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuCapabilityTests.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.reservations.generated; @@ -12,16 +12,8 @@ public final class SkuCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuCapability model - = BinaryData.fromString("{\"name\":\"ilzyd\",\"value\":\"o\"}").toObject(SkuCapability.class); - Assertions.assertEquals("ilzyd", model.name()); - Assertions.assertEquals("o", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapability model = new SkuCapability().withName("ilzyd").withValue("o"); - model = BinaryData.fromObject(model).toObject(SkuCapability.class); - Assertions.assertEquals("ilzyd", model.name()); - Assertions.assertEquals("o", model.value()); + = BinaryData.fromString("{\"name\":\"fwvuk\",\"value\":\"audccsnhs\"}").toObject(SkuCapability.class); + Assertions.assertEquals("fwvuk", model.name()); + Assertions.assertEquals("audccsnhs", model.value()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuNameTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuNameTests.java index f56c2e39dd9f..c39b6419f1db 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuNameTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuNameTests.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.reservations.generated; @@ -11,14 +11,14 @@ public final class SkuNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SkuName model = BinaryData.fromString("{\"name\":\"ubljofxqe\"}").toObject(SkuName.class); - Assertions.assertEquals("ubljofxqe", model.name()); + SkuName model = BinaryData.fromString("{\"name\":\"ur\"}").toObject(SkuName.class); + Assertions.assertEquals("ur", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SkuName model = new SkuName().withName("ubljofxqe"); + SkuName model = new SkuName().withName("ur"); model = BinaryData.fromObject(model).toObject(SkuName.class); - Assertions.assertEquals("ubljofxqe", model.name()); + Assertions.assertEquals("ur", model.name()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuPropertyTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuPropertyTests.java index 24f61804cd10..399e1d0c736f 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuPropertyTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SkuPropertyTests.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.reservations.generated; @@ -11,17 +11,9 @@ public final class SkuPropertyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SkuProperty model - = BinaryData.fromString("{\"name\":\"cnpqxuhivyqniwby\",\"value\":\"k\"}").toObject(SkuProperty.class); - Assertions.assertEquals("cnpqxuhivyqniwby", model.name()); - Assertions.assertEquals("k", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuProperty model = new SkuProperty().withName("cnpqxuhivyqniwby").withValue("k"); - model = BinaryData.fromObject(model).toObject(SkuProperty.class); - Assertions.assertEquals("cnpqxuhivyqniwby", model.name()); - Assertions.assertEquals("k", model.value()); + SkuProperty model = BinaryData.fromString("{\"name\":\"ijbpzvgnwzsymgl\",\"value\":\"fcyzkohdbihanufh\"}") + .toObject(SkuProperty.class); + Assertions.assertEquals("ijbpzvgnwzsymgl", model.name()); + Assertions.assertEquals("fcyzkohdbihanufh", model.value()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitPropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitPropertiesTests.java index 5d91f6cb54ed..1d09b62830ef 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitPropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitPropertiesTests.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.reservations.generated; @@ -12,18 +12,19 @@ public final class SplitPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SplitProperties model = BinaryData.fromString("{\"quantities\":[434685034],\"reservationId\":\"joghmewuama\"}") - .toObject(SplitProperties.class); - Assertions.assertEquals(434685034, model.quantities().get(0)); - Assertions.assertEquals("joghmewuama", model.reservationId()); + SplitProperties model + = BinaryData.fromString("{\"quantities\":[1710146471,328563559],\"reservationId\":\"rqjbhckfrl\"}") + .toObject(SplitProperties.class); + Assertions.assertEquals(1710146471, model.quantities().get(0)); + Assertions.assertEquals("rqjbhckfrl", model.reservationId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SplitProperties model - = new SplitProperties().withQuantities(Arrays.asList(434685034)).withReservationId("joghmewuama"); + SplitProperties model = new SplitProperties().withQuantities(Arrays.asList(1710146471, 328563559)) + .withReservationId("rqjbhckfrl"); model = BinaryData.fromObject(model).toObject(SplitProperties.class); - Assertions.assertEquals(434685034, model.quantities().get(0)); - Assertions.assertEquals("joghmewuama", model.reservationId()); + Assertions.assertEquals(1710146471, model.quantities().get(0)); + Assertions.assertEquals("rqjbhckfrl", model.reservationId()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitRequestTests.java index 8cecccfd026a..4c12579222e8 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitRequestTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SplitRequestTests.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.reservations.generated; @@ -12,20 +12,19 @@ public final class SplitRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SplitRequest model = BinaryData.fromString( - "{\"properties\":{\"quantities\":[1725264760,920917148,1516038621,1222275240],\"reservationId\":\"qciwqvhkhixuigdt\"}}") + SplitRequest model = BinaryData + .fromString("{\"properties\":{\"quantities\":[1436522503,1299171378],\"reservationId\":\"yrxvwfudwpznt\"}}") .toObject(SplitRequest.class); - Assertions.assertEquals(1725264760, model.quantities().get(0)); - Assertions.assertEquals("qciwqvhkhixuigdt", model.reservationId()); + Assertions.assertEquals(1436522503, model.quantities().get(0)); + Assertions.assertEquals("yrxvwfudwpznt", model.reservationId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SplitRequest model - = new SplitRequest().withQuantities(Arrays.asList(1725264760, 920917148, 1516038621, 1222275240)) - .withReservationId("qciwqvhkhixuigdt"); + SplitRequest model = new SplitRequest().withQuantities(Arrays.asList(1436522503, 1299171378)) + .withReservationId("yrxvwfudwpznt"); model = BinaryData.fromObject(model).toObject(SplitRequest.class); - Assertions.assertEquals(1725264760, model.quantities().get(0)); - Assertions.assertEquals("qciwqvhkhixuigdt", model.reservationId()); + Assertions.assertEquals(1436522503, model.quantities().get(0)); + Assertions.assertEquals("yrxvwfudwpznt", model.reservationId()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubRequestTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubRequestTests.java index 07e49a23541f..1a1c9a7e42f1 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubRequestTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubRequestTests.java @@ -1,12 +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.reservations.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.reservations.models.QuotaRequestState; -import com.azure.resourcemanager.reservations.models.ResourceName; import com.azure.resourcemanager.reservations.models.SubRequest; import org.junit.jupiter.api.Assertions; @@ -14,21 +13,10 @@ public final class SubRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SubRequest model = BinaryData.fromString( - "{\"limit\":1622767746,\"name\":{\"value\":\"nnqvsa\",\"localizedValue\":\"qntorudsgsahmkyc\"},\"resourceType\":\"auwjuetaebu\",\"unit\":\"vdmovsmzlxwabm\",\"provisioningState\":\"Accepted\",\"message\":\"kif\",\"subRequestId\":\"tpuqujmq\"}") + "{\"limit\":794319729,\"name\":{\"value\":\"tyhxhurokft\",\"localizedValue\":\"olniwpwcukjf\"},\"resourceType\":\"iawxklry\",\"unit\":\"wckbasyypnd\",\"provisioningState\":\"Failed\",\"message\":\"cbacphejkotynqg\",\"subRequestId\":\"l\"}") .toObject(SubRequest.class); - Assertions.assertEquals("nnqvsa", model.name().value()); - Assertions.assertEquals("vdmovsmzlxwabm", model.unit()); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubRequest model = new SubRequest().withName(new ResourceName().withValue("nnqvsa")) - .withUnit("vdmovsmzlxwabm") - .withProvisioningState(QuotaRequestState.ACCEPTED); - model = BinaryData.fromObject(model).toObject(SubRequest.class); - Assertions.assertEquals("nnqvsa", model.name().value()); - Assertions.assertEquals("vdmovsmzlxwabm", model.unit()); - Assertions.assertEquals(QuotaRequestState.ACCEPTED, model.provisioningState()); + Assertions.assertEquals("tyhxhurokft", model.name().value()); + Assertions.assertEquals("wckbasyypnd", model.unit()); + Assertions.assertEquals(QuotaRequestState.FAILED, model.provisioningState()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubscriptionScopePropertiesTests.java b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubscriptionScopePropertiesTests.java index e206310011f9..f57b999b105c 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubscriptionScopePropertiesTests.java +++ b/sdk/reservations/azure-resourcemanager-reservations/src/test/java/com/azure/resourcemanager/reservations/generated/SubscriptionScopePropertiesTests.java @@ -1,33 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.reservations.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.reservations.models.ScopeProperties; import com.azure.resourcemanager.reservations.models.SubscriptionScopeProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class SubscriptionScopePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SubscriptionScopeProperties model = BinaryData.fromString( - "{\"scopes\":[{\"scope\":\"qsoqijgkd\",\"valid\":true},{\"scope\":\"zlobcufpd\",\"valid\":false},{\"scope\":\"t\",\"valid\":true}]}") + "{\"scopes\":[{\"scope\":\"ermclfplphoxuscr\",\"valid\":false},{\"scope\":\"ye\",\"valid\":true},{\"scope\":\"tazqugxywpmueefj\",\"valid\":false},{\"scope\":\"kqujidsuyono\",\"valid\":true}]}") .toObject(SubscriptionScopeProperties.class); - Assertions.assertEquals("qsoqijgkd", model.scopes().get(0).scope()); - Assertions.assertEquals(true, model.scopes().get(0).valid()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubscriptionScopeProperties model = new SubscriptionScopeProperties() - .withScopes(Arrays.asList(new ScopeProperties().withScope("qsoqijgkd").withValid(true), - new ScopeProperties().withScope("zlobcufpd").withValid(false), - new ScopeProperties().withScope("t").withValid(true))); - model = BinaryData.fromObject(model).toObject(SubscriptionScopeProperties.class); - Assertions.assertEquals("qsoqijgkd", model.scopes().get(0).scope()); - Assertions.assertEquals(true, model.scopes().get(0).valid()); + Assertions.assertEquals("ermclfplphoxuscr", model.scopes().get(0).scope()); + Assertions.assertFalse(model.scopes().get(0).valid()); } } diff --git a/sdk/reservations/azure-resourcemanager-reservations/tsp-location.yaml b/sdk/reservations/azure-resourcemanager-reservations/tsp-location.yaml new file mode 100644 index 000000000000..c25e1555650e --- /dev/null +++ b/sdk/reservations/azure-resourcemanager-reservations/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/reservations/resource-manager/Microsoft.Capacity/Reservations +commit: 61ef1085014acf8197d8b44e9dec699ef635a750 +repo: Azure/azure-rest-api-specs +additionalDirectories: