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