scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Sets the retry policy to the HTTP pipeline.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * @param retryOptions the retry options for the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryOptions(RetryOptions retryOptions) {
+ this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval =
+ Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw LOGGER
+ .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of reservations service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @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.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.reservations")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
+ policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new ReservationsManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * 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.
+ *
+ * @return Resource collection API of ResourceProviders.
+ */
+ public ResourceProviders resourceProviders() {
+ if (this.resourceProviders == null) {
+ this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this);
+ }
+ return resourceProviders;
+ }
+
+ /**
+ * 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 Operations.
+ *
+ * @return Resource collection API of Operations.
+ */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /**
+ * Gets the resource collection API of CalculateRefunds.
+ *
+ * @return Resource collection API of CalculateRefunds.
+ */
+ public CalculateRefunds calculateRefunds() {
+ if (this.calculateRefunds == null) {
+ this.calculateRefunds = new CalculateRefundsImpl(clientObject.getCalculateRefunds(), this);
+ }
+ return calculateRefunds;
+ }
+
+ /**
+ * Gets the resource collection API of Returns.
+ *
+ * @return Resource collection API of Returns.
+ */
+ public Returns returns() {
+ if (this.returns == null) {
+ this.returns = new ReturnsImpl(clientObject.getReturns(), this);
+ }
+ return returns;
+ }
+
+ /**
+ * Gets the resource collection API of CalculateExchanges.
+ *
+ * @return Resource collection API of CalculateExchanges.
+ */
+ public CalculateExchanges calculateExchanges() {
+ if (this.calculateExchanges == null) {
+ this.calculateExchanges = new CalculateExchangesImpl(clientObject.getCalculateExchanges(), this);
+ }
+ return calculateExchanges;
+ }
+
+ /**
+ * Gets the resource collection API of Exchanges.
+ *
+ * @return Resource collection API of Exchanges.
+ */
+ public Exchanges exchanges() {
+ if (this.exchanges == null) {
+ this.exchanges = new ExchangesImpl(clientObject.getExchanges(), this);
+ }
+ return 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;
+ }
+
+ /**
+ * @return Wrapped service client AzureReservationApi providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ */
+ public AzureReservationApi serviceClient() {
+ return this.clientObject;
+ }
+}
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/AzureReservationApi.java
new file mode 100644
index 0000000000000..5827e38e19a20
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/AzureReservationApi.java
@@ -0,0 +1,102 @@
+// 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;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for AzureReservationApi class. */
+public interface AzureReservationApi {
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the ReservationsClient object to access its operations.
+ *
+ * @return the ReservationsClient object.
+ */
+ ReservationsClient getReservations();
+
+ /**
+ * Gets the ResourceProvidersClient object to access its operations.
+ *
+ * @return the ResourceProvidersClient object.
+ */
+ ResourceProvidersClient getResourceProviders();
+
+ /**
+ * Gets the ReservationOrdersClient object to access its operations.
+ *
+ * @return the ReservationOrdersClient object.
+ */
+ ReservationOrdersClient getReservationOrders();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the CalculateRefundsClient object to access its operations.
+ *
+ * @return the CalculateRefundsClient object.
+ */
+ CalculateRefundsClient getCalculateRefunds();
+
+ /**
+ * Gets the ReturnsClient object to access its operations.
+ *
+ * @return the ReturnsClient object.
+ */
+ ReturnsClient getReturns();
+
+ /**
+ * Gets the CalculateExchangesClient object to access its operations.
+ *
+ * @return the CalculateExchangesClient object.
+ */
+ CalculateExchangesClient getCalculateExchanges();
+
+ /**
+ * Gets the ExchangesClient object to access its operations.
+ *
+ * @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/CalculateExchangesClient.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateExchangesClient.java
new file mode 100644
index 0000000000000..7750eccc5c15b
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateExchangesClient.java
@@ -0,0 +1,76 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.reservations.fluent.models.CalculateExchangeOperationResultResponseInner;
+import com.azure.resourcemanager.reservations.models.CalculateExchangeRequest;
+
+/** An instance of this class provides access to all the operations defined in CalculateExchangesClient. */
+public interface CalculateExchangesClient {
+ /**
+ * 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.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CalculateExchangeOperationResultResponseInner>
+ beginPost(CalculateExchangeRequest body);
+
+ /**
+ * 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 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CalculateExchangeOperationResultResponseInner>
+ beginPost(CalculateExchangeRequest body, Context context);
+
+ /**
+ * 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.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CalculateExchangeOperationResultResponseInner post(CalculateExchangeRequest body);
+
+ /**
+ * 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 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.
+ */
+ @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
new file mode 100644
index 0000000000000..1d619edbb58ad
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/CalculateRefundsClient.java
@@ -0,0 +1,48 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.reservations.fluent.models.CalculateRefundResponseInner;
+import com.azure.resourcemanager.reservations.models.CalculateRefundRequest;
+
+/** An instance of this class provides access to all the operations defined in CalculateRefundsClient. */
+public interface CalculateRefundsClient {
+ /**
+ * 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 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 refund containing refund information of reservation along with {@link
+ * Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response postWithResponse(
+ String reservationOrderId, CalculateRefundRequest body, Context context);
+
+ /**
+ * 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.
+ * @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 refund containing refund information of reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CalculateRefundResponseInner post(String reservationOrderId, CalculateRefundRequest body);
+}
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
new file mode 100644
index 0000000000000..9b04e949c7a56
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ExchangesClient.java
@@ -0,0 +1,76 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.reservations.fluent.models.ExchangeOperationResultResponseInner;
+import com.azure.resourcemanager.reservations.models.ExchangeRequest;
+
+/** An instance of this class provides access to all the operations defined in ExchangesClient. */
+public interface ExchangesClient {
+ /**
+ * 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.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ExchangeOperationResultResponseInner> beginPost(
+ ExchangeRequest body);
+
+ /**
+ * 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 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ExchangeOperationResultResponseInner> beginPost(
+ ExchangeRequest body, Context context);
+
+ /**
+ * 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.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ExchangeOperationResultResponseInner post(ExchangeRequest body);
+
+ /**
+ * 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 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.
+ */
+ @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
new file mode 100644
index 0000000000000..0801c54ee1c85
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/OperationsClient.java
@@ -0,0 +1,40 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * Get operations.
+ *
+ *
List all the operations.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return paginated list of operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Get operations.
+ *
+ * List all the operations.
+ *
+ * @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 paginated list of 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
new file mode 100644
index 0000000000000..e501ac4c3eab6
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotaRequestStatusClient.java
@@ -0,0 +1,95 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner;
+
+/** An instance of this class provides access to all the operations defined in QuotaRequestStatusClient. */
+public interface QuotaRequestStatusClient {
+ /**
+ * 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 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 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 quota request details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String subscriptionId, String providerId, String location, String id, Context 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 providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param id Quota Request ID.
+ * @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 quota request details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ QuotaRequestDetailsInner get(String subscriptionId, String providerId, String location, String id);
+
+ /**
+ * 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 providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return quota request details as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String subscriptionId, String providerId, String location);
+
+ /**
+ * 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 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.
+ * @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 quota request details as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String subscriptionId,
+ String providerId,
+ String location,
+ String filter,
+ Integer top,
+ String skiptoken,
+ Context context);
+}
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
new file mode 100644
index 0000000000000..3fed2d893bbf1
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/QuotasClient.java
@@ -0,0 +1,295 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.reservations.fluent.models.CurrentQuotaLimitBaseInner;
+import com.azure.resourcemanager.reservations.models.QuotasGetResponse;
+
+/** An instance of this class provides access to all the operations defined in QuotasClient. */
+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 providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 current quota (service limit) and usage of a resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ QuotasGetResponse getWithResponse(
+ String subscriptionId, String providerId, String location, String resourceName, Context context);
+
+ /**
+ * Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to
+ * submit quota update request.
+ *
+ * @param subscriptionId Azure subscription ID.
+ * @param providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @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 current quota (service limit) and usage of a resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CurrentQuotaLimitBaseInner get(String subscriptionId, String providerId, String location, String resourceName);
+
+ /**
+ * Create or update the quota (service limits) of a resource to the requested value. Steps: 1. Make the Get request
+ * to get the quota information for specific resource. 2. To increase the quota, update the limit field in the
+ * response from Get request to new value. 3. Submit the JSON to the quota request API to update the quota. The
+ * Create quota request may be constructed as follows. The PUT operation can be used to update the quota.
+ *
+ * @param subscriptionId Azure subscription ID.
+ * @param providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @param createQuotaRequest Quota requests payload.
+ * @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 quota properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate(
+ String subscriptionId,
+ String providerId,
+ String location,
+ String resourceName,
+ CurrentQuotaLimitBaseInner createQuotaRequest);
+
+ /**
+ * Create or update the quota (service limits) of a resource to the requested value. Steps: 1. Make the Get request
+ * to get the quota information for specific resource. 2. To increase the quota, update the limit field in the
+ * response from Get request to new value. 3. Submit the JSON to the quota request API to update the quota. The
+ * Create quota request may be constructed as follows. The PUT operation can be used to update the quota.
+ *
+ * @param subscriptionId Azure subscription ID.
+ * @param providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @param createQuotaRequest Quota requests payload.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 quota properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate(
+ String subscriptionId,
+ String providerId,
+ String location,
+ String resourceName,
+ CurrentQuotaLimitBaseInner createQuotaRequest,
+ Context context);
+
+ /**
+ * Create or update the quota (service limits) of a resource to the requested value. Steps: 1. Make the Get request
+ * to get the quota information for specific resource. 2. To increase the quota, update the limit field in the
+ * response from Get request to new value. 3. Submit the JSON to the quota request API to update the quota. The
+ * Create quota request may be constructed as follows. The PUT operation can be used to update the quota.
+ *
+ * @param subscriptionId Azure subscription ID.
+ * @param providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @param createQuotaRequest Quota requests payload.
+ * @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 quota properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CurrentQuotaLimitBaseInner createOrUpdate(
+ String subscriptionId,
+ String providerId,
+ String location,
+ String resourceName,
+ CurrentQuotaLimitBaseInner createQuotaRequest);
+
+ /**
+ * Create or update the quota (service limits) of a resource to the requested value. Steps: 1. Make the Get request
+ * to get the quota information for specific resource. 2. To increase the quota, update the limit field in the
+ * response from Get request to new value. 3. Submit the JSON to the quota request API to update the quota. The
+ * Create quota request may be constructed as follows. The PUT operation can be used to update the quota.
+ *
+ * @param subscriptionId Azure subscription ID.
+ * @param providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @param createQuotaRequest Quota requests payload.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 quota properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CurrentQuotaLimitBaseInner createOrUpdate(
+ String subscriptionId,
+ String providerId,
+ String location,
+ String resourceName,
+ CurrentQuotaLimitBaseInner createQuotaRequest,
+ Context context);
+
+ /**
+ * Update the quota (service limits) of this resource to the requested value. • To get the quota information for
+ * specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a
+ * new value. • To update the quota value, submit the JSON response to the quota request API to update the quota. •
+ * To update the quota. use the PATCH operation.
+ *
+ * @param subscriptionId Azure subscription ID.
+ * @param providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @param createQuotaRequest Payload for the quota request.
+ * @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 quota properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate(
+ String subscriptionId,
+ String providerId,
+ String location,
+ String resourceName,
+ CurrentQuotaLimitBaseInner createQuotaRequest);
+
+ /**
+ * Update the quota (service limits) of this resource to the requested value. • To get the quota information for
+ * specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a
+ * new value. • To update the quota value, submit the JSON response to the quota request API to update the quota. •
+ * To update the quota. use the PATCH operation.
+ *
+ * @param subscriptionId Azure subscription ID.
+ * @param providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @param createQuotaRequest Payload for the quota request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 quota properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate(
+ String subscriptionId,
+ String providerId,
+ String location,
+ String resourceName,
+ CurrentQuotaLimitBaseInner createQuotaRequest,
+ Context context);
+
+ /**
+ * Update the quota (service limits) of this resource to the requested value. • To get the quota information for
+ * specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a
+ * new value. • To update the quota value, submit the JSON response to the quota request API to update the quota. •
+ * To update the quota. use the PATCH operation.
+ *
+ * @param subscriptionId Azure subscription ID.
+ * @param providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @param createQuotaRequest Payload for the quota request.
+ * @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 quota properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CurrentQuotaLimitBaseInner update(
+ String subscriptionId,
+ String providerId,
+ String location,
+ String resourceName,
+ CurrentQuotaLimitBaseInner createQuotaRequest);
+
+ /**
+ * Update the quota (service limits) of this resource to the requested value. • To get the quota information for
+ * specific resource, send a GET request. • To increase the quota, update the limit field from the GET response to a
+ * new value. • To update the quota value, submit the JSON response to the quota request API to update the quota. •
+ * To update the quota. use the PATCH operation.
+ *
+ * @param subscriptionId Azure subscription ID.
+ * @param providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param resourceName The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or
+ * TotalLowPriorityCores for Microsoft.MachineLearningServices.
+ * @param createQuotaRequest Payload for the quota request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 quota properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CurrentQuotaLimitBaseInner update(
+ String subscriptionId,
+ String providerId,
+ String location,
+ String resourceName,
+ CurrentQuotaLimitBaseInner createQuotaRequest,
+ Context context);
+
+ /**
+ * 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 providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of current quotas (service limits) and usage for all resources as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String subscriptionId, String providerId, String location);
+
+ /**
+ * 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 providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of current quotas (service limits) and usage for all resources as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String subscriptionId, String providerId, String location, Context context);
+}
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
new file mode 100644
index 0000000000000..b5aad39a08d5a
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationOrdersClient.java
@@ -0,0 +1,202 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.reservations.fluent.models.CalculatePriceResponseInner;
+import com.azure.resourcemanager.reservations.fluent.models.ChangeDirectoryResponseInner;
+import com.azure.resourcemanager.reservations.fluent.models.ReservationOrderResponseInner;
+import com.azure.resourcemanager.reservations.models.ChangeDirectoryRequest;
+import com.azure.resourcemanager.reservations.models.PurchaseRequest;
+
+/** An instance of this class provides access to all the operations defined in ReservationOrdersClient. */
+public interface ReservationOrdersClient {
+ /**
+ * Calculate price for a `ReservationOrder`.
+ *
+ * Calculate price for placing a `ReservationOrder`.
+ *
+ * @param body Information needed for calculate or purchase reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 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.
+ */
+ @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();
+
+ /**
+ * Get all `ReservationOrder`s.
+ *
+ * List of all the `ReservationOrder`s that the user has access to in the current tenant.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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(Context context);
+
+ /**
+ * Purchase `ReservationOrder`
+ *
+ * Purchase `ReservationOrder` and create resource under the specified URI.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for calculate or purchase reservation.
+ * @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 details of a reservation order being returned.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ReservationOrderResponseInner> beginPurchase(
+ String reservationOrderId, PurchaseRequest body);
+
+ /**
+ * Purchase `ReservationOrder`
+ *
+ * Purchase `ReservationOrder` and create resource under the specified URI.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for calculate or purchase reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 details of a reservation order being returned.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ReservationOrderResponseInner> beginPurchase(
+ String reservationOrderId, PurchaseRequest body, Context context);
+
+ /**
+ * Purchase `ReservationOrder`
+ *
+ * Purchase `ReservationOrder` and create resource under the specified URI.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for calculate or purchase reservation.
+ * @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 details of a reservation order being returned.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ReservationOrderResponseInner purchase(String reservationOrderId, PurchaseRequest body);
+
+ /**
+ * Purchase `ReservationOrder`
+ *
+ *
Purchase `ReservationOrder` and create resource under the specified URI.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for calculate or purchase reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 details of a reservation order being returned.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ReservationOrderResponseInner purchase(String reservationOrderId, PurchaseRequest body, Context context);
+
+ /**
+ * Get a specific `ReservationOrder`.
+ *
+ *
Get the details of the `ReservationOrder`.
+ *
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String reservationOrderId, String expand, Context context);
+
+ /**
+ * Get a specific `ReservationOrder`.
+ *
+ * Get the details of the `ReservationOrder`.
+ *
+ * @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 the details of the `ReservationOrder`.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ReservationOrderResponseInner get(String reservationOrderId);
+
+ /**
+ * Change directory of `ReservationOrder`.
+ *
+ *
Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed to change directory of reservation order.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 change directory response along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response changeDirectoryWithResponse(
+ String reservationOrderId, ChangeDirectoryRequest body, Context context);
+
+ /**
+ * Change directory of `ReservationOrder`.
+ *
+ * Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed to change directory of reservation order.
+ * @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 change directory response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ChangeDirectoryResponseInner changeDirectory(String reservationOrderId, ChangeDirectoryRequest 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
new file mode 100644
index 0000000000000..bda9c3ba02f4f
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReservationsClient.java
@@ -0,0 +1,494 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.reservations.fluent.models.AvailableScopePropertiesInner;
+import com.azure.resourcemanager.reservations.fluent.models.ReservationResponseInner;
+import com.azure.resourcemanager.reservations.models.AvailableScopeRequest;
+import com.azure.resourcemanager.reservations.models.MergeRequest;
+import com.azure.resourcemanager.reservations.models.PatchModel;
+import com.azure.resourcemanager.reservations.models.SplitRequest;
+import java.util.List;
+
+/** An instance of this class provides access to all the operations defined in ReservationsClient. */
+public interface ReservationsClient {
+ /**
+ * Get Available Scopes for `Reservation`.
+ *
+ *
Check whether the scopes from request is valid for `Reservation`.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param reservationId Id of the reservation item.
+ * @param body Scopes to be checked for eligibility.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of the response of available scope api containing scopes and their
+ * eligibilities.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AvailableScopePropertiesInner> beginAvailableScopes(
+ String reservationOrderId, String reservationId, AvailableScopeRequest body);
+
+ /**
+ * Get Available Scopes for `Reservation`.
+ *
+ * Check whether the scopes from request is valid for `Reservation`.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param reservationId Id of the reservation item.
+ * @param body Scopes to be checked for eligibility.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of the response of available scope api containing scopes and their
+ * eligibilities.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AvailableScopePropertiesInner> beginAvailableScopes(
+ String reservationOrderId, String reservationId, AvailableScopeRequest body, Context context);
+
+ /**
+ * Get Available Scopes for `Reservation`.
+ *
+ * Check whether the scopes from request is valid for `Reservation`.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param reservationId Id of the reservation item.
+ * @param body Scopes to be checked for eligibility.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of available scope api containing scopes and their eligibilities.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AvailableScopePropertiesInner availableScopes(
+ String reservationOrderId, String reservationId, AvailableScopeRequest body);
+
+ /**
+ * Get Available Scopes for `Reservation`.
+ *
+ *
Check whether the scopes from request is valid for `Reservation`.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param reservationId Id of the reservation item.
+ * @param body Scopes to be checked for eligibility.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of available scope api containing scopes and their eligibilities.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AvailableScopePropertiesInner availableScopes(
+ String reservationOrderId, String reservationId, AvailableScopeRequest body, Context context);
+
+ /**
+ * Split the `Reservation`.
+ *
+ *
Split a `Reservation` into two `Reservation`s with specified quantity distribution.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed to Split a reservation item.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller>, List> beginSplit(
+ String reservationOrderId, SplitRequest body);
+
+ /**
+ * Split the `Reservation`.
+ *
+ * Split a `Reservation` into two `Reservation`s with specified quantity distribution.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed to Split a reservation item.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller>, List> beginSplit(
+ String reservationOrderId, SplitRequest body, Context context);
+
+ /**
+ * Split the `Reservation`.
+ *
+ * Split a `Reservation` into two `Reservation`s with specified quantity distribution.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed to Split a reservation item.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ List split(String reservationOrderId, SplitRequest body);
+
+ /**
+ * Split the `Reservation`.
+ *
+ * Split a `Reservation` into two `Reservation`s with specified quantity distribution.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed to Split a reservation item.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ List split(String reservationOrderId, SplitRequest body, Context context);
+
+ /**
+ * Merges two `Reservation`s.
+ *
+ * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have
+ * same properties.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for commercial request for a reservation.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller>, List> beginMerge(
+ String reservationOrderId, MergeRequest body);
+
+ /**
+ * Merges two `Reservation`s.
+ *
+ * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have
+ * same properties.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for commercial request for a reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller>, List> beginMerge(
+ String reservationOrderId, MergeRequest body, Context context);
+
+ /**
+ * Merges two `Reservation`s.
+ *
+ * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have
+ * same properties.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for commercial request for a reservation.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ List merge(String reservationOrderId, MergeRequest body);
+
+ /**
+ * Merges two `Reservation`s.
+ *
+ * Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have
+ * same properties.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for commercial request for a reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ List merge(String reservationOrderId, MergeRequest body, Context context);
+
+ /**
+ * Get `Reservation`s in a given reservation Order
+ *
+ * List `Reservation`s within a single `ReservationOrder`.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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);
+
+ /**
+ * Get `Reservation`s in a given reservation Order
+ *
+ * List `Reservation`s within a single `ReservationOrder`.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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);
+
+ /**
+ * Get `Reservation` details.
+ *
+ * Get specific `Reservation` details.
+ *
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String reservationOrderId, String reservationId, String expand, Context context);
+
+ /**
+ * Get `Reservation` details.
+ *
+ * Get specific `Reservation` details.
+ *
+ * @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);
+
+ /**
+ * Updates a `Reservation`.
+ *
+ *
Updates the applied scopes of 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ReservationResponseInner> beginUpdate(
+ String reservationOrderId, String reservationId, PatchModel parameters);
+
+ /**
+ * Updates a `Reservation`.
+ *
+ * Updates the applied scopes of 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ReservationResponseInner> beginUpdate(
+ String reservationOrderId, String reservationId, PatchModel parameters, Context context);
+
+ /**
+ * Updates a `Reservation`.
+ *
+ * Updates the applied scopes of 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 definition of the reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ReservationResponseInner update(String reservationOrderId, String reservationId, PatchModel parameters);
+
+ /**
+ * Updates a `Reservation`.
+ *
+ *
Updates the applied scopes of 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 definition of the reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ReservationResponseInner update(
+ String reservationOrderId, String reservationId, PatchModel parameters, Context context);
+
+ /**
+ * Archive a `Reservation`.
+ *
+ *
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 the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response archiveWithResponse(String reservationOrderId, String reservationId, Context context);
+
+ /**
+ * Archive a `Reservation`.
+ *
+ * Archiving a `Reservation` moves it to `Archived` state.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param reservationId Id of the reservation item.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void archive(String reservationOrderId, String reservationId);
+
+ /**
+ * Unarchive a `Reservation`.
+ *
+ *
Restores a `Reservation` to the state it was before archiving.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param reservationId Id of the reservation item.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response unarchiveWithResponse(String reservationOrderId, String reservationId, Context context);
+
+ /**
+ * Unarchive a `Reservation`.
+ *
+ * Restores a `Reservation` to the state it was before archiving.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param reservationId Id of the reservation item.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void unarchive(String reservationOrderId, String reservationId);
+
+ /**
+ * Get `Reservation` revisions.
+ *
+ *
List of all the revisions for the `Reservation`.
+ *
+ * @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 list of `Reservation`s as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listRevisions(String reservationOrderId, String reservationId);
+
+ /**
+ * Get `Reservation` revisions.
+ *
+ * List of all the revisions for the `Reservation`.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param reservationId Id of the reservation item.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of `Reservation`s as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listRevisions(
+ String reservationOrderId, String reservationId, Context context);
+
+ /**
+ * List the reservations and the roll up counts of reservations group by provisioning states 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 the list of reservations and summary of roll out count of reservations in each state as paginated
+ * response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAll();
+
+ /**
+ * List the reservations and the roll up counts of reservations group by provisioning states that the user has
+ * access to in the current tenant.
+ *
+ * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does
+ * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name,
+ * properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate,
+ * expiryDateTime, provisioningState, quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType,
+ * userFriendlyRenewState}.
+ * @param orderby May be used to sort order by reservation properties.
+ * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning
+ * states.
+ * @param skiptoken The number of reservations to skip from the list before returning results.
+ * @param selectedState The selected provisioning state.
+ * @param take To number of reservations to return.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of reservations and summary of roll out count of reservations in each state as paginated
+ * response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAll(
+ String filter,
+ String orderby,
+ String refreshSummary,
+ Float skiptoken,
+ String selectedState,
+ Float take,
+ Context context);
+}
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
new file mode 100644
index 0000000000000..2165ff0d7cb3a
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ResourceProvidersClient.java
@@ -0,0 +1,95 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.reservations.fluent.models.AppliedReservationsInner;
+import com.azure.resourcemanager.reservations.fluent.models.CatalogInner;
+
+/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */
+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.
+ * @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 regions and skus that are available for RI purchase for the specified Azure subscription as paginated
+ * response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String subscriptionId);
+
+ /**
+ * Get the regions and skus that are available for RI purchase for the specified Azure subscription.
+ *
+ * @param subscriptionId Id of the subscription.
+ * @param reservedResourceType The type of the resource for which the skus should be provided.
+ * @param location Filters the skus based on the location specified in this parameter. This can be an Azure region
+ * or global.
+ * @param publisherId Publisher id used to get the third party products.
+ * @param offerId Offer id used to get the third party products.
+ * @param planId Plan id used to get the third party products.
+ * @param filter May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'.
+ * @param skip The number of reservations to skip from the list before returning results.
+ * @param take To number of reservations to return.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 regions and skus that are available for RI purchase for the specified Azure subscription as paginated
+ * response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String subscriptionId,
+ String reservedResourceType,
+ String location,
+ String publisherId,
+ String offerId,
+ String planId,
+ String filter,
+ Float skip,
+ Float take,
+ Context context);
+
+ /**
+ * Get list of applicable `Reservation`s.
+ *
+ * Get applicable `Reservation`s that are applied to this subscription or a resource group under this
+ * subscription.
+ *
+ * @param subscriptionId Id of the subscription.
+ * @param context The context to associate with this operation.
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getAppliedReservationListWithResponse(String subscriptionId, Context context);
+
+ /**
+ * Get list of applicable `Reservation`s.
+ *
+ * Get applicable `Reservation`s that are applied to this subscription or a resource group under this
+ * subscription.
+ *
+ * @param subscriptionId Id of the subscription.
+ * @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.
+ */
+ @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
new file mode 100644
index 0000000000000..bd3506601b40e
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/ReturnsClient.java
@@ -0,0 +1,82 @@
+// 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;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.reservations.fluent.models.RefundResponseInner;
+import com.azure.resourcemanager.reservations.models.RefundRequest;
+
+/** An instance of this class provides access to all the operations defined in ReturnsClient. */
+public interface ReturnsClient {
+ /**
+ * Return a reservation.
+ *
+ *
Return a reservation and get refund information.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for returning 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 SyncPoller} for polling of the response of refund request containing refund information of
+ * reservation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, RefundResponseInner> beginPost(
+ String reservationOrderId, RefundRequest body);
+
+ /**
+ * Return a reservation.
+ *
+ * Return a reservation and get refund information.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for returning reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 refund request containing refund information of
+ * reservation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, RefundResponseInner> beginPost(
+ String reservationOrderId, RefundRequest body, Context context);
+
+ /**
+ * Return a reservation.
+ *
+ * Return a reservation and get refund information.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for returning 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 refund request containing refund information of reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RefundResponseInner post(String reservationOrderId, RefundRequest body);
+
+ /**
+ * Return a reservation.
+ *
+ *
Return a reservation and get refund information.
+ *
+ * @param reservationOrderId Order Id of the reservation.
+ * @param body Information needed for returning reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 refund request containing refund information of reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RefundResponseInner post(String reservationOrderId, RefundRequest body, Context context);
+}
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
new file mode 100644
index 0000000000000..23be3cb1dfd4b
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsInner.java
@@ -0,0 +1,111 @@
+// 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.resourcemanager.reservations.models.AppliedReservationList;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The response for applied reservations api. */
+@Fluent
+public final class AppliedReservationsInner {
+ /*
+ * Identifier of the applied reservations
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /*
+ * Name of resource
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * Type of resource. "Microsoft.Capacity/AppliedReservations"
+ */
+ @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
+ private String type;
+
+ /*
+ * Properties for applied reservations returned
+ */
+ @JsonProperty(value = "properties")
+ private AppliedReservationsProperties innerProperties;
+
+ /** Creates an instance of AppliedReservationsInner class. */
+ public AppliedReservationsInner() {
+ }
+
+ /**
+ * Get the id property: Identifier of the applied reservations.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: Name of resource.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: Type of resource. "Microsoft.Capacity/AppliedReservations".
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the innerProperties property: Properties for applied reservations returned.
+ *
+ * @return the innerProperties value.
+ */
+ private AppliedReservationsProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the reservationOrderIds property: Paginated list of applied reservations.
+ *
+ * @return the reservationOrderIds value.
+ */
+ public AppliedReservationList reservationOrderIds() {
+ return this.innerProperties() == null ? null : this.innerProperties().reservationOrderIds();
+ }
+
+ /**
+ * Set the reservationOrderIds property: Paginated list of applied reservations.
+ *
+ * @param reservationOrderIds the reservationOrderIds value to set.
+ * @return the AppliedReservationsInner object itself.
+ */
+ public AppliedReservationsInner withReservationOrderIds(AppliedReservationList reservationOrderIds) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new AppliedReservationsProperties();
+ }
+ this.innerProperties().withReservationOrderIds(reservationOrderIds);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsProperties.java
new file mode 100644
index 0000000000000..5f880016fc976
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AppliedReservationsProperties.java
@@ -0,0 +1,54 @@
+// 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.resourcemanager.reservations.models.AppliedReservationList;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Properties for applied reservations returned. */
+@Fluent
+public final class AppliedReservationsProperties {
+ /*
+ * Paginated list of applied reservations
+ */
+ @JsonProperty(value = "reservationOrderIds")
+ private AppliedReservationList reservationOrderIds;
+
+ /** Creates an instance of AppliedReservationsProperties class. */
+ public AppliedReservationsProperties() {
+ }
+
+ /**
+ * Get the reservationOrderIds property: Paginated list of applied reservations.
+ *
+ * @return the reservationOrderIds value.
+ */
+ public AppliedReservationList reservationOrderIds() {
+ return this.reservationOrderIds;
+ }
+
+ /**
+ * Set the reservationOrderIds property: Paginated list of applied reservations.
+ *
+ * @param reservationOrderIds the reservationOrderIds value to set.
+ * @return the AppliedReservationsProperties object itself.
+ */
+ public AppliedReservationsProperties withReservationOrderIds(AppliedReservationList reservationOrderIds) {
+ this.reservationOrderIds = reservationOrderIds;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (reservationOrderIds() != null) {
+ reservationOrderIds().validate();
+ }
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AvailableScopePropertiesInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AvailableScopePropertiesInner.java
new file mode 100644
index 0000000000000..1f850dcefcb0f
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/AvailableScopePropertiesInner.java
@@ -0,0 +1,54 @@
+// 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.resourcemanager.reservations.models.SubscriptionScopeProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The response of available scope api containing scopes and their eligibilities. */
+@Fluent
+public final class AvailableScopePropertiesInner {
+ /*
+ * The scopes checked by the available scope api.
+ */
+ @JsonProperty(value = "properties")
+ private SubscriptionScopeProperties properties;
+
+ /** Creates an instance of AvailableScopePropertiesInner class. */
+ public AvailableScopePropertiesInner() {
+ }
+
+ /**
+ * Get the properties property: The scopes checked by the available scope api.
+ *
+ * @return the properties value.
+ */
+ public SubscriptionScopeProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The scopes checked by the available scope api.
+ *
+ * @param properties the properties value to set.
+ * @return the AvailableScopePropertiesInner object itself.
+ */
+ public AvailableScopePropertiesInner withProperties(SubscriptionScopeProperties 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();
+ }
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculateExchangeOperationResultResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculateExchangeOperationResultResponseInner.java
new file mode 100644
index 0000000000000..26dca5a2903d8
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculateExchangeOperationResultResponseInner.java
@@ -0,0 +1,166 @@
+// 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.resourcemanager.reservations.models.CalculateExchangeOperationResultStatus;
+import com.azure.resourcemanager.reservations.models.CalculateExchangeResponseProperties;
+import com.azure.resourcemanager.reservations.models.OperationResultError;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** CalculateExchange operation result. */
+@Fluent
+public final class CalculateExchangeOperationResultResponseInner {
+ /*
+ * It should match what is used to GET the operation result.
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /*
+ * It must match the last segment of the id field, and will typically be a GUID / system generated value.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * Status of the operation.
+ */
+ @JsonProperty(value = "status")
+ private CalculateExchangeOperationResultStatus status;
+
+ /*
+ * CalculateExchange response properties
+ */
+ @JsonProperty(value = "properties")
+ private CalculateExchangeResponseProperties properties;
+
+ /*
+ * Required if status == failed or status == canceled.
+ */
+ @JsonProperty(value = "error")
+ private OperationResultError error;
+
+ /** Creates an instance of CalculateExchangeOperationResultResponseInner class. */
+ public CalculateExchangeOperationResultResponseInner() {
+ }
+
+ /**
+ * Get the id property: It should match what is used to GET the operation result.
+ *
+ * @return the id value.
+ */
+ 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.
+ *
+ * @return the name value.
+ */
+ 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.
+ *
+ * @return the status value.
+ */
+ 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.
+ *
+ * @return the properties value.
+ */
+ 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.
+ *
+ * @return the error value.
+ */
+ 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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..e7420da3ba59d
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculatePriceResponseInner.java
@@ -0,0 +1,54 @@
+// 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.resourcemanager.reservations.models.CalculatePriceResponseProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The response of calculate price for reservation. */
+@Fluent
+public final class CalculatePriceResponseInner {
+ /*
+ * Properties for calculate price response
+ */
+ @JsonProperty(value = "properties")
+ private CalculatePriceResponseProperties properties;
+
+ /** Creates an instance of CalculatePriceResponseInner class. */
+ public CalculatePriceResponseInner() {
+ }
+
+ /**
+ * Get the properties property: Properties for calculate price response.
+ *
+ * @return the properties value.
+ */
+ public CalculatePriceResponseProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: Properties for calculate price response.
+ *
+ * @param properties the properties value to set.
+ * @return the CalculatePriceResponseInner object itself.
+ */
+ public CalculatePriceResponseInner withProperties(CalculatePriceResponseProperties 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();
+ }
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculateRefundResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculateRefundResponseInner.java
new file mode 100644
index 0000000000000..d41c5a3882d7d
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CalculateRefundResponseInner.java
@@ -0,0 +1,80 @@
+// 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.resourcemanager.reservations.models.RefundResponseProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The response of calculate refund containing refund information of reservation. */
+@Fluent
+public final class CalculateRefundResponseInner {
+ /*
+ * Fully qualified identifier of the reservation being returned
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /*
+ * The refund properties of reservation
+ */
+ @JsonProperty(value = "properties")
+ private RefundResponseProperties properties;
+
+ /** Creates an instance of CalculateRefundResponseInner class. */
+ public CalculateRefundResponseInner() {
+ }
+
+ /**
+ * 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 CalculateRefundResponseInner object itself.
+ */
+ public CalculateRefundResponseInner 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 CalculateRefundResponseInner object itself.
+ */
+ public CalculateRefundResponseInner 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();
+ }
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CatalogInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CatalogInner.java
new file mode 100644
index 0000000000000..bc8280fb52f9c
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CatalogInner.java
@@ -0,0 +1,222 @@
+// 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.resourcemanager.reservations.models.CatalogMsrp;
+import com.azure.resourcemanager.reservations.models.ReservationBillingPlan;
+import com.azure.resourcemanager.reservations.models.ReservationTerm;
+import com.azure.resourcemanager.reservations.models.SkuCapability;
+import com.azure.resourcemanager.reservations.models.SkuProperty;
+import com.azure.resourcemanager.reservations.models.SkuRestriction;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.Map;
+
+/** Product details of a type of resource. */
+@Fluent
+public final class CatalogInner {
+ /*
+ * The type of resource the sku applies to.
+ */
+ @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY)
+ private String resourceType;
+
+ /*
+ * The name of sku
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * The billing plan options available for this sku.
+ */
+ @JsonProperty(value = "billingPlans")
+ @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
+ private Map> billingPlans;
+
+ /*
+ * Available reservation terms for this resource
+ */
+ @JsonProperty(value = "terms", access = JsonProperty.Access.WRITE_ONLY)
+ private List terms;
+
+ /*
+ * The locations property.
+ */
+ @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY)
+ private List locations;
+
+ /*
+ * The skuProperties property.
+ */
+ @JsonProperty(value = "skuProperties", access = JsonProperty.Access.WRITE_ONLY)
+ private List skuProperties;
+
+ /*
+ * Pricing information about the sku
+ */
+ @JsonProperty(value = "msrp", access = JsonProperty.Access.WRITE_ONLY)
+ private CatalogMsrp msrp;
+
+ /*
+ * The restrictions property.
+ */
+ @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY)
+ private List restrictions;
+
+ /*
+ * The tier of this sku
+ */
+ @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY)
+ private String tier;
+
+ /*
+ * The size of this sku
+ */
+ @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY)
+ private String size;
+
+ /*
+ * The capabilities property.
+ */
+ @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY)
+ private List capabilities;
+
+ /** Creates an instance of CatalogInner class. */
+ public CatalogInner() {
+ }
+
+ /**
+ * Get the resourceType property: The type of resource the sku applies to.
+ *
+ * @return the resourceType value.
+ */
+ public String resourceType() {
+ return this.resourceType;
+ }
+
+ /**
+ * Get the name property: The name of sku.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the billingPlans property: The billing plan options available for this sku.
+ *
+ * @return the billingPlans value.
+ */
+ 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.
+ *
+ * @return the terms value.
+ */
+ public List terms() {
+ return this.terms;
+ }
+
+ /**
+ * Get the locations property: The locations property.
+ *
+ * @return the locations value.
+ */
+ public List locations() {
+ return this.locations;
+ }
+
+ /**
+ * Get the skuProperties property: The skuProperties property.
+ *
+ * @return the skuProperties value.
+ */
+ public List skuProperties() {
+ return this.skuProperties;
+ }
+
+ /**
+ * Get the msrp property: Pricing information about the sku.
+ *
+ * @return the msrp value.
+ */
+ public CatalogMsrp msrp() {
+ return this.msrp;
+ }
+
+ /**
+ * Get the restrictions property: The restrictions property.
+ *
+ * @return the restrictions value.
+ */
+ public List restrictions() {
+ return this.restrictions;
+ }
+
+ /**
+ * Get the tier property: The tier of this sku.
+ *
+ * @return the tier value.
+ */
+ public String tier() {
+ return this.tier;
+ }
+
+ /**
+ * Get the size property: The size of this sku.
+ *
+ * @return the size value.
+ */
+ public String size() {
+ return this.size;
+ }
+
+ /**
+ * Get the capabilities property: The capabilities property.
+ *
+ * @return the capabilities value.
+ */
+ 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());
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..0669b8cf21912
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ChangeDirectoryResponseInner.java
@@ -0,0 +1,84 @@
+// 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.resourcemanager.reservations.models.ChangeDirectoryResult;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Change directory response. */
+@Fluent
+public final class ChangeDirectoryResponseInner {
+ /*
+ * Change directory result for reservation order or reservation
+ */
+ @JsonProperty(value = "reservationOrder")
+ private ChangeDirectoryResult reservationOrder;
+
+ /*
+ * The reservations property.
+ */
+ @JsonProperty(value = "reservations")
+ private List reservations;
+
+ /** Creates an instance of ChangeDirectoryResponseInner class. */
+ public ChangeDirectoryResponseInner() {
+ }
+
+ /**
+ * Get the reservationOrder property: Change directory result for reservation order or reservation.
+ *
+ * @return the reservationOrder value.
+ */
+ public ChangeDirectoryResult reservationOrder() {
+ return this.reservationOrder;
+ }
+
+ /**
+ * Set the reservationOrder property: Change directory result for reservation order or reservation.
+ *
+ * @param reservationOrder the reservationOrder value to set.
+ * @return the ChangeDirectoryResponseInner object itself.
+ */
+ public ChangeDirectoryResponseInner withReservationOrder(ChangeDirectoryResult reservationOrder) {
+ this.reservationOrder = reservationOrder;
+ return this;
+ }
+
+ /**
+ * Get the reservations property: The reservations property.
+ *
+ * @return the reservations value.
+ */
+ public List 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());
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..2591fa98358f9
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/CurrentQuotaLimitBaseInner.java
@@ -0,0 +1,55 @@
+// 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.core.management.ProxyResource;
+import com.azure.resourcemanager.reservations.models.QuotaProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Quota properties. */
+@Fluent
+public final class CurrentQuotaLimitBaseInner extends ProxyResource {
+ /*
+ * Quota properties for the resource.
+ */
+ @JsonProperty(value = "properties")
+ private QuotaProperties properties;
+
+ /** Creates an instance of CurrentQuotaLimitBaseInner class. */
+ public CurrentQuotaLimitBaseInner() {
+ }
+
+ /**
+ * Get the properties property: Quota properties for the resource.
+ *
+ * @return the properties value.
+ */
+ public QuotaProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: Quota properties for the resource.
+ *
+ * @param properties the properties value to set.
+ * @return the CurrentQuotaLimitBaseInner object itself.
+ */
+ public CurrentQuotaLimitBaseInner withProperties(QuotaProperties 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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..6b36d8ff7b96e
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ExchangeOperationResultResponseInner.java
@@ -0,0 +1,165 @@
+// 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.resourcemanager.reservations.models.ExchangeOperationResultStatus;
+import com.azure.resourcemanager.reservations.models.ExchangeResponseProperties;
+import com.azure.resourcemanager.reservations.models.OperationResultError;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Exchange operation result. */
+@Fluent
+public final class ExchangeOperationResultResponseInner {
+ /*
+ * It should match what is used to GET the operation result.
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /*
+ * It must match the last segment of the id field, and will typically be a GUID / system generated value.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * Status of the operation.
+ */
+ @JsonProperty(value = "status")
+ private ExchangeOperationResultStatus status;
+
+ /*
+ * Exchange response properties
+ */
+ @JsonProperty(value = "properties")
+ private ExchangeResponseProperties properties;
+
+ /*
+ * Required if status == failed or status == canceled.
+ */
+ @JsonProperty(value = "error")
+ private OperationResultError error;
+
+ /** Creates an instance of ExchangeOperationResultResponseInner class. */
+ public ExchangeOperationResultResponseInner() {
+ }
+
+ /**
+ * Get the id property: It should match what is used to GET the operation result.
+ *
+ * @return the id value.
+ */
+ 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.
+ *
+ * @return the name value.
+ */
+ 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.
+ *
+ * @return the status value.
+ */
+ 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.
+ *
+ * @return the properties value.
+ */
+ 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.
+ *
+ * @return the error value.
+ */
+ 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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..ddc4b9f235fb7
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/MergeProperties.java
@@ -0,0 +1,54 @@
+// 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.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Properties for reservation merge. */
+@Fluent
+public final class MergeProperties {
+ /*
+ * Format of the resource id should be
+ * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
+ */
+ @JsonProperty(value = "sources")
+ private List sources;
+
+ /** Creates an instance of MergeProperties class. */
+ public MergeProperties() {
+ }
+
+ /**
+ * Get the sources property: Format of the resource id should be
+ * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
+ *
+ * @return the sources value.
+ */
+ public List sources() {
+ return this.sources;
+ }
+
+ /**
+ * Set the sources property: Format of the resource id should be
+ * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
+ *
+ * @param sources the sources value to set.
+ * @return the MergeProperties object itself.
+ */
+ public MergeProperties withSources(List sources) {
+ this.sources = sources;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/OperationResponseInner.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/OperationResponseInner.java
new file mode 100644
index 0000000000000..ad70d7e07f7e1
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/OperationResponseInner.java
@@ -0,0 +1,158 @@
+// 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.resourcemanager.reservations.models.OperationDisplay;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The response containing operation information. */
+@Fluent
+public final class OperationResponseInner {
+ /*
+ * Name of the operation
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * Indicates whether the operation is a data action
+ */
+ @JsonProperty(value = "isDataAction")
+ private Boolean isDataAction;
+
+ /*
+ * Display of the operation
+ */
+ @JsonProperty(value = "display")
+ private OperationDisplay display;
+
+ /*
+ * Origin of the operation
+ */
+ @JsonProperty(value = "origin")
+ private String origin;
+
+ /*
+ * Properties of the operation
+ */
+ @JsonProperty(value = "properties")
+ private Object properties;
+
+ /** Creates an instance of OperationResponseInner class. */
+ public OperationResponseInner() {
+ }
+
+ /**
+ * Get the name property: Name of the operation.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: Name of the operation.
+ *
+ * @param name the name value to set.
+ * @return the OperationResponseInner object itself.
+ */
+ public OperationResponseInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the isDataAction property: Indicates whether the operation is a data action.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Set the isDataAction property: Indicates whether the operation is a data action.
+ *
+ * @param isDataAction the isDataAction value to set.
+ * @return the OperationResponseInner object itself.
+ */
+ public OperationResponseInner withIsDataAction(Boolean isDataAction) {
+ this.isDataAction = isDataAction;
+ return this;
+ }
+
+ /**
+ * Get the display property: Display of the operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: Display of the operation.
+ *
+ * @param display the display value to set.
+ * @return the OperationResponseInner object itself.
+ */
+ public OperationResponseInner withDisplay(OperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the origin property: Origin of the operation.
+ *
+ * @return the origin value.
+ */
+ public String origin() {
+ return this.origin;
+ }
+
+ /**
+ * Set the origin property: Origin of the operation.
+ *
+ * @param origin the origin value to set.
+ * @return the OperationResponseInner object itself.
+ */
+ public OperationResponseInner withOrigin(String origin) {
+ this.origin = origin;
+ return this;
+ }
+
+ /**
+ * Get the properties property: Properties of the operation.
+ *
+ * @return the properties value.
+ */
+ public Object properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: Properties of the operation.
+ *
+ * @param properties the properties value to set.
+ * @return the OperationResponseInner object itself.
+ */
+ public OperationResponseInner withProperties(Object properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/PatchProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/PatchProperties.java
new file mode 100644
index 0000000000000..cbebe5aaff012
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/PatchProperties.java
@@ -0,0 +1,254 @@
+// 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.resourcemanager.reservations.models.AppliedScopeProperties;
+import com.azure.resourcemanager.reservations.models.AppliedScopeType;
+import com.azure.resourcemanager.reservations.models.InstanceFlexibility;
+import com.azure.resourcemanager.reservations.models.PatchPropertiesRenewProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/** Properties for reservation patch. */
+@Fluent
+public final class PatchProperties {
+ /*
+ * Type of the Applied Scope.
+ */
+ @JsonProperty(value = "appliedScopeType")
+ private AppliedScopeType appliedScopeType;
+
+ /*
+ * List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared.
+ */
+ @JsonProperty(value = "appliedScopes")
+ private List appliedScopes;
+
+ /*
+ * Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId
+ * and managementGroupId if AppliedScopeType is ManagementGroup
+ */
+ @JsonProperty(value = "appliedScopeProperties")
+ private AppliedScopeProperties appliedScopeProperties;
+
+ /*
+ * Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for
+ * VirtualMachines reserved resource type.
+ */
+ @JsonProperty(value = "instanceFlexibility")
+ private InstanceFlexibility instanceFlexibility;
+
+ /*
+ * Display name of the reservation
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * Setting this to true will automatically purchase a new reservation on the expiration date time.
+ */
+ @JsonProperty(value = "renew")
+ private Boolean renew;
+
+ /*
+ * The renewProperties property.
+ */
+ @JsonProperty(value = "renewProperties")
+ private PatchPropertiesRenewProperties renewProperties;
+
+ /*
+ * This is the date-time when the Azure hybrid benefit needs to be reviewed.
+ */
+ @JsonProperty(value = "reviewDateTime")
+ private OffsetDateTime reviewDateTime;
+
+ /** Creates an instance of PatchProperties class. */
+ public PatchProperties() {
+ }
+
+ /**
+ * Get the appliedScopeType property: Type of the Applied Scope.
+ *
+ * @return the appliedScopeType value.
+ */
+ public AppliedScopeType appliedScopeType() {
+ return this.appliedScopeType;
+ }
+
+ /**
+ * Set the appliedScopeType property: Type of the Applied Scope.
+ *
+ * @param appliedScopeType the appliedScopeType value to set.
+ * @return the PatchProperties object itself.
+ */
+ public PatchProperties withAppliedScopeType(AppliedScopeType appliedScopeType) {
+ this.appliedScopeType = appliedScopeType;
+ return this;
+ }
+
+ /**
+ * Get the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
+ * AppliedScopeType is Shared.
+ *
+ * @return the appliedScopes value.
+ */
+ public List appliedScopes() {
+ return this.appliedScopes;
+ }
+
+ /**
+ * Set the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
+ * AppliedScopeType is Shared.
+ *
+ * @param appliedScopes the appliedScopes value to set.
+ * @return the PatchProperties object itself.
+ */
+ public PatchProperties withAppliedScopes(List appliedScopes) {
+ this.appliedScopes = appliedScopes;
+ return this;
+ }
+
+ /**
+ * Get the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
+ * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.
+ *
+ * @return the appliedScopeProperties value.
+ */
+ public AppliedScopeProperties appliedScopeProperties() {
+ return this.appliedScopeProperties;
+ }
+
+ /**
+ * Set the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
+ * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.
+ *
+ * @param appliedScopeProperties the appliedScopeProperties value to set.
+ * @return the PatchProperties object itself.
+ */
+ public PatchProperties withAppliedScopeProperties(AppliedScopeProperties appliedScopeProperties) {
+ this.appliedScopeProperties = appliedScopeProperties;
+ return this;
+ }
+
+ /**
+ * Get the instanceFlexibility property: Turning this on will apply the reservation discount to other VMs in the
+ * same VM size group. Only specify for VirtualMachines reserved resource type.
+ *
+ * @return the instanceFlexibility value.
+ */
+ public InstanceFlexibility instanceFlexibility() {
+ return this.instanceFlexibility;
+ }
+
+ /**
+ * Set the instanceFlexibility property: Turning this on will apply the reservation discount to other VMs in the
+ * same VM size group. Only specify for VirtualMachines reserved resource type.
+ *
+ * @param instanceFlexibility the instanceFlexibility value to set.
+ * @return the PatchProperties object itself.
+ */
+ public PatchProperties withInstanceFlexibility(InstanceFlexibility instanceFlexibility) {
+ this.instanceFlexibility = instanceFlexibility;
+ return this;
+ }
+
+ /**
+ * Get the name property: Display name of the reservation.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: Display name of the reservation.
+ *
+ * @param name the name value to set.
+ * @return the PatchProperties object itself.
+ */
+ public PatchProperties withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the renew property: Setting this to true will automatically purchase a new reservation on the expiration date
+ * time.
+ *
+ * @return the renew value.
+ */
+ public Boolean renew() {
+ return this.renew;
+ }
+
+ /**
+ * Set the renew property: Setting this to true will automatically purchase a new reservation on the expiration date
+ * time.
+ *
+ * @param renew the renew value to set.
+ * @return the PatchProperties object itself.
+ */
+ public PatchProperties withRenew(Boolean renew) {
+ this.renew = renew;
+ return this;
+ }
+
+ /**
+ * Get the renewProperties property: The renewProperties property.
+ *
+ * @return the renewProperties value.
+ */
+ public PatchPropertiesRenewProperties renewProperties() {
+ return this.renewProperties;
+ }
+
+ /**
+ * Set the renewProperties property: The renewProperties property.
+ *
+ * @param renewProperties the renewProperties value to set.
+ * @return the PatchProperties object itself.
+ */
+ public PatchProperties withRenewProperties(PatchPropertiesRenewProperties renewProperties) {
+ this.renewProperties = renewProperties;
+ return this;
+ }
+
+ /**
+ * Get the reviewDateTime property: This is the date-time when the Azure hybrid benefit needs to be reviewed.
+ *
+ * @return the reviewDateTime value.
+ */
+ 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 PatchProperties object itself.
+ */
+ public PatchProperties withReviewDateTime(OffsetDateTime reviewDateTime) {
+ this.reviewDateTime = reviewDateTime;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (appliedScopeProperties() != null) {
+ appliedScopeProperties().validate();
+ }
+ if (renewProperties() != null) {
+ renewProperties().validate();
+ }
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/PurchaseRequestProperties.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/PurchaseRequestProperties.java
new file mode 100644
index 0000000000000..eba384e25b628
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/PurchaseRequestProperties.java
@@ -0,0 +1,360 @@
+// 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.resourcemanager.reservations.models.AppliedScopeProperties;
+import com.azure.resourcemanager.reservations.models.AppliedScopeType;
+import com.azure.resourcemanager.reservations.models.PurchaseRequestPropertiesReservedResourceProperties;
+import com.azure.resourcemanager.reservations.models.ReservationBillingPlan;
+import com.azure.resourcemanager.reservations.models.ReservationTerm;
+import com.azure.resourcemanager.reservations.models.ReservedResourceType;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/** Properties of reservation purchase request. */
+@Fluent
+public final class PurchaseRequestProperties {
+ /*
+ * The type of the resource that is being reserved.
+ */
+ @JsonProperty(value = "reservedResourceType")
+ private ReservedResourceType reservedResourceType;
+
+ /*
+ * Subscription that will be charged for purchasing reservation or savings plan
+ */
+ @JsonProperty(value = "billingScopeId")
+ private String billingScopeId;
+
+ /*
+ * Represent the term of reservation.
+ */
+ @JsonProperty(value = "term")
+ private ReservationTerm term;
+
+ /*
+ * Represent the billing plans.
+ */
+ @JsonProperty(value = "billingPlan")
+ private ReservationBillingPlan billingPlan;
+
+ /*
+ * Quantity of the skus that are part of the reservation.
+ */
+ @JsonProperty(value = "quantity")
+ private Integer quantity;
+
+ /*
+ * Friendly name of the reservation
+ */
+ @JsonProperty(value = "displayName")
+ private String displayName;
+
+ /*
+ * Type of the Applied Scope.
+ */
+ @JsonProperty(value = "appliedScopeType")
+ private AppliedScopeType appliedScopeType;
+
+ /*
+ * List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared.
+ */
+ @JsonProperty(value = "appliedScopes")
+ private List appliedScopes;
+
+ /*
+ * Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId
+ * and managementGroupId if AppliedScopeType is ManagementGroup
+ */
+ @JsonProperty(value = "appliedScopeProperties")
+ private AppliedScopeProperties appliedScopeProperties;
+
+ /*
+ * Setting this to true will automatically purchase a new reservation on the expiration date time.
+ */
+ @JsonProperty(value = "renew")
+ private Boolean renew;
+
+ /*
+ * Properties specific to each reserved resource type. Not required if not applicable.
+ */
+ @JsonProperty(value = "reservedResourceProperties")
+ private PurchaseRequestPropertiesReservedResourceProperties reservedResourceProperties;
+
+ /*
+ * This is the date-time when the Azure hybrid benefit needs to be reviewed.
+ */
+ @JsonProperty(value = "reviewDateTime")
+ private OffsetDateTime reviewDateTime;
+
+ /** Creates an instance of PurchaseRequestProperties class. */
+ public PurchaseRequestProperties() {
+ }
+
+ /**
+ * Get the reservedResourceType property: The type of the resource that is being reserved.
+ *
+ * @return the reservedResourceType value.
+ */
+ public ReservedResourceType reservedResourceType() {
+ return this.reservedResourceType;
+ }
+
+ /**
+ * Set the reservedResourceType property: The type of the resource that is being reserved.
+ *
+ * @param reservedResourceType the reservedResourceType value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withReservedResourceType(ReservedResourceType reservedResourceType) {
+ this.reservedResourceType = reservedResourceType;
+ return this;
+ }
+
+ /**
+ * Get the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.
+ *
+ * @return the billingScopeId value.
+ */
+ public String billingScopeId() {
+ return this.billingScopeId;
+ }
+
+ /**
+ * Set the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.
+ *
+ * @param billingScopeId the billingScopeId value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withBillingScopeId(String billingScopeId) {
+ this.billingScopeId = billingScopeId;
+ return this;
+ }
+
+ /**
+ * Get the term property: Represent the term of reservation.
+ *
+ * @return the term value.
+ */
+ public ReservationTerm term() {
+ return this.term;
+ }
+
+ /**
+ * Set the term property: Represent the term of reservation.
+ *
+ * @param term the term value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withTerm(ReservationTerm term) {
+ this.term = term;
+ return this;
+ }
+
+ /**
+ * Get the billingPlan property: Represent the billing plans.
+ *
+ * @return the billingPlan value.
+ */
+ public ReservationBillingPlan billingPlan() {
+ return this.billingPlan;
+ }
+
+ /**
+ * Set the billingPlan property: Represent the billing plans.
+ *
+ * @param billingPlan the billingPlan value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withBillingPlan(ReservationBillingPlan billingPlan) {
+ this.billingPlan = billingPlan;
+ return this;
+ }
+
+ /**
+ * Get the quantity property: Quantity of the skus that are part of the reservation.
+ *
+ * @return the quantity value.
+ */
+ public Integer quantity() {
+ return this.quantity;
+ }
+
+ /**
+ * Set the quantity property: Quantity of the skus that are part of the reservation.
+ *
+ * @param quantity the quantity value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withQuantity(Integer quantity) {
+ this.quantity = quantity;
+ return this;
+ }
+
+ /**
+ * Get the displayName property: Friendly name of the reservation.
+ *
+ * @return the displayName value.
+ */
+ public String displayName() {
+ return this.displayName;
+ }
+
+ /**
+ * Set the displayName property: Friendly name of the reservation.
+ *
+ * @param displayName the displayName value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withDisplayName(String displayName) {
+ this.displayName = displayName;
+ return this;
+ }
+
+ /**
+ * Get the appliedScopeType property: Type of the Applied Scope.
+ *
+ * @return the appliedScopeType value.
+ */
+ public AppliedScopeType appliedScopeType() {
+ return this.appliedScopeType;
+ }
+
+ /**
+ * Set the appliedScopeType property: Type of the Applied Scope.
+ *
+ * @param appliedScopeType the appliedScopeType value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withAppliedScopeType(AppliedScopeType appliedScopeType) {
+ this.appliedScopeType = appliedScopeType;
+ return this;
+ }
+
+ /**
+ * Get the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
+ * AppliedScopeType is Shared.
+ *
+ * @return the appliedScopes value.
+ */
+ public List appliedScopes() {
+ return this.appliedScopes;
+ }
+
+ /**
+ * Set the appliedScopes property: List of the subscriptions that the benefit will be applied. Do not specify if
+ * AppliedScopeType is Shared.
+ *
+ * @param appliedScopes the appliedScopes value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withAppliedScopes(List appliedScopes) {
+ this.appliedScopes = appliedScopes;
+ return this;
+ }
+
+ /**
+ * Get the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
+ * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.
+ *
+ * @return the appliedScopeProperties value.
+ */
+ public AppliedScopeProperties appliedScopeProperties() {
+ return this.appliedScopeProperties;
+ }
+
+ /**
+ * Set the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
+ * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.
+ *
+ * @param appliedScopeProperties the appliedScopeProperties value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withAppliedScopeProperties(AppliedScopeProperties appliedScopeProperties) {
+ this.appliedScopeProperties = appliedScopeProperties;
+ return this;
+ }
+
+ /**
+ * Get the renew property: Setting this to true will automatically purchase a new reservation on the expiration date
+ * time.
+ *
+ * @return the renew value.
+ */
+ public Boolean renew() {
+ return this.renew;
+ }
+
+ /**
+ * Set the renew property: Setting this to true will automatically purchase a new reservation on the expiration date
+ * time.
+ *
+ * @param renew the renew value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withRenew(Boolean renew) {
+ this.renew = renew;
+ return this;
+ }
+
+ /**
+ * Get the reservedResourceProperties property: Properties specific to each reserved resource type. Not required if
+ * not applicable.
+ *
+ * @return the reservedResourceProperties value.
+ */
+ public PurchaseRequestPropertiesReservedResourceProperties reservedResourceProperties() {
+ return this.reservedResourceProperties;
+ }
+
+ /**
+ * Set the reservedResourceProperties property: Properties specific to each reserved resource type. Not required if
+ * not applicable.
+ *
+ * @param reservedResourceProperties the reservedResourceProperties value to set.
+ * @return the PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withReservedResourceProperties(
+ PurchaseRequestPropertiesReservedResourceProperties reservedResourceProperties) {
+ this.reservedResourceProperties = reservedResourceProperties;
+ return this;
+ }
+
+ /**
+ * Get the reviewDateTime property: This is the date-time when the Azure hybrid benefit needs to be reviewed.
+ *
+ * @return the reviewDateTime value.
+ */
+ 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 PurchaseRequestProperties object itself.
+ */
+ public PurchaseRequestProperties withReviewDateTime(OffsetDateTime reviewDateTime) {
+ this.reviewDateTime = reviewDateTime;
+ 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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..cb7738a38690b
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestDetailsInner.java
@@ -0,0 +1,112 @@
+// 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.core.management.ProxyResource;
+import com.azure.resourcemanager.reservations.models.QuotaRequestState;
+import com.azure.resourcemanager.reservations.models.SubRequest;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/** Quota request details. */
+@Fluent
+public final class QuotaRequestDetailsInner extends ProxyResource {
+ /*
+ * Quota request details.
+ */
+ @JsonProperty(value = "properties")
+ private QuotaRequestProperties innerProperties;
+
+ /** Creates an instance of QuotaRequestDetailsInner class. */
+ public QuotaRequestDetailsInner() {
+ }
+
+ /**
+ * Get the innerProperties property: Quota request details.
+ *
+ * @return the innerProperties value.
+ */
+ private QuotaRequestProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the provisioningState property: The quota request status.
+ *
+ * @return the provisioningState value.
+ */
+ 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.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.innerProperties() == null ? null : this.innerProperties().message();
+ }
+
+ /**
+ * Get the requestSubmitTime property: The time when the quota request was submitted using format:
+ * yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
+ *
+ * @return the requestSubmitTime value.
+ */
+ public OffsetDateTime requestSubmitTime() {
+ return this.innerProperties() == null ? null : this.innerProperties().requestSubmitTime();
+ }
+
+ /**
+ * Get the value property: The quotaRequests.
+ *
+ * @return the value value.
+ */
+ 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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..ed50a581f7342
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestProperties.java
@@ -0,0 +1,115 @@
+// 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.resourcemanager.reservations.models.QuotaRequestState;
+import com.azure.resourcemanager.reservations.models.SubRequest;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/** The details of quota request. */
+@Fluent
+public final class QuotaRequestProperties {
+ /*
+ * The quota request status.
+ */
+ @JsonProperty(value = "provisioningState")
+ private QuotaRequestState provisioningState;
+
+ /*
+ * User friendly status message.
+ */
+ @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY)
+ private String message;
+
+ /*
+ * The time when the quota request was submitted using format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601
+ * standard.
+ */
+ @JsonProperty(value = "requestSubmitTime", access = JsonProperty.Access.WRITE_ONLY)
+ private OffsetDateTime requestSubmitTime;
+
+ /*
+ * The quotaRequests.
+ */
+ @JsonProperty(value = "value")
+ private List value;
+
+ /** Creates an instance of QuotaRequestProperties class. */
+ public QuotaRequestProperties() {
+ }
+
+ /**
+ * Get the provisioningState property: The quota request status.
+ *
+ * @return the provisioningState value.
+ */
+ public QuotaRequestState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Set the provisioningState property: The quota request status.
+ *
+ * @param provisioningState the provisioningState value to set.
+ * @return the QuotaRequestProperties object itself.
+ */
+ public QuotaRequestProperties withProvisioningState(QuotaRequestState provisioningState) {
+ this.provisioningState = provisioningState;
+ return this;
+ }
+
+ /**
+ * Get the message property: User friendly status message.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Get the requestSubmitTime property: The time when the quota request was submitted using format:
+ * yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
+ *
+ * @return the requestSubmitTime value.
+ */
+ public OffsetDateTime requestSubmitTime() {
+ return this.requestSubmitTime;
+ }
+
+ /**
+ * Get the value property: The quotaRequests.
+ *
+ * @return the value value.
+ */
+ public List 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());
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..a9cd4d739a90a
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestStatusDetails.java
@@ -0,0 +1,55 @@
+// 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.resourcemanager.reservations.models.QuotaRequestState;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Quota request status details. */
+@Immutable
+public final class QuotaRequestStatusDetails {
+ /*
+ * The details of the quota request status.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private QuotaRequestState provisioningState;
+
+ /*
+ * A user friendly message.
+ */
+ @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY)
+ 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() {
+ }
+}
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
new file mode 100644
index 0000000000000..33c293feb8f11
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/QuotaRequestSubmitResponse201Inner.java
@@ -0,0 +1,106 @@
+// 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.resourcemanager.reservations.models.QuotaRequestState;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Response with request ID that the quota request was accepted. */
+@Immutable
+public final class QuotaRequestSubmitResponse201Inner {
+ /*
+ * The quota request ID. Use the requestId parameter to check the request status.
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /*
+ * Operation ID
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * Resource type
+ */
+ @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
+ private String type;
+
+ /*
+ * Quota request status.
+ */
+ @JsonProperty(value = "properties")
+ 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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..8a3f8859b8c51
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/RefundResponseInner.java
@@ -0,0 +1,80 @@
+// 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.resourcemanager.reservations.models.RefundResponseProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The response of refund request containing refund information of reservation. */
+@Fluent
+public final class RefundResponseInner {
+ /*
+ * Fully qualified identifier of the reservation being returned
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /*
+ * The refund properties of reservation
+ */
+ @JsonProperty(value = "properties")
+ 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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..af411bbd6edde
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderProperties.java
@@ -0,0 +1,375 @@
+// 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.resourcemanager.reservations.models.ProvisioningState;
+import com.azure.resourcemanager.reservations.models.ReservationBillingPlan;
+import com.azure.resourcemanager.reservations.models.ReservationOrderBillingPlanInformation;
+import com.azure.resourcemanager.reservations.models.ReservationTerm;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/** Properties of a reservation order. */
+@Fluent
+public final class ReservationOrderProperties {
+ /*
+ * Friendly name for user to easily identified the reservation.
+ */
+ @JsonProperty(value = "displayName")
+ private String displayName;
+
+ /*
+ * This is the DateTime when the reservation was initially requested for purchase.
+ */
+ @JsonProperty(value = "requestDateTime")
+ private OffsetDateTime requestDateTime;
+
+ /*
+ * This is the DateTime when the reservation was created.
+ */
+ @JsonProperty(value = "createdDateTime")
+ private OffsetDateTime createdDateTime;
+
+ /*
+ * This is the date when the reservation will expire.
+ */
+ @JsonProperty(value = "expiryDate")
+ private LocalDate expiryDate;
+
+ /*
+ * This is the date-time when the reservation will expire.
+ */
+ @JsonProperty(value = "expiryDateTime")
+ private OffsetDateTime expiryDateTime;
+
+ /*
+ * This is the DateTime when the reservation benefit started.
+ */
+ @JsonProperty(value = "benefitStartTime")
+ private OffsetDateTime benefitStartTime;
+
+ /*
+ * Total Quantity of the skus purchased in the reservation.
+ */
+ @JsonProperty(value = "originalQuantity")
+ private Integer originalQuantity;
+
+ /*
+ * Represent the term of reservation.
+ */
+ @JsonProperty(value = "term")
+ private ReservationTerm term;
+
+ /*
+ * Current state of the reservation.
+ */
+ @JsonProperty(value = "provisioningState")
+ private ProvisioningState provisioningState;
+
+ /*
+ * Represent the billing plans.
+ */
+ @JsonProperty(value = "billingPlan")
+ private ReservationBillingPlan billingPlan;
+
+ /*
+ * Information describing the type of billing plan for this reservation.
+ */
+ @JsonProperty(value = "planInformation")
+ private ReservationOrderBillingPlanInformation planInformation;
+
+ /*
+ * The reservations property.
+ */
+ @JsonProperty(value = "reservations")
+ private List reservations;
+
+ /*
+ * This is the date-time when the Azure Hybrid Benefit needs to be reviewed.
+ */
+ @JsonProperty(value = "reviewDateTime")
+ private OffsetDateTime reviewDateTime;
+
+ /** Creates an instance of ReservationOrderProperties class. */
+ public ReservationOrderProperties() {
+ }
+
+ /**
+ * Get the displayName property: Friendly name for user to easily identified the reservation.
+ *
+ * @return the displayName value.
+ */
+ public String displayName() {
+ return this.displayName;
+ }
+
+ /**
+ * Set the displayName property: Friendly name for user to easily identified the reservation.
+ *
+ * @param displayName the displayName value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withDisplayName(String displayName) {
+ this.displayName = displayName;
+ return this;
+ }
+
+ /**
+ * Get the requestDateTime property: This is the DateTime when the reservation was initially requested for purchase.
+ *
+ * @return the requestDateTime value.
+ */
+ public OffsetDateTime requestDateTime() {
+ return this.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 ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withRequestDateTime(OffsetDateTime requestDateTime) {
+ this.requestDateTime = requestDateTime;
+ return this;
+ }
+
+ /**
+ * Get the createdDateTime property: This is the DateTime when the reservation was created.
+ *
+ * @return the createdDateTime value.
+ */
+ public OffsetDateTime createdDateTime() {
+ return this.createdDateTime;
+ }
+
+ /**
+ * Set the createdDateTime property: This is the DateTime when the reservation was created.
+ *
+ * @param createdDateTime the createdDateTime value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withCreatedDateTime(OffsetDateTime createdDateTime) {
+ this.createdDateTime = createdDateTime;
+ return this;
+ }
+
+ /**
+ * Get the expiryDate property: This is the date when the reservation will expire.
+ *
+ * @return the expiryDate value.
+ */
+ public LocalDate expiryDate() {
+ return this.expiryDate;
+ }
+
+ /**
+ * Set the expiryDate property: This is the date when the reservation will expire.
+ *
+ * @param expiryDate the expiryDate value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withExpiryDate(LocalDate expiryDate) {
+ this.expiryDate = expiryDate;
+ return this;
+ }
+
+ /**
+ * Get the expiryDateTime property: This is the date-time when the reservation will expire.
+ *
+ * @return the expiryDateTime value.
+ */
+ public OffsetDateTime expiryDateTime() {
+ return this.expiryDateTime;
+ }
+
+ /**
+ * Set the expiryDateTime property: This is the date-time when the reservation will expire.
+ *
+ * @param expiryDateTime the expiryDateTime value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withExpiryDateTime(OffsetDateTime expiryDateTime) {
+ this.expiryDateTime = expiryDateTime;
+ return this;
+ }
+
+ /**
+ * Get the benefitStartTime property: This is the DateTime when the reservation benefit started.
+ *
+ * @return the benefitStartTime value.
+ */
+ public OffsetDateTime benefitStartTime() {
+ return this.benefitStartTime;
+ }
+
+ /**
+ * Set the benefitStartTime property: This is the DateTime when the reservation benefit started.
+ *
+ * @param benefitStartTime the benefitStartTime value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withBenefitStartTime(OffsetDateTime benefitStartTime) {
+ this.benefitStartTime = benefitStartTime;
+ return this;
+ }
+
+ /**
+ * Get the originalQuantity property: Total Quantity of the skus purchased in the reservation.
+ *
+ * @return the originalQuantity value.
+ */
+ public Integer originalQuantity() {
+ return this.originalQuantity;
+ }
+
+ /**
+ * Set the originalQuantity property: Total Quantity of the skus purchased in the reservation.
+ *
+ * @param originalQuantity the originalQuantity value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withOriginalQuantity(Integer originalQuantity) {
+ this.originalQuantity = originalQuantity;
+ return this;
+ }
+
+ /**
+ * Get the term property: Represent the term of reservation.
+ *
+ * @return the term value.
+ */
+ public ReservationTerm term() {
+ return this.term;
+ }
+
+ /**
+ * Set the term property: Represent the term of reservation.
+ *
+ * @param term the term value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withTerm(ReservationTerm term) {
+ this.term = term;
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: Current state of the reservation.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Set the provisioningState property: Current state of the reservation.
+ *
+ * @param provisioningState the provisioningState value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withProvisioningState(ProvisioningState provisioningState) {
+ this.provisioningState = provisioningState;
+ return this;
+ }
+
+ /**
+ * Get the billingPlan property: Represent the billing plans.
+ *
+ * @return the billingPlan value.
+ */
+ public ReservationBillingPlan billingPlan() {
+ return this.billingPlan;
+ }
+
+ /**
+ * Set the billingPlan property: Represent the billing plans.
+ *
+ * @param billingPlan the billingPlan value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withBillingPlan(ReservationBillingPlan billingPlan) {
+ this.billingPlan = billingPlan;
+ return this;
+ }
+
+ /**
+ * Get the planInformation property: Information describing the type of billing plan for this reservation.
+ *
+ * @return the planInformation value.
+ */
+ public ReservationOrderBillingPlanInformation planInformation() {
+ return this.planInformation;
+ }
+
+ /**
+ * Set the planInformation property: Information describing the type of billing plan for this reservation.
+ *
+ * @param planInformation the planInformation value to set.
+ * @return the ReservationOrderProperties object itself.
+ */
+ public ReservationOrderProperties withPlanInformation(ReservationOrderBillingPlanInformation planInformation) {
+ this.planInformation = planInformation;
+ return this;
+ }
+
+ /**
+ * Get the reservations property: The reservations property.
+ *
+ * @return the reservations value.
+ */
+ public List 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.
+ *
+ * @return the reviewDateTime value.
+ */
+ 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());
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..3a5bfa761e50b
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationOrderResponseInner.java
@@ -0,0 +1,391 @@
+// 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.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.reservations.models.ProvisioningState;
+import com.azure.resourcemanager.reservations.models.ReservationBillingPlan;
+import com.azure.resourcemanager.reservations.models.ReservationOrderBillingPlanInformation;
+import com.azure.resourcemanager.reservations.models.ReservationTerm;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/** Details of a reservation order being returned. */
+@Fluent
+public final class ReservationOrderResponseInner extends ProxyResource {
+ /*
+ * The etag property.
+ */
+ @JsonProperty(value = "etag")
+ private Integer etag;
+
+ /*
+ * Properties of a reservation order.
+ */
+ @JsonProperty(value = "properties")
+ private ReservationOrderProperties innerProperties;
+
+ /*
+ * Metadata pertaining to creation and last modification of the resource.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of ReservationOrderResponseInner class. */
+ public 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.
+ *
+ * @param etag the etag value to set.
+ * @return the ReservationOrderResponseInner object itself.
+ */
+ public ReservationOrderResponseInner withEtag(Integer etag) {
+ this.etag = etag;
+ return this;
+ }
+
+ /**
+ * Get the innerProperties property: Properties of a reservation order.
+ *
+ * @return the innerProperties value.
+ */
+ private ReservationOrderProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Metadata pertaining to creation and last modification of the resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the displayName property: Friendly name for user to easily identified the reservation.
+ *
+ * @return the displayName value.
+ */
+ 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.
+ *
+ * @return the requestDateTime value.
+ */
+ 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.
+ *
+ * @return the createdDateTime value.
+ */
+ 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.
+ *
+ * @return the expiryDate value.
+ */
+ 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.
+ *
+ * @return the expiryDateTime value.
+ */
+ 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.
+ *
+ * @return the benefitStartTime value.
+ */
+ 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.
+ *
+ * @return the originalQuantity value.
+ */
+ 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.
+ *
+ * @return the term value.
+ */
+ 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.
+ *
+ * @return the provisioningState value.
+ */
+ 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.
+ *
+ * @return the billingPlan value.
+ */
+ 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.
+ *
+ * @return the planInformation value.
+ */
+ 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.
+ *
+ * @return the reservations value.
+ */
+ 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.
+ *
+ * @return the reviewDateTime value.
+ */
+ 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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..a6bbb9964651b
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/ReservationResponseInner.java
@@ -0,0 +1,180 @@
+// 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.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.reservations.models.Kind;
+import com.azure.resourcemanager.reservations.models.ReservationsProperties;
+import com.azure.resourcemanager.reservations.models.SkuName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The definition of the reservation. */
+@Fluent
+public final class ReservationResponseInner extends ProxyResource {
+ /*
+ * The Azure region where the reserved resource lives.
+ */
+ @JsonProperty(value = "location")
+ private String location;
+
+ /*
+ * The etag property.
+ */
+ @JsonProperty(value = "etag")
+ private Integer etag;
+
+ /*
+ * The sku information associated to this reservation
+ */
+ @JsonProperty(value = "sku")
+ private SkuName sku;
+
+ /*
+ * The properties associated to this reservation
+ */
+ @JsonProperty(value = "properties")
+ private ReservationsProperties properties;
+
+ /*
+ * Resource Provider type to be reserved.
+ */
+ @JsonProperty(value = "kind")
+ private Kind kind;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of ReservationResponseInner class. */
+ public ReservationResponseInner() {
+ }
+
+ /**
+ * Get the location property: The Azure region where the reserved resource lives.
+ *
+ * @return the location value.
+ */
+ public String location() {
+ return this.location;
+ }
+
+ /**
+ * Set the location property: The Azure region where the reserved resource lives.
+ *
+ * @param location the location value to set.
+ * @return the ReservationResponseInner object itself.
+ */
+ public ReservationResponseInner withLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ /**
+ * Get the etag property: The etag property.
+ *
+ * @return the etag value.
+ */
+ 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.
+ *
+ * @return the sku value.
+ */
+ 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() {
+ 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.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * 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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..56276110eada6
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SavingsPlanPurchaseRequestProperties.java
@@ -0,0 +1,223 @@
+// 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.resourcemanager.reservations.models.AppliedScopeProperties;
+import com.azure.resourcemanager.reservations.models.AppliedScopeType;
+import com.azure.resourcemanager.reservations.models.BillingPlan;
+import com.azure.resourcemanager.reservations.models.Commitment;
+import com.azure.resourcemanager.reservations.models.SavingsPlanTerm;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Properties of a savings plan purchase. */
+@Fluent
+public final class SavingsPlanPurchaseRequestProperties {
+ /*
+ * Friendly name of the savings plan
+ */
+ @JsonProperty(value = "displayName")
+ private String displayName;
+
+ /*
+ * Subscription that will be charged for purchasing reservation or savings plan
+ */
+ @JsonProperty(value = "billingScopeId")
+ private String billingScopeId;
+
+ /*
+ * Represent savings plan term in ISO 8601 format.
+ */
+ @JsonProperty(value = "term")
+ private SavingsPlanTerm term;
+
+ /*
+ * Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.
+ */
+ @JsonProperty(value = "billingPlan")
+ private BillingPlan billingPlan;
+
+ /*
+ * Type of the Applied Scope.
+ */
+ @JsonProperty(value = "appliedScopeType")
+ private AppliedScopeType appliedScopeType;
+
+ /*
+ * Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId
+ * and managementGroupId if AppliedScopeType is ManagementGroup
+ */
+ @JsonProperty(value = "appliedScopeProperties")
+ private AppliedScopeProperties appliedScopeProperties;
+
+ /*
+ * Commitment towards the benefit.
+ */
+ @JsonProperty(value = "commitment")
+ private Commitment commitment;
+
+ /** Creates an instance of SavingsPlanPurchaseRequestProperties class. */
+ public SavingsPlanPurchaseRequestProperties() {
+ }
+
+ /**
+ * Get the displayName property: Friendly name of the savings plan.
+ *
+ * @return the displayName value.
+ */
+ public String displayName() {
+ return this.displayName;
+ }
+
+ /**
+ * Set the displayName property: Friendly name of the savings plan.
+ *
+ * @param displayName the displayName value to set.
+ * @return the SavingsPlanPurchaseRequestProperties object itself.
+ */
+ public SavingsPlanPurchaseRequestProperties withDisplayName(String displayName) {
+ this.displayName = displayName;
+ return this;
+ }
+
+ /**
+ * Get the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.
+ *
+ * @return the billingScopeId value.
+ */
+ public String billingScopeId() {
+ return this.billingScopeId;
+ }
+
+ /**
+ * Set the billingScopeId property: Subscription that will be charged for purchasing reservation or savings plan.
+ *
+ * @param billingScopeId the billingScopeId value to set.
+ * @return the SavingsPlanPurchaseRequestProperties object itself.
+ */
+ public SavingsPlanPurchaseRequestProperties withBillingScopeId(String billingScopeId) {
+ this.billingScopeId = billingScopeId;
+ return this;
+ }
+
+ /**
+ * Get the term property: Represent savings plan term in ISO 8601 format.
+ *
+ * @return the term value.
+ */
+ public SavingsPlanTerm term() {
+ return this.term;
+ }
+
+ /**
+ * Set the term property: Represent savings plan term in ISO 8601 format.
+ *
+ * @param term the term value to set.
+ * @return the SavingsPlanPurchaseRequestProperties object itself.
+ */
+ public SavingsPlanPurchaseRequestProperties withTerm(SavingsPlanTerm term) {
+ this.term = term;
+ return this;
+ }
+
+ /**
+ * Get the billingPlan property: Represents the billing plan in ISO 8601 format. Required only for monthly billing
+ * plans.
+ *
+ * @return the billingPlan value.
+ */
+ public BillingPlan billingPlan() {
+ return this.billingPlan;
+ }
+
+ /**
+ * Set the billingPlan property: Represents the billing plan in ISO 8601 format. Required only for monthly billing
+ * plans.
+ *
+ * @param billingPlan the billingPlan value to set.
+ * @return the SavingsPlanPurchaseRequestProperties object itself.
+ */
+ public SavingsPlanPurchaseRequestProperties withBillingPlan(BillingPlan billingPlan) {
+ this.billingPlan = billingPlan;
+ return this;
+ }
+
+ /**
+ * Get the appliedScopeType property: Type of the Applied Scope.
+ *
+ * @return the appliedScopeType value.
+ */
+ public AppliedScopeType appliedScopeType() {
+ return this.appliedScopeType;
+ }
+
+ /**
+ * Set the appliedScopeType property: Type of the Applied Scope.
+ *
+ * @param appliedScopeType the appliedScopeType value to set.
+ * @return the SavingsPlanPurchaseRequestProperties object itself.
+ */
+ public SavingsPlanPurchaseRequestProperties withAppliedScopeType(AppliedScopeType appliedScopeType) {
+ this.appliedScopeType = appliedScopeType;
+ return this;
+ }
+
+ /**
+ * Get the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
+ * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.
+ *
+ * @return the appliedScopeProperties value.
+ */
+ public AppliedScopeProperties appliedScopeProperties() {
+ return this.appliedScopeProperties;
+ }
+
+ /**
+ * Set the appliedScopeProperties property: Properties specific to applied scope type. Not required if not
+ * applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.
+ *
+ * @param appliedScopeProperties the appliedScopeProperties value to set.
+ * @return the SavingsPlanPurchaseRequestProperties object itself.
+ */
+ public SavingsPlanPurchaseRequestProperties withAppliedScopeProperties(
+ AppliedScopeProperties appliedScopeProperties) {
+ this.appliedScopeProperties = appliedScopeProperties;
+ return this;
+ }
+
+ /**
+ * Get the commitment property: Commitment towards the benefit.
+ *
+ * @return the commitment value.
+ */
+ public Commitment commitment() {
+ return this.commitment;
+ }
+
+ /**
+ * Set the commitment property: Commitment towards the benefit.
+ *
+ * @param commitment the commitment value to set.
+ * @return the SavingsPlanPurchaseRequestProperties object itself.
+ */
+ public SavingsPlanPurchaseRequestProperties withCommitment(Commitment commitment) {
+ this.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();
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..0dc645784a5d2
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/SplitProperties.java
@@ -0,0 +1,80 @@
+// 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.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Properties for reservation split. */
+@Fluent
+public final class SplitProperties {
+ /*
+ * List of the quantities in the new reservations to create.
+ */
+ @JsonProperty(value = "quantities")
+ private List quantities;
+
+ /*
+ * Resource id of the reservation to be split. Format of the resource id should be
+ * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}
+ */
+ @JsonProperty(value = "reservationId")
+ private String reservationId;
+
+ /** Creates an instance of SplitProperties class. */
+ public SplitProperties() {
+ }
+
+ /**
+ * Get the quantities property: List of the quantities in the new reservations to create.
+ *
+ * @return the quantities value.
+ */
+ public List quantities() {
+ return this.quantities;
+ }
+
+ /**
+ * Set the quantities property: List of the quantities in the new reservations to create.
+ *
+ * @param quantities the quantities value to set.
+ * @return the SplitProperties object itself.
+ */
+ public SplitProperties withQuantities(List quantities) {
+ this.quantities = quantities;
+ return this;
+ }
+
+ /**
+ * Get the reservationId property: Resource id of the reservation to be split. Format of the resource id should be
+ * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
+ *
+ * @return the reservationId value.
+ */
+ public String reservationId() {
+ return this.reservationId;
+ }
+
+ /**
+ * Set the reservationId property: Resource id of the reservation to be split. Format of the resource id should be
+ * /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
+ *
+ * @param reservationId the reservationId value to set.
+ * @return the SplitProperties object itself.
+ */
+ public SplitProperties withReservationId(String reservationId) {
+ this.reservationId = reservationId;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/package-info.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/package-info.java
new file mode 100644
index 0000000000000..ddf4aa4868f47
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/models/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the inner data models for AzureReservationApi. This API describe Azure Reservation. */
+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
new file mode 100644
index 0000000000000..ed64a4ed14f26
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/fluent/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the service clients for AzureReservationApi. This API describe Azure Reservation. */
+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
new file mode 100644
index 0000000000000..efbf747de7216
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AppliedReservationsImpl.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.AppliedReservationsInner;
+import com.azure.resourcemanager.reservations.models.AppliedReservationList;
+import com.azure.resourcemanager.reservations.models.AppliedReservations;
+
+public final class AppliedReservationsImpl implements AppliedReservations {
+ private AppliedReservationsInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ AppliedReservationsImpl(
+ AppliedReservationsInner innerObject,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public AppliedReservationList reservationOrderIds() {
+ return this.innerModel().reservationOrderIds();
+ }
+
+ public AppliedReservationsInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AvailableScopePropertiesImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AvailableScopePropertiesImpl.java
new file mode 100644
index 0000000000000..9fea6aaad7a75
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AvailableScopePropertiesImpl.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.AvailableScopePropertiesInner;
+import com.azure.resourcemanager.reservations.models.AvailableScopeProperties;
+import com.azure.resourcemanager.reservations.models.SubscriptionScopeProperties;
+
+public final class AvailableScopePropertiesImpl implements AvailableScopeProperties {
+ private AvailableScopePropertiesInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ AvailableScopePropertiesImpl(
+ AvailableScopePropertiesInner innerObject,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public SubscriptionScopeProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public AvailableScopePropertiesInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiBuilder.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiBuilder.java
new file mode 100644
index 0000000000000..fb070fec56b8d
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiBuilder.java
@@ -0,0 +1,123 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerAdapter;
+import java.time.Duration;
+
+/** A builder for creating a new instance of the AzureReservationApiImpl type. */
+@ServiceClientBuilder(serviceClients = {AzureReservationApiImpl.class})
+public final class AzureReservationApiBuilder {
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the AzureReservationApiBuilder.
+ */
+ public AzureReservationApiBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the AzureReservationApiBuilder.
+ */
+ public AzureReservationApiBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through
+ */
+ private HttpPipeline pipeline;
+
+ /**
+ * Sets The HTTP pipeline to send requests through.
+ *
+ * @param pipeline the pipeline value.
+ * @return the AzureReservationApiBuilder.
+ */
+ public AzureReservationApiBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The default poll interval for long-running operation
+ */
+ private Duration defaultPollInterval;
+
+ /**
+ * Sets The default poll interval for long-running operation.
+ *
+ * @param defaultPollInterval the defaultPollInterval value.
+ * @return the AzureReservationApiBuilder.
+ */
+ public AzureReservationApiBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ return this;
+ }
+
+ /*
+ * The serializer to serialize an object into a string
+ */
+ private SerializerAdapter serializerAdapter;
+
+ /**
+ * Sets The serializer to serialize an object into a string.
+ *
+ * @param serializerAdapter the serializerAdapter value.
+ * @return the AzureReservationApiBuilder.
+ */
+ public AzureReservationApiBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of AzureReservationApiImpl with the provided parameters.
+ *
+ * @return an instance of AzureReservationApiImpl.
+ */
+ public AzureReservationApiImpl buildClient() {
+ String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
+ AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
+ HttpPipeline localPipeline =
+ (pipeline != null)
+ ? pipeline
+ : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ Duration localDefaultPollInterval =
+ (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
+ SerializerAdapter localSerializerAdapter =
+ (serializerAdapter != null)
+ ? serializerAdapter
+ : SerializerFactory.createDefaultManagementSerializerAdapter();
+ AzureReservationApiImpl client =
+ new AzureReservationApiImpl(
+ localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiImpl.java
new file mode 100644
index 0000000000000..e38fb2fbbe969
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/AzureReservationApiImpl.java
@@ -0,0 +1,388 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.reservations.fluent.AzureReservationApi;
+import com.azure.resourcemanager.reservations.fluent.CalculateExchangesClient;
+import com.azure.resourcemanager.reservations.fluent.CalculateRefundsClient;
+import com.azure.resourcemanager.reservations.fluent.ExchangesClient;
+import com.azure.resourcemanager.reservations.fluent.OperationsClient;
+import com.azure.resourcemanager.reservations.fluent.QuotaRequestStatusClient;
+import com.azure.resourcemanager.reservations.fluent.QuotasClient;
+import com.azure.resourcemanager.reservations.fluent.ReservationOrdersClient;
+import com.azure.resourcemanager.reservations.fluent.ReservationsClient;
+import com.azure.resourcemanager.reservations.fluent.ResourceProvidersClient;
+import com.azure.resourcemanager.reservations.fluent.ReturnsClient;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** Initializes a new instance of the AzureReservationApiImpl type. */
+@ServiceClient(builder = AzureReservationApiBuilder.class)
+public final class AzureReservationApiImpl implements AzureReservationApi {
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** The HTTP pipeline to send requests through. */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /** The serializer to serialize an object into a string. */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /** The default poll interval for long-running operation. */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /** The ReservationsClient object to access its operations. */
+ private final ReservationsClient reservations;
+
+ /**
+ * Gets the ReservationsClient object to access its operations.
+ *
+ * @return the ReservationsClient object.
+ */
+ public ReservationsClient getReservations() {
+ return this.reservations;
+ }
+
+ /** The ResourceProvidersClient object to access its operations. */
+ private final ResourceProvidersClient resourceProviders;
+
+ /**
+ * Gets the ResourceProvidersClient object to access its operations.
+ *
+ * @return the ResourceProvidersClient object.
+ */
+ public ResourceProvidersClient getResourceProviders() {
+ return this.resourceProviders;
+ }
+
+ /** The ReservationOrdersClient object to access its operations. */
+ private final ReservationOrdersClient reservationOrders;
+
+ /**
+ * Gets the ReservationOrdersClient object to access its operations.
+ *
+ * @return the ReservationOrdersClient object.
+ */
+ public ReservationOrdersClient getReservationOrders() {
+ return this.reservationOrders;
+ }
+
+ /** The OperationsClient object to access its operations. */
+ private final OperationsClient operations;
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ public OperationsClient getOperations() {
+ return this.operations;
+ }
+
+ /** The CalculateRefundsClient object to access its operations. */
+ private final CalculateRefundsClient calculateRefunds;
+
+ /**
+ * Gets the CalculateRefundsClient object to access its operations.
+ *
+ * @return the CalculateRefundsClient object.
+ */
+ public CalculateRefundsClient getCalculateRefunds() {
+ return this.calculateRefunds;
+ }
+
+ /** The ReturnsClient object to access its operations. */
+ private final ReturnsClient returns;
+
+ /**
+ * Gets the ReturnsClient object to access its operations.
+ *
+ * @return the ReturnsClient object.
+ */
+ public ReturnsClient getReturns() {
+ return this.returns;
+ }
+
+ /** The CalculateExchangesClient object to access its operations. */
+ private final CalculateExchangesClient calculateExchanges;
+
+ /**
+ * Gets the CalculateExchangesClient object to access its operations.
+ *
+ * @return the CalculateExchangesClient object.
+ */
+ public CalculateExchangesClient getCalculateExchanges() {
+ return this.calculateExchanges;
+ }
+
+ /** The ExchangesClient object to access its operations. */
+ private final ExchangesClient exchanges;
+
+ /**
+ * Gets the ExchangesClient object to access its operations.
+ *
+ * @return the ExchangesClient object.
+ */
+ public ExchangesClient getExchanges() {
+ return this.exchanges;
+ }
+
+ /** The QuotasClient object to access its operations. */
+ private final QuotasClient quotas;
+
+ /**
+ * Gets the QuotasClient object to access its operations.
+ *
+ * @return the QuotasClient object.
+ */
+ public QuotasClient getQuotas() {
+ return this.quotas;
+ }
+
+ /** The QuotaRequestStatusClient object to access its operations. */
+ private final QuotaRequestStatusClient quotaRequestStatus;
+
+ /**
+ * Gets the QuotaRequestStatusClient object to access its operations.
+ *
+ * @return the QuotaRequestStatusClient object.
+ */
+ public QuotaRequestStatusClient getQuotaRequestStatus() {
+ return this.quotaRequestStatus;
+ }
+
+ /**
+ * Initializes an instance of AzureReservationApi client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param endpoint server parameter.
+ */
+ AzureReservationApiImpl(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.endpoint = endpoint;
+ this.reservations = new ReservationsClientImpl(this);
+ this.resourceProviders = new ResourceProvidersClientImpl(this);
+ this.reservationOrders = new ReservationOrdersClientImpl(this);
+ this.operations = new OperationsClientImpl(this);
+ this.calculateRefunds = new CalculateRefundsClientImpl(this);
+ this.returns = new ReturnsClientImpl(this);
+ this.calculateExchanges = new CalculateExchangesClientImpl(this);
+ this.exchanges = new ExchangesClientImpl(this);
+ this.quotas = new QuotasClientImpl(this);
+ this.quotaRequestStatus = new QuotaRequestStatusClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ return CoreUtils.mergeContexts(this.getContext(), context);
+ }
+
+ /**
+ * Gets long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @param httpPipeline the http pipeline.
+ * @param pollResultType type of poll result.
+ * @param finalResultType type of final result.
+ * @param context the context shared by all requests.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return poller flux for poll result and final result.
+ */
+ public PollerFlux, U> getLroResult(
+ Mono>> activationResponse,
+ HttpPipeline httpPipeline,
+ Type pollResultType,
+ Type finalResultType,
+ Context context) {
+ return PollerFactory
+ .create(
+ serializerAdapter,
+ httpPipeline,
+ pollResultType,
+ finalResultType,
+ defaultPollInterval,
+ activationResponse,
+ context);
+ }
+
+ /**
+ * Gets the final result, or an error, based on last async poll response.
+ *
+ * @param response the last async poll response.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return the final result, or an error.
+ */
+ public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) {
+ if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
+ String errorMessage;
+ ManagementError managementError = null;
+ HttpResponse errorResponse = null;
+ PollResult.Error lroError = response.getValue().getError();
+ if (lroError != null) {
+ errorResponse =
+ new HttpResponseImpl(
+ lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody());
+
+ errorMessage = response.getValue().getError().getMessage();
+ String errorBody = response.getValue().getError().getResponseBody();
+ if (errorBody != null) {
+ // try to deserialize error body to ManagementError
+ try {
+ managementError =
+ this
+ .getSerializerAdapter()
+ .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
+ if (managementError.getCode() == null || managementError.getMessage() == null) {
+ managementError = null;
+ }
+ } catch (IOException | RuntimeException ioe) {
+ LOGGER.logThrowableAsWarning(ioe);
+ }
+ }
+ } else {
+ // fallback to default error message
+ errorMessage = "Long running operation failed.";
+ }
+ if (managementError == null) {
+ // fallback to default ManagementError
+ managementError = new ManagementError(response.getStatus().toString(), errorMessage);
+ }
+ return Mono.error(new ManagementException(errorMessage, errorResponse, managementError));
+ } else {
+ return response.getFinalResult();
+ }
+ }
+
+ private static final class HttpResponseImpl extends HttpResponse {
+ private final int statusCode;
+
+ private final byte[] responseBody;
+
+ private final HttpHeaders httpHeaders;
+
+ HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) {
+ super(null);
+ this.statusCode = statusCode;
+ this.httpHeaders = httpHeaders;
+ this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getHeaderValue(String s) {
+ return httpHeaders.getValue(s);
+ }
+
+ public HttpHeaders getHeaders() {
+ return httpHeaders;
+ }
+
+ public Flux getBody() {
+ return Flux.just(ByteBuffer.wrap(responseBody));
+ }
+
+ public Mono getBodyAsByteArray() {
+ return Mono.just(responseBody);
+ }
+
+ public Mono getBodyAsString() {
+ return Mono.just(new String(responseBody, StandardCharsets.UTF_8));
+ }
+
+ public Mono getBodyAsString(Charset charset) {
+ return Mono.just(new String(responseBody, charset));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(AzureReservationApiImpl.class);
+}
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
new file mode 100644
index 0000000000000..f3b7583a8d4d8
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangeOperationResultResponseImpl.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.CalculateExchangeOperationResultResponseInner;
+import com.azure.resourcemanager.reservations.models.CalculateExchangeOperationResultResponse;
+import com.azure.resourcemanager.reservations.models.CalculateExchangeOperationResultStatus;
+import com.azure.resourcemanager.reservations.models.CalculateExchangeResponseProperties;
+import com.azure.resourcemanager.reservations.models.OperationResultError;
+
+public final class CalculateExchangeOperationResultResponseImpl implements CalculateExchangeOperationResultResponse {
+ private CalculateExchangeOperationResultResponseInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ CalculateExchangeOperationResultResponseImpl(
+ CalculateExchangeOperationResultResponseInner innerObject,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public CalculateExchangeOperationResultStatus status() {
+ return this.innerModel().status();
+ }
+
+ public CalculateExchangeResponseProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public OperationResultError error() {
+ return this.innerModel().error();
+ }
+
+ public CalculateExchangeOperationResultResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesClientImpl.java
new file mode 100644
index 0000000000000..62f1c642e267a
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesClientImpl.java
@@ -0,0 +1,291 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.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;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.reservations.fluent.CalculateExchangesClient;
+import com.azure.resourcemanager.reservations.fluent.models.CalculateExchangeOperationResultResponseInner;
+import com.azure.resourcemanager.reservations.models.CalculateExchangeRequest;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in CalculateExchangesClient. */
+public final class CalculateExchangesClientImpl implements CalculateExchangesClient {
+ /** The proxy service used to perform REST calls. */
+ private final CalculateExchangesService service;
+
+ /** The service client containing this operation class. */
+ private final AzureReservationApiImpl client;
+
+ /**
+ * Initializes an instance of CalculateExchangesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ CalculateExchangesClientImpl(AzureReservationApiImpl 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.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureReservationApiC")
+ 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);
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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}.
+ */
+ @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 accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.post(this.client.getEndpoint(), apiVersion, body, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * 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 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 along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @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();
+ }
+ final String apiVersion = "2022-11-01";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.post(this.client.getEndpoint(), apiVersion, body, accept, context);
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux<
+ PollResult, CalculateExchangeOperationResultResponseInner>
+ beginPostAsync(CalculateExchangeRequest body) {
+ Mono>> mono = postWithResponseAsync(body);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ CalculateExchangeOperationResultResponseInner.class,
+ CalculateExchangeOperationResultResponseInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * 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 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux<
+ PollResult, CalculateExchangeOperationResultResponseInner>
+ beginPostAsync(CalculateExchangeRequest body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = postWithResponseAsync(body, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ CalculateExchangeOperationResultResponseInner.class,
+ CalculateExchangeOperationResultResponseInner.class,
+ context);
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller<
+ PollResult, CalculateExchangeOperationResultResponseInner>
+ beginPost(CalculateExchangeRequest body) {
+ return this.beginPostAsync(body).getSyncPoller();
+ }
+
+ /**
+ * 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 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller<
+ PollResult, CalculateExchangeOperationResultResponseInner>
+ beginPost(CalculateExchangeRequest body, Context context) {
+ return this.beginPostAsync(body, context).getSyncPoller();
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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) {
+ return beginPostAsync(body).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 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CalculateExchangeOperationResultResponseInner post(CalculateExchangeRequest body) {
+ return postAsync(body).block();
+ }
+
+ /**
+ * 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 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CalculateExchangeOperationResultResponseInner post(CalculateExchangeRequest body, Context context) {
+ return postAsync(body, context).block();
+ }
+}
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
new file mode 100644
index 0000000000000..8e0b0e02dd723
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateExchangesImpl.java
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.reservations.fluent.CalculateExchangesClient;
+import com.azure.resourcemanager.reservations.fluent.models.CalculateExchangeOperationResultResponseInner;
+import com.azure.resourcemanager.reservations.models.CalculateExchangeOperationResultResponse;
+import com.azure.resourcemanager.reservations.models.CalculateExchangeRequest;
+import com.azure.resourcemanager.reservations.models.CalculateExchanges;
+
+public final class CalculateExchangesImpl implements CalculateExchanges {
+ private static final ClientLogger LOGGER = new ClientLogger(CalculateExchangesImpl.class);
+
+ private final CalculateExchangesClient innerClient;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ public CalculateExchangesImpl(
+ CalculateExchangesClient innerClient,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public CalculateExchangeOperationResultResponse post(CalculateExchangeRequest body) {
+ CalculateExchangeOperationResultResponseInner inner = this.serviceClient().post(body);
+ if (inner != null) {
+ return new CalculateExchangeOperationResultResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public CalculateExchangeOperationResultResponse post(CalculateExchangeRequest body, Context context) {
+ CalculateExchangeOperationResultResponseInner inner = this.serviceClient().post(body, context);
+ if (inner != null) {
+ return new CalculateExchangeOperationResultResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private CalculateExchangesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculatePriceResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculatePriceResponseImpl.java
new file mode 100644
index 0000000000000..c5bb28847efe6
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculatePriceResponseImpl.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.CalculatePriceResponseInner;
+import com.azure.resourcemanager.reservations.models.CalculatePriceResponse;
+import com.azure.resourcemanager.reservations.models.CalculatePriceResponseProperties;
+
+public final class CalculatePriceResponseImpl implements CalculatePriceResponse {
+ private CalculatePriceResponseInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ CalculatePriceResponseImpl(
+ CalculatePriceResponseInner innerObject,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public CalculatePriceResponseProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public CalculatePriceResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundResponseImpl.java
new file mode 100644
index 0000000000000..398828ae32bac
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundResponseImpl.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.CalculateRefundResponseInner;
+import com.azure.resourcemanager.reservations.models.CalculateRefundResponse;
+import com.azure.resourcemanager.reservations.models.RefundResponseProperties;
+
+public final class CalculateRefundResponseImpl implements CalculateRefundResponse {
+ private CalculateRefundResponseInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ CalculateRefundResponseImpl(
+ CalculateRefundResponseInner innerObject,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public RefundResponseProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public CalculateRefundResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsClientImpl.java
new file mode 100644
index 0000000000000..6f7742fd81634
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsClientImpl.java
@@ -0,0 +1,201 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.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;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.reservations.fluent.CalculateRefundsClient;
+import com.azure.resourcemanager.reservations.fluent.models.CalculateRefundResponseInner;
+import com.azure.resourcemanager.reservations.models.CalculateRefundRequest;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in CalculateRefundsClient. */
+public final class CalculateRefundsClientImpl implements CalculateRefundsClient {
+ /** The proxy service used to perform REST calls. */
+ private final CalculateRefundsService service;
+
+ /** The service client containing this operation class. */
+ private final AzureReservationApiImpl client;
+
+ /**
+ * Initializes an instance of CalculateRefundsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ CalculateRefundsClientImpl(AzureReservationApiImpl 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.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureReservationApiC")
+ 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);
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (reservationOrderId == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter reservationOrderId is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String apiVersion = "2022-11-01";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service.post(this.client.getEndpoint(), reservationOrderId, apiVersion, body, accept, 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.
+ *
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono postAsync(String reservationOrderId, CalculateRefundRequest body) {
+ return postWithResponseAsync(reservationOrderId, body).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response postWithResponse(
+ String reservationOrderId, CalculateRefundRequest body, Context context) {
+ return postWithResponseAsync(reservationOrderId, body, context).block();
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CalculateRefundResponseInner post(String reservationOrderId, CalculateRefundRequest body) {
+ return postWithResponse(reservationOrderId, body, Context.NONE).getValue();
+ }
+}
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
new file mode 100644
index 0000000000000..180bbdb055148
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CalculateRefundsImpl.java
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.reservations.fluent.CalculateRefundsClient;
+import com.azure.resourcemanager.reservations.fluent.models.CalculateRefundResponseInner;
+import com.azure.resourcemanager.reservations.models.CalculateRefundRequest;
+import com.azure.resourcemanager.reservations.models.CalculateRefundResponse;
+import com.azure.resourcemanager.reservations.models.CalculateRefunds;
+
+public final class CalculateRefundsImpl implements CalculateRefunds {
+ private static final ClientLogger LOGGER = new ClientLogger(CalculateRefundsImpl.class);
+
+ private final CalculateRefundsClient innerClient;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ public CalculateRefundsImpl(
+ CalculateRefundsClient innerClient, com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response postWithResponse(
+ String reservationOrderId, CalculateRefundRequest body, 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;
+ }
+ }
+
+ public CalculateRefundResponse post(String reservationOrderId, CalculateRefundRequest body) {
+ CalculateRefundResponseInner inner = this.serviceClient().post(reservationOrderId, body);
+ if (inner != null) {
+ return new CalculateRefundResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private CalculateRefundsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CatalogImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CatalogImpl.java
new file mode 100644
index 0000000000000..5945c5f8ed2b0
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CatalogImpl.java
@@ -0,0 +1,110 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.CatalogInner;
+import com.azure.resourcemanager.reservations.models.Catalog;
+import com.azure.resourcemanager.reservations.models.CatalogMsrp;
+import com.azure.resourcemanager.reservations.models.ReservationBillingPlan;
+import com.azure.resourcemanager.reservations.models.ReservationTerm;
+import com.azure.resourcemanager.reservations.models.SkuCapability;
+import com.azure.resourcemanager.reservations.models.SkuProperty;
+import com.azure.resourcemanager.reservations.models.SkuRestriction;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class CatalogImpl implements Catalog {
+ private CatalogInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ CatalogImpl(CatalogInner innerObject, com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String resourceType() {
+ return this.innerModel().resourceType();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Map> billingPlans() {
+ Map> inner = this.innerModel().billingPlans();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public List terms() {
+ List inner = this.innerModel().terms();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public List locations() {
+ List inner = this.innerModel().locations();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public List skuProperties() {
+ List inner = this.innerModel().skuProperties();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public CatalogMsrp msrp() {
+ return this.innerModel().msrp();
+ }
+
+ public List restrictions() {
+ List inner = this.innerModel().restrictions();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public String tier() {
+ return this.innerModel().tier();
+ }
+
+ public String size() {
+ return this.innerModel().size();
+ }
+
+ public List capabilities() {
+ List inner = this.innerModel().capabilities();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public CatalogInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ChangeDirectoryResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ChangeDirectoryResponseImpl.java
new file mode 100644
index 0000000000000..fa39096b3dbce
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ChangeDirectoryResponseImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.ChangeDirectoryResponseInner;
+import com.azure.resourcemanager.reservations.models.ChangeDirectoryResponse;
+import com.azure.resourcemanager.reservations.models.ChangeDirectoryResult;
+import java.util.Collections;
+import java.util.List;
+
+public final class ChangeDirectoryResponseImpl implements ChangeDirectoryResponse {
+ private ChangeDirectoryResponseInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ ChangeDirectoryResponseImpl(
+ ChangeDirectoryResponseInner innerObject,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public ChangeDirectoryResult reservationOrder() {
+ return this.innerModel().reservationOrder();
+ }
+
+ public List reservations() {
+ List inner = this.innerModel().reservations();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public ChangeDirectoryResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CurrentQuotaLimitBaseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CurrentQuotaLimitBaseImpl.java
new file mode 100644
index 0000000000000..508c858082627
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/CurrentQuotaLimitBaseImpl.java
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.reservations.fluent.models.CurrentQuotaLimitBaseInner;
+import com.azure.resourcemanager.reservations.models.CurrentQuotaLimitBase;
+import com.azure.resourcemanager.reservations.models.QuotaProperties;
+
+public final class CurrentQuotaLimitBaseImpl
+ implements CurrentQuotaLimitBase, CurrentQuotaLimitBase.Definition, CurrentQuotaLimitBase.Update {
+ private CurrentQuotaLimitBaseInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public QuotaProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public CurrentQuotaLimitBaseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+
+ private String subscriptionId;
+
+ private String providerId;
+
+ private String location;
+
+ private String resourceName;
+
+ public CurrentQuotaLimitBaseImpl withExistingLocation(String subscriptionId, String providerId, String location) {
+ this.subscriptionId = subscriptionId;
+ this.providerId = providerId;
+ this.location = location;
+ return this;
+ }
+
+ public CurrentQuotaLimitBase create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getQuotas()
+ .createOrUpdate(subscriptionId, providerId, location, resourceName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public CurrentQuotaLimitBase create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getQuotas()
+ .createOrUpdate(subscriptionId, providerId, location, resourceName, this.innerModel(), context);
+ return this;
+ }
+
+ CurrentQuotaLimitBaseImpl(String name, com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = new CurrentQuotaLimitBaseInner();
+ this.serviceManager = serviceManager;
+ this.resourceName = name;
+ }
+
+ public CurrentQuotaLimitBaseImpl update() {
+ return this;
+ }
+
+ public CurrentQuotaLimitBase apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getQuotas()
+ .update(subscriptionId, providerId, location, resourceName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public CurrentQuotaLimitBase apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getQuotas()
+ .update(subscriptionId, providerId, location, resourceName, this.innerModel(), context);
+ return this;
+ }
+
+ CurrentQuotaLimitBaseImpl(
+ CurrentQuotaLimitBaseInner innerObject,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.subscriptionId = Utils.getValueFromIdByName(innerObject.id(), "subscriptions");
+ this.providerId = Utils.getValueFromIdByName(innerObject.id(), "resourceProviders");
+ this.location = Utils.getValueFromIdByName(innerObject.id(), "locations");
+ this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "serviceLimits");
+ }
+
+ public CurrentQuotaLimitBase refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getQuotas()
+ .getWithResponse(subscriptionId, providerId, location, resourceName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public CurrentQuotaLimitBase refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getQuotas()
+ .getWithResponse(subscriptionId, providerId, location, resourceName, context)
+ .getValue();
+ return this;
+ }
+
+ public CurrentQuotaLimitBaseImpl withProperties(QuotaProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
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
new file mode 100644
index 0000000000000..e423b53859905
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangeOperationResultResponseImpl.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.ExchangeOperationResultResponseInner;
+import com.azure.resourcemanager.reservations.models.ExchangeOperationResultResponse;
+import com.azure.resourcemanager.reservations.models.ExchangeOperationResultStatus;
+import com.azure.resourcemanager.reservations.models.ExchangeResponseProperties;
+import com.azure.resourcemanager.reservations.models.OperationResultError;
+
+public final class ExchangeOperationResultResponseImpl implements ExchangeOperationResultResponse {
+ private ExchangeOperationResultResponseInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ ExchangeOperationResultResponseImpl(
+ ExchangeOperationResultResponseInner innerObject,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public ExchangeOperationResultStatus status() {
+ return this.innerModel().status();
+ }
+
+ public ExchangeResponseProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public OperationResultError error() {
+ return this.innerModel().error();
+ }
+
+ public ExchangeOperationResultResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesClientImpl.java
new file mode 100644
index 0000000000000..79d28199d58b7
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesClientImpl.java
@@ -0,0 +1,286 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.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;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.reservations.fluent.ExchangesClient;
+import com.azure.resourcemanager.reservations.fluent.models.ExchangeOperationResultResponseInner;
+import com.azure.resourcemanager.reservations.models.ExchangeRequest;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ExchangesClient. */
+public final class ExchangesClientImpl implements ExchangesClient {
+ /** The proxy service used to perform REST calls. */
+ private final ExchangesService service;
+
+ /** The service client containing this operation class. */
+ private final AzureReservationApiImpl client;
+
+ /**
+ * Initializes an instance of ExchangesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ExchangesClientImpl(AzureReservationApiImpl 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.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureReservationApiE")
+ 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);
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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}.
+ */
+ @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 accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.post(this.client.getEndpoint(), apiVersion, body, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * 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 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 along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @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();
+ }
+ final String apiVersion = "2022-11-01";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.post(this.client.getEndpoint(), apiVersion, body, accept, context);
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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.
+ */
+ @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());
+ }
+
+ /**
+ * 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 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ExchangeOperationResultResponseInner>
+ beginPostAsync(ExchangeRequest body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = postWithResponseAsync(body, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ExchangeOperationResultResponseInner.class,
+ ExchangeOperationResultResponseInner.class,
+ context);
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExchangeOperationResultResponseInner> beginPost(
+ ExchangeRequest body) {
+ return this.beginPostAsync(body).getSyncPoller();
+ }
+
+ /**
+ * 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 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.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExchangeOperationResultResponseInner> beginPost(
+ ExchangeRequest body, Context context) {
+ return this.beginPostAsync(body, context).getSyncPoller();
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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) {
+ return beginPostAsync(body).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 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ExchangeOperationResultResponseInner post(ExchangeRequest body) {
+ return postAsync(body).block();
+ }
+
+ /**
+ * 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 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ExchangeOperationResultResponseInner post(ExchangeRequest body, Context context) {
+ return postAsync(body, context).block();
+ }
+}
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
new file mode 100644
index 0000000000000..d03c6f4079c75
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/ExchangesImpl.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.reservations.fluent.ExchangesClient;
+import com.azure.resourcemanager.reservations.fluent.models.ExchangeOperationResultResponseInner;
+import com.azure.resourcemanager.reservations.models.ExchangeOperationResultResponse;
+import com.azure.resourcemanager.reservations.models.ExchangeRequest;
+import com.azure.resourcemanager.reservations.models.Exchanges;
+
+public final class ExchangesImpl implements Exchanges {
+ private static final ClientLogger LOGGER = new ClientLogger(ExchangesImpl.class);
+
+ private final ExchangesClient innerClient;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ public ExchangesImpl(
+ ExchangesClient innerClient, com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public ExchangeOperationResultResponse post(ExchangeRequest body) {
+ ExchangeOperationResultResponseInner inner = this.serviceClient().post(body);
+ if (inner != null) {
+ return new ExchangeOperationResultResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public ExchangeOperationResultResponse post(ExchangeRequest body, Context context) {
+ ExchangeOperationResultResponseInner inner = this.serviceClient().post(body, context);
+ if (inner != null) {
+ return new ExchangeOperationResultResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private ExchangesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationResponseImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationResponseImpl.java
new file mode 100644
index 0000000000000..c83f82c120e0b
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationResponseImpl.java
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner;
+import com.azure.resourcemanager.reservations.models.OperationDisplay;
+import com.azure.resourcemanager.reservations.models.OperationResponse;
+
+public final class OperationResponseImpl implements OperationResponse {
+ private OperationResponseInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ OperationResponseImpl(
+ OperationResponseInner innerObject, com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public OperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public String origin() {
+ return this.innerModel().origin();
+ }
+
+ public Object properties() {
+ return this.innerModel().properties();
+ }
+
+ public OperationResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsClientImpl.java
new file mode 100644
index 0000000000000..e21dc437721a5
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsClientImpl.java
@@ -0,0 +1,281 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.reservations.fluent.OperationsClient;
+import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner;
+import com.azure.resourcemanager.reservations.models.OperationList;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public final class OperationsClientImpl implements OperationsClient {
+ /** The proxy service used to perform REST calls. */
+ private final OperationsService service;
+
+ /** The service client containing this operation class. */
+ private final AzureReservationApiImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(AzureReservationApiImpl 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.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureReservationApiO")
+ public interface OperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.Capacity/operations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Get operations.
+ *
+ * List all the operations.
+ *
+ * @throws 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String apiVersion = "2022-11-01";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get operations.
+ *
+ * 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}.
+ */
+ @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));
+ }
+
+ /**
+ * Get operations.
+ *
+ * List all the operations.
+ *
+ * @throws 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}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Get operations.
+ *
+ * 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 as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Get operations.
+ *
+ * List all the operations.
+ *
+ * @throws 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}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Get operations.
+ *
+ * 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 as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @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}.
+ */
+ @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."));
+ }
+ 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));
+ }
+}
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
new file mode 100644
index 0000000000000..85c034a855dbe
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/OperationsImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.reservations.fluent.OperationsClient;
+import com.azure.resourcemanager.reservations.fluent.models.OperationResponseInner;
+import com.azure.resourcemanager.reservations.models.OperationResponse;
+import com.azure.resourcemanager.reservations.models.Operations;
+
+public final class OperationsImpl implements Operations {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
+
+ private final OperationsClient innerClient;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ public OperationsImpl(
+ OperationsClient innerClient, com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new OperationResponseImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new OperationResponseImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestDetailsImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestDetailsImpl.java
new file mode 100644
index 0000000000000..dc1e50bb5b0d7
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestDetailsImpl.java
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner;
+import com.azure.resourcemanager.reservations.models.QuotaRequestDetails;
+import com.azure.resourcemanager.reservations.models.QuotaRequestState;
+import com.azure.resourcemanager.reservations.models.SubRequest;
+import java.time.OffsetDateTime;
+import java.util.Collections;
+import java.util.List;
+
+public final class QuotaRequestDetailsImpl implements QuotaRequestDetails {
+ private QuotaRequestDetailsInner innerObject;
+
+ private final com.azure.resourcemanager.reservations.ReservationsManager serviceManager;
+
+ QuotaRequestDetailsImpl(
+ QuotaRequestDetailsInner innerObject,
+ com.azure.resourcemanager.reservations.ReservationsManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public QuotaRequestState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public String message() {
+ return this.innerModel().message();
+ }
+
+ public OffsetDateTime requestSubmitTime() {
+ return this.innerModel().requestSubmitTime();
+ }
+
+ public List value() {
+ List inner = this.innerModel().value();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public QuotaRequestDetailsInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.reservations.ReservationsManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusClientImpl.java b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusClientImpl.java
new file mode 100644
index 0000000000000..e56580f678c66
--- /dev/null
+++ b/sdk/reservations/azure-resourcemanager-reservations/src/main/java/com/azure/resourcemanager/reservations/implementation/QuotaRequestStatusClientImpl.java
@@ -0,0 +1,599 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.reservations.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.reservations.fluent.QuotaRequestStatusClient;
+import com.azure.resourcemanager.reservations.fluent.models.QuotaRequestDetailsInner;
+import com.azure.resourcemanager.reservations.models.QuotaRequestDetailsList;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in QuotaRequestStatusClient. */
+public final class QuotaRequestStatusClientImpl implements QuotaRequestStatusClient {
+ /** The proxy service used to perform REST calls. */
+ private final QuotaRequestStatusService service;
+
+ /** The service client containing this operation class. */
+ private final AzureReservationApiImpl client;
+
+ /**
+ * Initializes an instance of QuotaRequestStatusClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ QuotaRequestStatusClientImpl(AzureReservationApiImpl 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.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureReservationApiQ")
+ 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,
+ @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("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @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("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * 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 providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param id Quota Request ID.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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) {
+ 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,
+ location,
+ id,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * 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 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 providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param id Quota Request ID.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(
+ String subscriptionId, String providerId, String location, String id) {
+ return getWithResponseAsync(subscriptionId, providerId, location, id)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * 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 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}.
+ */
+ @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();
+ }
+
+ /**
+ * 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 providerId Azure resource provider ID.
+ * @param location Azure region.
+ * @param id Quota Request ID.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public QuotaRequestDetailsInner get(String subscriptionId, String providerId, String location, String id) {
+ return getWithResponse(subscriptionId, providerId, location, id, Context.NONE).getValue();
+ }
+
+ /**
+ * 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 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 along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @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,
+ location,
+ filter,
+ top,
+ skiptoken,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * 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 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.
+ * @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}.
+ */
+ @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));
+ }
+
+ /**
+ * 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 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