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 azurefleet service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the azurefleet service API instance.
+ */
+ public AzurefleetManager 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.azurefleet")
+ .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 BearerTokenAuthenticationPolicy(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 AzurefleetManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * 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 Fleets. It manages Fleet.
+ *
+ * @return Resource collection API of Fleets.
+ */
+ public Fleets fleets() {
+ if (this.fleets == null) {
+ this.fleets = new FleetsImpl(clientObject.getFleets(), this);
+ }
+ return fleets;
+ }
+
+ /**
+ * Gets wrapped service client MicrosoftAzureFleet providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client MicrosoftAzureFleet.
+ */
+ public MicrosoftAzureFleet serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/FleetsClient.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/FleetsClient.java
new file mode 100644
index 0000000000000..a739bce2c9689
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/FleetsClient.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.azurefleet.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.azurefleet.fluent.models.FleetInner;
+import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner;
+import com.azure.resourcemanager.azurefleet.models.FleetUpdate;
+
+/**
+ * An instance of this class provides access to all the operations defined in FleetsClient.
+ */
+public interface FleetsClient {
+ /**
+ * List Fleet resources by subscription ID.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List Fleet resources by subscription 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 the response of a Fleet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * List Fleet resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List Fleet resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Get a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @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 Fleet along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(String resourceGroupName, String fleetName, Context context);
+
+ /**
+ * Get a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @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 Fleet.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FleetInner getByResourceGroup(String resourceGroupName, String fleetName);
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, FleetInner> beginCreateOrUpdate(String resourceGroupName, String fleetName,
+ FleetInner resource);
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, FleetInner> beginCreateOrUpdate(String resourceGroupName, String fleetName,
+ FleetInner resource, Context context);
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FleetInner createOrUpdate(String resourceGroupName, String fleetName, FleetInner resource);
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FleetInner createOrUpdate(String resourceGroupName, String fleetName, FleetInner resource, Context context);
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, FleetInner> beginUpdate(String resourceGroupName, String fleetName,
+ FleetUpdate properties);
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, FleetInner> beginUpdate(String resourceGroupName, String fleetName,
+ FleetUpdate properties, Context context);
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FleetInner update(String resourceGroupName, String fleetName, FleetUpdate properties);
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FleetInner update(String resourceGroupName, String fleetName, FleetUpdate properties, Context context);
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName);
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, Context context);
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @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 delete(String resourceGroupName, String fleetName);
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String fleetName, Context context);
+
+ /**
+ * List VirtualMachineScaleSet resources by Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param name The name of the Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listVirtualMachineScaleSets(String resourceGroupName, String name);
+
+ /**
+ * List VirtualMachineScaleSet resources by Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param name The name of the Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listVirtualMachineScaleSets(String resourceGroupName, String name,
+ Context context);
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/MicrosoftAzureFleet.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/MicrosoftAzureFleet.java
new file mode 100644
index 0000000000000..a0c149138de03
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/MicrosoftAzureFleet.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for MicrosoftAzureFleet class.
+ */
+public interface MicrosoftAzureFleet {
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * 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 OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the FleetsClient object to access its operations.
+ *
+ * @return the FleetsClient object.
+ */
+ FleetsClient getFleets();
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/OperationsClient.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/OperationsClient.java
new file mode 100644
index 0000000000000..286f74f260aca
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/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.azurefleet.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.azurefleet.fluent.models.OperationInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
+public interface OperationsClient {
+ /**
+ * List the operations for the provider.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetInner.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetInner.java
new file mode 100644
index 0000000000000..152d2fbafa0ba
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetInner.java
@@ -0,0 +1,449 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.azurefleet.models.AdditionalLocationsProfile;
+import com.azure.resourcemanager.azurefleet.models.ComputeProfile;
+import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.azurefleet.models.Plan;
+import com.azure.resourcemanager.azurefleet.models.ProvisioningState;
+import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile;
+import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile;
+import com.azure.resourcemanager.azurefleet.models.VMAttributes;
+import com.azure.resourcemanager.azurefleet.models.VmSizeProfile;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * An Compute Fleet resource.
+ */
+@Fluent
+public final class FleetInner extends Resource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private FleetProperties innerProperties;
+
+ /*
+ * Zones in which the Compute Fleet is available
+ */
+ private List zones;
+
+ /*
+ * The managed service identities assigned to this resource.
+ */
+ private ManagedServiceIdentity identity;
+
+ /*
+ * Details of the resource plan.
+ */
+ private Plan plan;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of FleetInner class.
+ */
+ public FleetInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private FleetProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the zones property: Zones in which the Compute Fleet is available.
+ *
+ * @return the zones value.
+ */
+ public List zones() {
+ return this.zones;
+ }
+
+ /**
+ * Set the zones property: Zones in which the Compute Fleet is available.
+ *
+ * @param zones the zones value to set.
+ * @return the FleetInner object itself.
+ */
+ public FleetInner withZones(List zones) {
+ this.zones = zones;
+ return this;
+ }
+
+ /**
+ * Get the identity property: The managed service identities assigned to this resource.
+ *
+ * @return the identity value.
+ */
+ public ManagedServiceIdentity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the identity property: The managed service identities assigned to this resource.
+ *
+ * @param identity the identity value to set.
+ * @return the FleetInner object itself.
+ */
+ public FleetInner withIdentity(ManagedServiceIdentity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+ /**
+ * Get the plan property: Details of the resource plan.
+ *
+ * @return the plan value.
+ */
+ public Plan plan() {
+ return this.plan;
+ }
+
+ /**
+ * Set the plan property: Details of the resource plan.
+ *
+ * @param plan the plan value to set.
+ * @return the FleetInner object itself.
+ */
+ public FleetInner withPlan(Plan plan) {
+ this.plan = plan;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public FleetInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public FleetInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The status of the last operation.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet.
+ *
+ * @return the spotPriorityProfile value.
+ */
+ public SpotPriorityProfile spotPriorityProfile() {
+ return this.innerProperties() == null ? null : this.innerProperties().spotPriorityProfile();
+ }
+
+ /**
+ * Set the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet.
+ *
+ * @param spotPriorityProfile the spotPriorityProfile value to set.
+ * @return the FleetInner object itself.
+ */
+ public FleetInner withSpotPriorityProfile(SpotPriorityProfile spotPriorityProfile) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FleetProperties();
+ }
+ this.innerProperties().withSpotPriorityProfile(spotPriorityProfile);
+ return this;
+ }
+
+ /**
+ * Get the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet.
+ *
+ * @return the regularPriorityProfile value.
+ */
+ public RegularPriorityProfile regularPriorityProfile() {
+ return this.innerProperties() == null ? null : this.innerProperties().regularPriorityProfile();
+ }
+
+ /**
+ * Set the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet.
+ *
+ * @param regularPriorityProfile the regularPriorityProfile value to set.
+ * @return the FleetInner object itself.
+ */
+ public FleetInner withRegularPriorityProfile(RegularPriorityProfile regularPriorityProfile) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FleetProperties();
+ }
+ this.innerProperties().withRegularPriorityProfile(regularPriorityProfile);
+ return this;
+ }
+
+ /**
+ * Get the vmSizesProfile property: List of VM sizes supported for Compute Fleet.
+ *
+ * @return the vmSizesProfile value.
+ */
+ public List vmSizesProfile() {
+ return this.innerProperties() == null ? null : this.innerProperties().vmSizesProfile();
+ }
+
+ /**
+ * Set the vmSizesProfile property: List of VM sizes supported for Compute Fleet.
+ *
+ * @param vmSizesProfile the vmSizesProfile value to set.
+ * @return the FleetInner object itself.
+ */
+ public FleetInner withVmSizesProfile(List vmSizesProfile) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FleetProperties();
+ }
+ this.innerProperties().withVmSizesProfile(vmSizesProfile);
+ return this;
+ }
+
+ /**
+ * Get the vmAttributes property: Attribute based Fleet.
+ *
+ * @return the vmAttributes value.
+ */
+ public VMAttributes vmAttributes() {
+ return this.innerProperties() == null ? null : this.innerProperties().vmAttributes();
+ }
+
+ /**
+ * Set the vmAttributes property: Attribute based Fleet.
+ *
+ * @param vmAttributes the vmAttributes value to set.
+ * @return the FleetInner object itself.
+ */
+ public FleetInner withVmAttributes(VMAttributes vmAttributes) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FleetProperties();
+ }
+ this.innerProperties().withVmAttributes(vmAttributes);
+ return this;
+ }
+
+ /**
+ * Get the additionalLocationsProfile property: Represents the configuration for additional locations where Fleet
+ * resources may be deployed.
+ *
+ * @return the additionalLocationsProfile value.
+ */
+ public AdditionalLocationsProfile additionalLocationsProfile() {
+ return this.innerProperties() == null ? null : this.innerProperties().additionalLocationsProfile();
+ }
+
+ /**
+ * Set the additionalLocationsProfile property: Represents the configuration for additional locations where Fleet
+ * resources may be deployed.
+ *
+ * @param additionalLocationsProfile the additionalLocationsProfile value to set.
+ * @return the FleetInner object itself.
+ */
+ public FleetInner withAdditionalLocationsProfile(AdditionalLocationsProfile additionalLocationsProfile) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FleetProperties();
+ }
+ this.innerProperties().withAdditionalLocationsProfile(additionalLocationsProfile);
+ return this;
+ }
+
+ /**
+ * Get the computeProfile property: Compute Profile to use for running user's workloads.
+ *
+ * @return the computeProfile value.
+ */
+ public ComputeProfile computeProfile() {
+ return this.innerProperties() == null ? null : this.innerProperties().computeProfile();
+ }
+
+ /**
+ * Set the computeProfile property: Compute Profile to use for running user's workloads.
+ *
+ * @param computeProfile the computeProfile value to set.
+ * @return the FleetInner object itself.
+ */
+ public FleetInner withComputeProfile(ComputeProfile computeProfile) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FleetProperties();
+ }
+ this.innerProperties().withComputeProfile(computeProfile);
+ return this;
+ }
+
+ /**
+ * Get the timeCreated property: Specifies the time at which the Compute Fleet is created.
+ *
+ * @return the timeCreated value.
+ */
+ public OffsetDateTime timeCreated() {
+ return this.innerProperties() == null ? null : this.innerProperties().timeCreated();
+ }
+
+ /**
+ * Get the uniqueId property: Specifies the ID which uniquely identifies a Compute Fleet.
+ *
+ * @return the uniqueId value.
+ */
+ public String uniqueId() {
+ return this.innerProperties() == null ? null : this.innerProperties().uniqueId();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ if (identity() != null) {
+ identity().validate();
+ }
+ if (plan() != null) {
+ plan().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("identity", this.identity);
+ jsonWriter.writeJsonField("plan", this.plan);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of FleetInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of FleetInner if the JsonReader was pointing to an instance of it, or null if it was pointing
+ * to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the FleetInner.
+ */
+ public static FleetInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ FleetInner deserializedFleetInner = new FleetInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedFleetInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedFleetInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedFleetInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedFleetInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedFleetInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedFleetInner.innerProperties = FleetProperties.fromJson(reader);
+ } else if ("zones".equals(fieldName)) {
+ List zones = reader.readArray(reader1 -> reader1.getString());
+ deserializedFleetInner.zones = zones;
+ } else if ("identity".equals(fieldName)) {
+ deserializedFleetInner.identity = ManagedServiceIdentity.fromJson(reader);
+ } else if ("plan".equals(fieldName)) {
+ deserializedFleetInner.plan = Plan.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedFleetInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedFleetInner;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetProperties.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetProperties.java
new file mode 100644
index 0000000000000..f4e16cc66a889
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetProperties.java
@@ -0,0 +1,325 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.azurefleet.models.AdditionalLocationsProfile;
+import com.azure.resourcemanager.azurefleet.models.ComputeProfile;
+import com.azure.resourcemanager.azurefleet.models.ProvisioningState;
+import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile;
+import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile;
+import com.azure.resourcemanager.azurefleet.models.VMAttributes;
+import com.azure.resourcemanager.azurefleet.models.VmSizeProfile;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.util.List;
+
+/**
+ * Details of the Compute Fleet.
+ */
+@Fluent
+public final class FleetProperties implements JsonSerializable {
+ /*
+ * The status of the last operation.
+ */
+ private ProvisioningState provisioningState;
+
+ /*
+ * Configuration Options for Spot instances in Compute Fleet.
+ */
+ private SpotPriorityProfile spotPriorityProfile;
+
+ /*
+ * Configuration Options for Regular instances in Compute Fleet.
+ */
+ private RegularPriorityProfile regularPriorityProfile;
+
+ /*
+ * List of VM sizes supported for Compute Fleet
+ */
+ private List vmSizesProfile;
+
+ /*
+ * Attribute based Fleet.
+ */
+ private VMAttributes vmAttributes;
+
+ /*
+ * Represents the configuration for additional locations where Fleet resources may be deployed.
+ */
+ private AdditionalLocationsProfile additionalLocationsProfile;
+
+ /*
+ * Compute Profile to use for running user's workloads.
+ */
+ private ComputeProfile computeProfile;
+
+ /*
+ * Specifies the time at which the Compute Fleet is created.
+ */
+ private OffsetDateTime timeCreated;
+
+ /*
+ * Specifies the ID which uniquely identifies a Compute Fleet.
+ */
+ private String uniqueId;
+
+ /**
+ * Creates an instance of FleetProperties class.
+ */
+ public FleetProperties() {
+ }
+
+ /**
+ * Get the provisioningState property: The status of the last operation.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet.
+ *
+ * @return the spotPriorityProfile value.
+ */
+ public SpotPriorityProfile spotPriorityProfile() {
+ return this.spotPriorityProfile;
+ }
+
+ /**
+ * Set the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet.
+ *
+ * @param spotPriorityProfile the spotPriorityProfile value to set.
+ * @return the FleetProperties object itself.
+ */
+ public FleetProperties withSpotPriorityProfile(SpotPriorityProfile spotPriorityProfile) {
+ this.spotPriorityProfile = spotPriorityProfile;
+ return this;
+ }
+
+ /**
+ * Get the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet.
+ *
+ * @return the regularPriorityProfile value.
+ */
+ public RegularPriorityProfile regularPriorityProfile() {
+ return this.regularPriorityProfile;
+ }
+
+ /**
+ * Set the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet.
+ *
+ * @param regularPriorityProfile the regularPriorityProfile value to set.
+ * @return the FleetProperties object itself.
+ */
+ public FleetProperties withRegularPriorityProfile(RegularPriorityProfile regularPriorityProfile) {
+ this.regularPriorityProfile = regularPriorityProfile;
+ return this;
+ }
+
+ /**
+ * Get the vmSizesProfile property: List of VM sizes supported for Compute Fleet.
+ *
+ * @return the vmSizesProfile value.
+ */
+ public List vmSizesProfile() {
+ return this.vmSizesProfile;
+ }
+
+ /**
+ * Set the vmSizesProfile property: List of VM sizes supported for Compute Fleet.
+ *
+ * @param vmSizesProfile the vmSizesProfile value to set.
+ * @return the FleetProperties object itself.
+ */
+ public FleetProperties withVmSizesProfile(List vmSizesProfile) {
+ this.vmSizesProfile = vmSizesProfile;
+ return this;
+ }
+
+ /**
+ * Get the vmAttributes property: Attribute based Fleet.
+ *
+ * @return the vmAttributes value.
+ */
+ public VMAttributes vmAttributes() {
+ return this.vmAttributes;
+ }
+
+ /**
+ * Set the vmAttributes property: Attribute based Fleet.
+ *
+ * @param vmAttributes the vmAttributes value to set.
+ * @return the FleetProperties object itself.
+ */
+ public FleetProperties withVmAttributes(VMAttributes vmAttributes) {
+ this.vmAttributes = vmAttributes;
+ return this;
+ }
+
+ /**
+ * Get the additionalLocationsProfile property: Represents the configuration for additional locations where Fleet
+ * resources may be deployed.
+ *
+ * @return the additionalLocationsProfile value.
+ */
+ public AdditionalLocationsProfile additionalLocationsProfile() {
+ return this.additionalLocationsProfile;
+ }
+
+ /**
+ * Set the additionalLocationsProfile property: Represents the configuration for additional locations where Fleet
+ * resources may be deployed.
+ *
+ * @param additionalLocationsProfile the additionalLocationsProfile value to set.
+ * @return the FleetProperties object itself.
+ */
+ public FleetProperties withAdditionalLocationsProfile(AdditionalLocationsProfile additionalLocationsProfile) {
+ this.additionalLocationsProfile = additionalLocationsProfile;
+ return this;
+ }
+
+ /**
+ * Get the computeProfile property: Compute Profile to use for running user's workloads.
+ *
+ * @return the computeProfile value.
+ */
+ public ComputeProfile computeProfile() {
+ return this.computeProfile;
+ }
+
+ /**
+ * Set the computeProfile property: Compute Profile to use for running user's workloads.
+ *
+ * @param computeProfile the computeProfile value to set.
+ * @return the FleetProperties object itself.
+ */
+ public FleetProperties withComputeProfile(ComputeProfile computeProfile) {
+ this.computeProfile = computeProfile;
+ return this;
+ }
+
+ /**
+ * Get the timeCreated property: Specifies the time at which the Compute Fleet is created.
+ *
+ * @return the timeCreated value.
+ */
+ public OffsetDateTime timeCreated() {
+ return this.timeCreated;
+ }
+
+ /**
+ * Get the uniqueId property: Specifies the ID which uniquely identifies a Compute Fleet.
+ *
+ * @return the uniqueId value.
+ */
+ public String uniqueId() {
+ return this.uniqueId;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (spotPriorityProfile() != null) {
+ spotPriorityProfile().validate();
+ }
+ if (regularPriorityProfile() != null) {
+ regularPriorityProfile().validate();
+ }
+ if (vmSizesProfile() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property vmSizesProfile in model FleetProperties"));
+ } else {
+ vmSizesProfile().forEach(e -> e.validate());
+ }
+ if (vmAttributes() != null) {
+ vmAttributes().validate();
+ }
+ if (additionalLocationsProfile() != null) {
+ additionalLocationsProfile().validate();
+ }
+ if (computeProfile() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property computeProfile in model FleetProperties"));
+ } else {
+ computeProfile().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(FleetProperties.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("vmSizesProfile", this.vmSizesProfile,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("computeProfile", this.computeProfile);
+ jsonWriter.writeJsonField("spotPriorityProfile", this.spotPriorityProfile);
+ jsonWriter.writeJsonField("regularPriorityProfile", this.regularPriorityProfile);
+ jsonWriter.writeJsonField("vmAttributes", this.vmAttributes);
+ jsonWriter.writeJsonField("additionalLocationsProfile", this.additionalLocationsProfile);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of FleetProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of FleetProperties if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the FleetProperties.
+ */
+ public static FleetProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ FleetProperties deserializedFleetProperties = new FleetProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("vmSizesProfile".equals(fieldName)) {
+ List vmSizesProfile = reader.readArray(reader1 -> VmSizeProfile.fromJson(reader1));
+ deserializedFleetProperties.vmSizesProfile = vmSizesProfile;
+ } else if ("computeProfile".equals(fieldName)) {
+ deserializedFleetProperties.computeProfile = ComputeProfile.fromJson(reader);
+ } else if ("provisioningState".equals(fieldName)) {
+ deserializedFleetProperties.provisioningState = ProvisioningState.fromString(reader.getString());
+ } else if ("spotPriorityProfile".equals(fieldName)) {
+ deserializedFleetProperties.spotPriorityProfile = SpotPriorityProfile.fromJson(reader);
+ } else if ("regularPriorityProfile".equals(fieldName)) {
+ deserializedFleetProperties.regularPriorityProfile = RegularPriorityProfile.fromJson(reader);
+ } else if ("vmAttributes".equals(fieldName)) {
+ deserializedFleetProperties.vmAttributes = VMAttributes.fromJson(reader);
+ } else if ("additionalLocationsProfile".equals(fieldName)) {
+ deserializedFleetProperties.additionalLocationsProfile
+ = AdditionalLocationsProfile.fromJson(reader);
+ } else if ("timeCreated".equals(fieldName)) {
+ deserializedFleetProperties.timeCreated = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("uniqueId".equals(fieldName)) {
+ deserializedFleetProperties.uniqueId = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedFleetProperties;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/OperationInner.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/OperationInner.java
new file mode 100644
index 0000000000000..ce1239a1b8d99
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/OperationInner.java
@@ -0,0 +1,172 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.azurefleet.models.ActionType;
+import com.azure.resourcemanager.azurefleet.models.OperationDisplay;
+import com.azure.resourcemanager.azurefleet.models.Origin;
+import java.io.IOException;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Fluent
+public final class OperationInner implements JsonSerializable {
+ /*
+ * The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
+ */
+ private String name;
+
+ /*
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for
+ * ARM/control-plane operations.
+ */
+ private Boolean isDataAction;
+
+ /*
+ * Localized display information for this particular operation.
+ */
+ private OperationDisplay display;
+
+ /*
+ * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+ * value is "user,system"
+ */
+ private Origin origin;
+
+ /*
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ private ActionType actionType;
+
+ /**
+ * Creates an instance of OperationInner class.
+ */
+ public OperationInner() {
+ }
+
+ /**
+ * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
+ * operations and "false" for ARM/control-plane operations.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Get the display property: Localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: Localized display information for this particular operation.
+ *
+ * @param display the display value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withDisplay(OperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
+ * audit logs UX. Default value is "user,system".
+ *
+ * @return the origin value.
+ */
+ public Origin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal
+ * only APIs.
+ *
+ * @return the actionType value.
+ */
+ public ActionType actionType() {
+ return this.actionType;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("display", this.display);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationInner.
+ */
+ public static OperationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationInner deserializedOperationInner = new OperationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedOperationInner.name = reader.getString();
+ } else if ("isDataAction".equals(fieldName)) {
+ deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
+ } else if ("display".equals(fieldName)) {
+ deserializedOperationInner.display = OperationDisplay.fromJson(reader);
+ } else if ("origin".equals(fieldName)) {
+ deserializedOperationInner.origin = Origin.fromString(reader.getString());
+ } else if ("actionType".equals(fieldName)) {
+ deserializedOperationInner.actionType = ActionType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationInner;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetInner.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetInner.java
new file mode 100644
index 0000000000000..b165c548557b6
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetInner.java
@@ -0,0 +1,156 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.azurefleet.models.ApiError;
+import com.azure.resourcemanager.azurefleet.models.ProvisioningState;
+import java.io.IOException;
+
+/**
+ * An AzureFleet's virtualMachineScaleSet.
+ */
+@Immutable
+public final class VirtualMachineScaleSetInner implements JsonSerializable {
+ /*
+ * The name of the virtualMachineScaleSet
+ */
+ private String name;
+
+ /*
+ * The compute RP resource id of the virtualMachineScaleSet
+ * "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}"
+ */
+ private String id;
+
+ /*
+ * Type of the virtualMachineScaleSet
+ */
+ private String type;
+
+ /*
+ * This represents the operationStatus of the VMSS in response to the last operation that was performed on it by
+ * Azure Fleet resource.
+ */
+ private ProvisioningState operationStatus;
+
+ /*
+ * Error Information when `operationStatus` is `Failed`
+ */
+ private ApiError error;
+
+ /**
+ * Creates an instance of VirtualMachineScaleSetInner class.
+ */
+ public VirtualMachineScaleSetInner() {
+ }
+
+ /**
+ * Get the name property: The name of the virtualMachineScaleSet.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: The compute RP resource id of the virtualMachineScaleSet
+ * "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}".
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the type property: Type of the virtualMachineScaleSet.
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the operationStatus property: This represents the operationStatus of the VMSS in response to the last
+ * operation that was performed on it by Azure Fleet resource.
+ *
+ * @return the operationStatus value.
+ */
+ public ProvisioningState operationStatus() {
+ return this.operationStatus;
+ }
+
+ /**
+ * Get the error property: Error Information when `operationStatus` is `Failed`.
+ *
+ * @return the error value.
+ */
+ public ApiError error() {
+ return this.error;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (error() != null) {
+ error().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of VirtualMachineScaleSetInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of VirtualMachineScaleSetInner if the JsonReader was pointing to an instance of it, or null
+ * if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the VirtualMachineScaleSetInner.
+ */
+ public static VirtualMachineScaleSetInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ VirtualMachineScaleSetInner deserializedVirtualMachineScaleSetInner = new VirtualMachineScaleSetInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedVirtualMachineScaleSetInner.name = reader.getString();
+ } else if ("id".equals(fieldName)) {
+ deserializedVirtualMachineScaleSetInner.id = reader.getString();
+ } else if ("operationStatus".equals(fieldName)) {
+ deserializedVirtualMachineScaleSetInner.operationStatus
+ = ProvisioningState.fromString(reader.getString());
+ } else if ("type".equals(fieldName)) {
+ deserializedVirtualMachineScaleSetInner.type = reader.getString();
+ } else if ("error".equals(fieldName)) {
+ deserializedVirtualMachineScaleSetInner.error = ApiError.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedVirtualMachineScaleSetInner;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/package-info.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/package-info.java
new file mode 100644
index 0000000000000..34ccfc630ff35
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/package-info.java
@@ -0,0 +1,9 @@
+// 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 MicrosoftAzureFleet.
+ * null.
+ */
+package com.azure.resourcemanager.azurefleet.fluent.models;
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/package-info.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/package-info.java
new file mode 100644
index 0000000000000..2b1da72465e89
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/package-info.java
@@ -0,0 +1,9 @@
+// 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 MicrosoftAzureFleet.
+ * null.
+ */
+package com.azure.resourcemanager.azurefleet.fluent;
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetImpl.java
new file mode 100644
index 0000000000000..e0448a61a90ea
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetImpl.java
@@ -0,0 +1,298 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.azurefleet.fluent.models.FleetInner;
+import com.azure.resourcemanager.azurefleet.fluent.models.FleetProperties;
+import com.azure.resourcemanager.azurefleet.models.AdditionalLocationsProfile;
+import com.azure.resourcemanager.azurefleet.models.ComputeProfile;
+import com.azure.resourcemanager.azurefleet.models.Fleet;
+import com.azure.resourcemanager.azurefleet.models.FleetUpdate;
+import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityUpdate;
+import com.azure.resourcemanager.azurefleet.models.Plan;
+import com.azure.resourcemanager.azurefleet.models.ProvisioningState;
+import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile;
+import com.azure.resourcemanager.azurefleet.models.ResourcePlanUpdate;
+import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile;
+import com.azure.resourcemanager.azurefleet.models.VMAttributes;
+import com.azure.resourcemanager.azurefleet.models.VmSizeProfile;
+import java.time.OffsetDateTime;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class FleetImpl implements Fleet, Fleet.Definition, Fleet.Update {
+ private FleetInner innerObject;
+
+ private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public List zones() {
+ List inner = this.innerModel().zones();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public ManagedServiceIdentity identity() {
+ return this.innerModel().identity();
+ }
+
+ public Plan plan() {
+ return this.innerModel().plan();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public SpotPriorityProfile spotPriorityProfile() {
+ return this.innerModel().spotPriorityProfile();
+ }
+
+ public RegularPriorityProfile regularPriorityProfile() {
+ return this.innerModel().regularPriorityProfile();
+ }
+
+ public List vmSizesProfile() {
+ List inner = this.innerModel().vmSizesProfile();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public VMAttributes vmAttributes() {
+ return this.innerModel().vmAttributes();
+ }
+
+ public AdditionalLocationsProfile additionalLocationsProfile() {
+ return this.innerModel().additionalLocationsProfile();
+ }
+
+ public ComputeProfile computeProfile() {
+ return this.innerModel().computeProfile();
+ }
+
+ public OffsetDateTime timeCreated() {
+ return this.innerModel().timeCreated();
+ }
+
+ public String uniqueId() {
+ return this.innerModel().uniqueId();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public FleetInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String fleetName;
+
+ private FleetUpdate updateProperties;
+
+ public FleetImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public Fleet create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getFleets()
+ .createOrUpdate(resourceGroupName, fleetName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public Fleet create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getFleets()
+ .createOrUpdate(resourceGroupName, fleetName, this.innerModel(), context);
+ return this;
+ }
+
+ FleetImpl(String name, com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) {
+ this.innerObject = new FleetInner();
+ this.serviceManager = serviceManager;
+ this.fleetName = name;
+ }
+
+ public FleetImpl update() {
+ this.updateProperties = new FleetUpdate();
+ return this;
+ }
+
+ public Fleet apply() {
+ this.innerObject = serviceManager.serviceClient()
+ .getFleets()
+ .update(resourceGroupName, fleetName, updateProperties, Context.NONE);
+ return this;
+ }
+
+ public Fleet apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getFleets()
+ .update(resourceGroupName, fleetName, updateProperties, context);
+ return this;
+ }
+
+ FleetImpl(FleetInner innerObject, com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.fleetName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "fleets");
+ }
+
+ public Fleet refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getFleets()
+ .getByResourceGroupWithResponse(resourceGroupName, fleetName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public Fleet refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getFleets()
+ .getByResourceGroupWithResponse(resourceGroupName, fleetName, context)
+ .getValue();
+ return this;
+ }
+
+ public FleetImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public FleetImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public FleetImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateProperties.withTags(tags);
+ return this;
+ }
+ }
+
+ public FleetImpl withZones(List zones) {
+ this.innerModel().withZones(zones);
+ return this;
+ }
+
+ public FleetImpl withIdentity(ManagedServiceIdentity identity) {
+ this.innerModel().withIdentity(identity);
+ return this;
+ }
+
+ public FleetImpl withPlan(Plan plan) {
+ this.innerModel().withPlan(plan);
+ return this;
+ }
+
+ public FleetImpl withSpotPriorityProfile(SpotPriorityProfile spotPriorityProfile) {
+ this.innerModel().withSpotPriorityProfile(spotPriorityProfile);
+ return this;
+ }
+
+ public FleetImpl withRegularPriorityProfile(RegularPriorityProfile regularPriorityProfile) {
+ this.innerModel().withRegularPriorityProfile(regularPriorityProfile);
+ return this;
+ }
+
+ public FleetImpl withVmSizesProfile(List vmSizesProfile) {
+ this.innerModel().withVmSizesProfile(vmSizesProfile);
+ return this;
+ }
+
+ public FleetImpl withVmAttributes(VMAttributes vmAttributes) {
+ this.innerModel().withVmAttributes(vmAttributes);
+ return this;
+ }
+
+ public FleetImpl withAdditionalLocationsProfile(AdditionalLocationsProfile additionalLocationsProfile) {
+ this.innerModel().withAdditionalLocationsProfile(additionalLocationsProfile);
+ return this;
+ }
+
+ public FleetImpl withComputeProfile(ComputeProfile computeProfile) {
+ this.innerModel().withComputeProfile(computeProfile);
+ return this;
+ }
+
+ public FleetImpl withIdentity(ManagedServiceIdentityUpdate identity) {
+ this.updateProperties.withIdentity(identity);
+ return this;
+ }
+
+ public FleetImpl withPlan(ResourcePlanUpdate plan) {
+ this.updateProperties.withPlan(plan);
+ return this;
+ }
+
+ public FleetImpl withProperties(FleetProperties properties) {
+ this.updateProperties.withProperties(properties);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsClientImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsClientImpl.java
new file mode 100644
index 0000000000000..6b8e9ae3fcfc0
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsClientImpl.java
@@ -0,0 +1,1482 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+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.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.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.azurefleet.fluent.FleetsClient;
+import com.azure.resourcemanager.azurefleet.fluent.models.FleetInner;
+import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner;
+import com.azure.resourcemanager.azurefleet.models.FleetListResult;
+import com.azure.resourcemanager.azurefleet.models.FleetUpdate;
+import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetListResult;
+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 FleetsClient.
+ */
+public final class FleetsClientImpl implements FleetsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final FleetsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final MicrosoftAzureFleetImpl client;
+
+ /**
+ * Initializes an instance of FleetsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ FleetsClientImpl(MicrosoftAzureFleetImpl client) {
+ this.service = RestProxy.create(FleetsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftAzureFleetFleets to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftAzureFleetF")
+ public interface FleetsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName,
+ @BodyParam("application/json") FleetInner resource, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName,
+ @BodyParam("application/json") FleetUpdate properties, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listVirtualMachineScaleSets(
+ @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listBySubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listVirtualMachineScaleSetsNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * List Fleet resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List Fleet resources by subscription 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 the response of a Fleet list operation 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."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept,
+ context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List Fleet resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List Fleet resources by subscription 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 the response of a Fleet list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List Fleet resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List Fleet resources by subscription 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 the response of a Fleet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * List Fleet resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List Fleet resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List Fleet resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List Fleet resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List Fleet resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * List Fleet resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Get a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Fleet along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String fleetName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (fleetName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Fleet along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String fleetName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (fleetName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context);
+ }
+
+ /**
+ * Get a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Fleet on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String fleetName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, fleetName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Fleet along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String fleetName,
+ Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, fleetName, context).block();
+ }
+
+ /**
+ * Get a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Fleet.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FleetInner getByResourceGroup(String resourceGroupName, String fleetName) {
+ return getByResourceGroupWithResponse(resourceGroupName, fleetName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Compute Fleet resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String fleetName,
+ FleetInner resource) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (fleetName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, fleetName, resource, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @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 an Compute Fleet resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String fleetName,
+ FleetInner resource, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (fleetName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, fleetName, resource, accept, context);
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, FleetInner> beginCreateOrUpdateAsync(String resourceGroupName,
+ String fleetName, FleetInner resource) {
+ Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, fleetName, resource);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), FleetInner.class,
+ FleetInner.class, this.client.getContext());
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, FleetInner> beginCreateOrUpdateAsync(String resourceGroupName,
+ String fleetName, FleetInner resource, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, fleetName, resource, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), FleetInner.class,
+ FleetInner.class, context);
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, FleetInner> beginCreateOrUpdate(String resourceGroupName,
+ String fleetName, FleetInner resource) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, fleetName, resource).getSyncPoller();
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, FleetInner> beginCreateOrUpdate(String resourceGroupName,
+ String fleetName, FleetInner resource, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, fleetName, resource, context).getSyncPoller();
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Compute Fleet resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String fleetName, FleetInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, fleetName, resource).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @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 an Compute Fleet resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String fleetName, FleetInner resource,
+ Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, fleetName, resource, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FleetInner createOrUpdate(String resourceGroupName, String fleetName, FleetInner resource) {
+ return createOrUpdateAsync(resourceGroupName, fleetName, resource).block();
+ }
+
+ /**
+ * Create a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param resource Resource create parameters.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FleetInner createOrUpdate(String resourceGroupName, String fleetName, FleetInner resource, Context context) {
+ return createOrUpdateAsync(resourceGroupName, fleetName, resource, context).block();
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Compute Fleet resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName, String fleetName,
+ FleetUpdate properties) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (fleetName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, fleetName, properties, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @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 an Compute Fleet resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName, String fleetName,
+ FleetUpdate properties, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (fleetName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, fleetName, properties, accept, context);
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, FleetInner> beginUpdateAsync(String resourceGroupName, String fleetName,
+ FleetUpdate properties) {
+ Mono>> mono = updateWithResponseAsync(resourceGroupName, fleetName, properties);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), FleetInner.class,
+ FleetInner.class, this.client.getContext());
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, FleetInner> beginUpdateAsync(String resourceGroupName, String fleetName,
+ FleetUpdate properties, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = updateWithResponseAsync(resourceGroupName, fleetName, properties, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), FleetInner.class,
+ FleetInner.class, context);
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, FleetInner> beginUpdate(String resourceGroupName, String fleetName,
+ FleetUpdate properties) {
+ return this.beginUpdateAsync(resourceGroupName, fleetName, properties).getSyncPoller();
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, FleetInner> beginUpdate(String resourceGroupName, String fleetName,
+ FleetUpdate properties, Context context) {
+ return this.beginUpdateAsync(resourceGroupName, fleetName, properties, context).getSyncPoller();
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Compute Fleet resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String fleetName, FleetUpdate properties) {
+ return beginUpdateAsync(resourceGroupName, fleetName, properties).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @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 an Compute Fleet resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String fleetName, FleetUpdate properties,
+ Context context) {
+ return beginUpdateAsync(resourceGroupName, fleetName, properties, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FleetInner update(String resourceGroupName, String fleetName, FleetUpdate properties) {
+ return updateAsync(resourceGroupName, fleetName, properties).block();
+ }
+
+ /**
+ * Update a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param properties The resource properties to be updated.
+ * @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 an Compute Fleet resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FleetInner update(String resourceGroupName, String fleetName, FleetUpdate properties, Context context) {
+ return updateAsync(resourceGroupName, fleetName, properties, context).block();
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String fleetName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (fleetName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String fleetName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (fleetName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, fleetName, accept, context);
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String fleetName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, fleetName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String fleetName,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, fleetName, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName) {
+ return this.beginDeleteAsync(resourceGroupName, fleetName).getSyncPoller();
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, Context context) {
+ return this.beginDeleteAsync(resourceGroupName, fleetName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String fleetName) {
+ return beginDeleteAsync(resourceGroupName, fleetName).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String fleetName, Context context) {
+ return beginDeleteAsync(resourceGroupName, fleetName, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String fleetName) {
+ deleteAsync(resourceGroupName, fleetName).block();
+ }
+
+ /**
+ * Delete a Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param fleetName The name of the Compute Fleet.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String fleetName, Context context) {
+ deleteAsync(resourceGroupName, fleetName, context).block();
+ }
+
+ /**
+ * List VirtualMachineScaleSet resources by Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param name The name of the Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ listVirtualMachineScaleSetsSinglePageAsync(String resourceGroupName, String name) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (name == null) {
+ return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listVirtualMachineScaleSets(this.client.getEndpoint(),
+ this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, name, 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()));
+ }
+
+ /**
+ * List VirtualMachineScaleSet resources by Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param name The name of the Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ listVirtualMachineScaleSetsSinglePageAsync(String resourceGroupName, String name, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (name == null) {
+ return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listVirtualMachineScaleSets(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, name, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List VirtualMachineScaleSet resources by Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param name The name of the Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listVirtualMachineScaleSetsAsync(String resourceGroupName,
+ String name) {
+ return new PagedFlux<>(() -> listVirtualMachineScaleSetsSinglePageAsync(resourceGroupName, name),
+ nextLink -> listVirtualMachineScaleSetsNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List VirtualMachineScaleSet resources by Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param name The name of the Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listVirtualMachineScaleSetsAsync(String resourceGroupName,
+ String name, Context context) {
+ return new PagedFlux<>(() -> listVirtualMachineScaleSetsSinglePageAsync(resourceGroupName, name, context),
+ nextLink -> listVirtualMachineScaleSetsNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List VirtualMachineScaleSet resources by Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param name The name of the Fleet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listVirtualMachineScaleSets(String resourceGroupName,
+ String name) {
+ return new PagedIterable<>(listVirtualMachineScaleSetsAsync(resourceGroupName, name));
+ }
+
+ /**
+ * List VirtualMachineScaleSet resources by Fleet.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param name The name of the Fleet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listVirtualMachineScaleSets(String resourceGroupName, String name,
+ Context context) {
+ return new PagedIterable<>(listVirtualMachineScaleSetsAsync(resourceGroupName, name, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Fleet list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ listVirtualMachineScaleSetsNextSinglePageAsync(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.listVirtualMachineScaleSetsNext(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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a VirtualMachineScaleSet list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ listVirtualMachineScaleSetsNextSinglePageAsync(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.listVirtualMachineScaleSetsNext(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/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsImpl.java
new file mode 100644
index 0000000000000..b0a4f9d8df9c1
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsImpl.java
@@ -0,0 +1,159 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.azurefleet.fluent.FleetsClient;
+import com.azure.resourcemanager.azurefleet.fluent.models.FleetInner;
+import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner;
+import com.azure.resourcemanager.azurefleet.models.Fleet;
+import com.azure.resourcemanager.azurefleet.models.Fleets;
+import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSet;
+
+public final class FleetsImpl implements Fleets {
+ private static final ClientLogger LOGGER = new ClientLogger(FleetsImpl.class);
+
+ private final FleetsClient innerClient;
+
+ private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager;
+
+ public FleetsImpl(FleetsClient innerClient, com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new FleetImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new FleetImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new FleetImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new FleetImpl(inner1, this.manager()));
+ }
+
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String fleetName, Context context) {
+ Response inner
+ = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, fleetName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new FleetImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public Fleet getByResourceGroup(String resourceGroupName, String fleetName) {
+ FleetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, fleetName);
+ if (inner != null) {
+ return new FleetImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String fleetName) {
+ this.serviceClient().delete(resourceGroupName, fleetName);
+ }
+
+ public void delete(String resourceGroupName, String fleetName, Context context) {
+ this.serviceClient().delete(resourceGroupName, fleetName, context);
+ }
+
+ public PagedIterable listVirtualMachineScaleSets(String resourceGroupName, String name) {
+ PagedIterable inner
+ = this.serviceClient().listVirtualMachineScaleSets(resourceGroupName, name);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listVirtualMachineScaleSets(String resourceGroupName, String name,
+ Context context) {
+ PagedIterable inner
+ = this.serviceClient().listVirtualMachineScaleSets(resourceGroupName, name, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager()));
+ }
+
+ public Fleet getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String fleetName = ResourceManagerUtils.getValueFromIdByName(id, "fleets");
+ if (fleetName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, fleetName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String fleetName = ResourceManagerUtils.getValueFromIdByName(id, "fleets");
+ if (fleetName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, fleetName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String fleetName = ResourceManagerUtils.getValueFromIdByName(id, "fleets");
+ if (fleetName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id)));
+ }
+ this.delete(resourceGroupName, fleetName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String fleetName = ResourceManagerUtils.getValueFromIdByName(id, "fleets");
+ if (fleetName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id)));
+ }
+ this.delete(resourceGroupName, fleetName, context);
+ }
+
+ private FleetsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() {
+ return this.serviceManager;
+ }
+
+ public FleetImpl define(String name) {
+ return new FleetImpl(name, this.manager());
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetBuilder.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetBuilder.java
new file mode 100644
index 0000000000000..95626582663e3
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetBuilder.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.azurefleet.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 MicrosoftAzureFleetImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { MicrosoftAzureFleetImpl.class })
+public final class MicrosoftAzureFleetBuilder {
+ /*
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription. The value must be an UUID.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the MicrosoftAzureFleetBuilder.
+ */
+ public MicrosoftAzureFleetBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the MicrosoftAzureFleetBuilder.
+ */
+ public MicrosoftAzureFleetBuilder 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 MicrosoftAzureFleetBuilder.
+ */
+ public MicrosoftAzureFleetBuilder 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 MicrosoftAzureFleetBuilder.
+ */
+ public MicrosoftAzureFleetBuilder 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 MicrosoftAzureFleetBuilder.
+ */
+ public MicrosoftAzureFleetBuilder 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 MicrosoftAzureFleetBuilder.
+ */
+ public MicrosoftAzureFleetBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of MicrosoftAzureFleetImpl with the provided parameters.
+ *
+ * @return an instance of MicrosoftAzureFleetImpl.
+ */
+ public MicrosoftAzureFleetImpl 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();
+ MicrosoftAzureFleetImpl client = new MicrosoftAzureFleetImpl(localPipeline, localSerializerAdapter,
+ localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetImpl.java
new file mode 100644
index 0000000000000..1cd691c963955
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetImpl.java
@@ -0,0 +1,304 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaderName;
+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.azurefleet.fluent.FleetsClient;
+import com.azure.resourcemanager.azurefleet.fluent.MicrosoftAzureFleet;
+import com.azure.resourcemanager.azurefleet.fluent.OperationsClient;
+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 MicrosoftAzureFleetImpl type.
+ */
+@ServiceClient(builder = MicrosoftAzureFleetBuilder.class)
+public final class MicrosoftAzureFleetImpl implements MicrosoftAzureFleet {
+ /**
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * server parameter.
+ */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Api Version.
+ */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /**
+ * 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 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 FleetsClient object to access its operations.
+ */
+ private final FleetsClient fleets;
+
+ /**
+ * Gets the FleetsClient object to access its operations.
+ *
+ * @return the FleetsClient object.
+ */
+ public FleetsClient getFleets() {
+ return this.fleets;
+ }
+
+ /**
+ * Initializes an instance of MicrosoftAzureFleet 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 subscriptionId The ID of the target subscription. The value must be an UUID.
+ * @param endpoint server parameter.
+ */
+ MicrosoftAzureFleetImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2024-11-01";
+ this.operations = new OperationsClientImpl(this);
+ this.fleets = new FleetsClientImpl(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(HttpHeaderName.fromString(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(MicrosoftAzureFleetImpl.class);
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationImpl.java
new file mode 100644
index 0000000000000..4662a3a725483
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationImpl.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.implementation;
+
+import com.azure.resourcemanager.azurefleet.fluent.models.OperationInner;
+import com.azure.resourcemanager.azurefleet.models.ActionType;
+import com.azure.resourcemanager.azurefleet.models.Operation;
+import com.azure.resourcemanager.azurefleet.models.OperationDisplay;
+import com.azure.resourcemanager.azurefleet.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager;
+
+ OperationImpl(OperationInner innerObject, com.azure.resourcemanager.azurefleet.AzurefleetManager 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 Origin origin() {
+ return this.innerModel().origin();
+ }
+
+ public ActionType actionType() {
+ return this.innerModel().actionType();
+ }
+
+ public OperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsClientImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsClientImpl.java
new file mode 100644
index 0000000000000..db6f17d7dc4d0
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsClientImpl.java
@@ -0,0 +1,235 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.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.azurefleet.fluent.OperationsClient;
+import com.azure.resourcemanager.azurefleet.fluent.models.OperationInner;
+import com.azure.resourcemanager.azurefleet.models.OperationListResult;
+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 MicrosoftAzureFleetImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(MicrosoftAzureFleetImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftAzureFleetOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftAzureFleetO")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.AzureFleet/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);
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, 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/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsImpl.java
new file mode 100644
index 0000000000000..37b1cbc23f99b
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/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.azurefleet.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.azurefleet.fluent.OperationsClient;
+import com.azure.resourcemanager.azurefleet.fluent.models.OperationInner;
+import com.azure.resourcemanager.azurefleet.models.Operation;
+import com.azure.resourcemanager.azurefleet.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.azurefleet.AzurefleetManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient,
+ com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/ResourceManagerUtils.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/ResourceManagerUtils.java
new file mode 100644
index 0000000000000..26ff8f2a7e794
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/ResourceManagerUtils.java
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.implementation;
+
+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.util.CoreUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import reactor.core.publisher.Flux;
+
+final class ResourceManagerUtils {
+ private ResourceManagerUtils() {
+ }
+
+ static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterator itr = Arrays.stream(id.split("/")).iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && !part.trim().isEmpty()) {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
+ if (id == null || pathTemplate == null) {
+ return null;
+ }
+ String parameterNameParentheses = "{" + parameterName + "}";
+ List idSegmentsReverted = Arrays.asList(id.split("/"));
+ List pathSegments = Arrays.asList(pathTemplate.split("/"));
+ Collections.reverse(idSegmentsReverted);
+ Iterator idItrReverted = idSegmentsReverted.iterator();
+ int pathIndex = pathSegments.size();
+ while (idItrReverted.hasNext() && pathIndex > 0) {
+ String idSegment = idItrReverted.next();
+ String pathSegment = pathSegments.get(--pathIndex);
+ if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) {
+ if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) {
+ if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) {
+ List segments = new ArrayList<>();
+ segments.add(idSegment);
+ idItrReverted.forEachRemaining(segments::add);
+ Collections.reverse(segments);
+ if (!segments.isEmpty() && segments.get(0).isEmpty()) {
+ segments.remove(0);
+ }
+ return String.join("/", segments);
+ } else {
+ return idSegment;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
+ return new PagedIterableImpl<>(pageIterable, mapper);
+ }
+
+ private static final class PagedIterableImpl extends PagedIterable {
+
+ private final PagedIterable pagedIterable;
+ private final Function mapper;
+ private final Function, PagedResponse> pageMapper;
+
+ private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) {
+ super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux
+ .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
+ this.pagedIterable = pagedIterable;
+ this.mapper = mapper;
+ this.pageMapper = getPageMapper(mapper);
+ }
+
+ private static Function, PagedResponse> getPageMapper(Function mapper) {
+ return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(),
+ page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(),
+ null);
+ }
+
+ @Override
+ public Stream stream() {
+ return pagedIterable.stream().map(mapper);
+ }
+
+ @Override
+ public Stream> streamByPage() {
+ return pagedIterable.streamByPage().map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken) {
+ return pagedIterable.streamByPage(continuationToken).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(int preferredPageSize) {
+ return pagedIterable.streamByPage(preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken, int preferredPageSize) {
+ return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl<>(pagedIterable.iterator(), mapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage() {
+ return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable iterable, Function mapper) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl<>(iterable.iterator(), mapper);
+ }
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetImpl.java
new file mode 100644
index 0000000000000..875a339a2be6b
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetImpl.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.implementation;
+
+import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner;
+import com.azure.resourcemanager.azurefleet.models.ApiError;
+import com.azure.resourcemanager.azurefleet.models.ProvisioningState;
+import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSet;
+
+public final class VirtualMachineScaleSetImpl implements VirtualMachineScaleSet {
+ private VirtualMachineScaleSetInner innerObject;
+
+ private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager;
+
+ VirtualMachineScaleSetImpl(VirtualMachineScaleSetInner innerObject,
+ com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public ProvisioningState operationStatus() {
+ return this.innerModel().operationStatus();
+ }
+
+ public ApiError error() {
+ return this.innerModel().error();
+ }
+
+ public VirtualMachineScaleSetInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/package-info.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/package-info.java
new file mode 100644
index 0000000000000..c545dd3435363
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the implementations for MicrosoftAzureFleet.
+ * null.
+ */
+package com.azure.resourcemanager.azurefleet.implementation;
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AcceleratorManufacturer.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AcceleratorManufacturer.java
new file mode 100644
index 0000000000000..8e4549eb7c843
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AcceleratorManufacturer.java
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Accelerator manufacturers supported by Azure VMs.
+ */
+public final class AcceleratorManufacturer extends ExpandableStringEnum {
+ /**
+ * Static value AMD for AcceleratorManufacturer.
+ */
+ public static final AcceleratorManufacturer AMD = fromString("AMD");
+
+ /**
+ * Static value Nvidia for AcceleratorManufacturer.
+ */
+ public static final AcceleratorManufacturer NVIDIA = fromString("Nvidia");
+
+ /**
+ * Static value Xilinx for AcceleratorManufacturer.
+ */
+ public static final AcceleratorManufacturer XILINX = fromString("Xilinx");
+
+ /**
+ * Creates a new instance of AcceleratorManufacturer value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public AcceleratorManufacturer() {
+ }
+
+ /**
+ * Creates or finds a AcceleratorManufacturer from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding AcceleratorManufacturer.
+ */
+ public static AcceleratorManufacturer fromString(String name) {
+ return fromString(name, AcceleratorManufacturer.class);
+ }
+
+ /**
+ * Gets known AcceleratorManufacturer values.
+ *
+ * @return known AcceleratorManufacturer values.
+ */
+ public static Collection values() {
+ return values(AcceleratorManufacturer.class);
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AcceleratorType.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AcceleratorType.java
new file mode 100644
index 0000000000000..ad4d9552de446
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AcceleratorType.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Accelerator types supported by Azure VMs.
+ */
+public final class AcceleratorType extends ExpandableStringEnum {
+ /**
+ * Static value GPU for AcceleratorType.
+ */
+ public static final AcceleratorType GPU = fromString("GPU");
+
+ /**
+ * Static value FPGA for AcceleratorType.
+ */
+ public static final AcceleratorType FPGA = fromString("FPGA");
+
+ /**
+ * Creates a new instance of AcceleratorType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public AcceleratorType() {
+ }
+
+ /**
+ * Creates or finds a AcceleratorType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding AcceleratorType.
+ */
+ public static AcceleratorType fromString(String name) {
+ return fromString(name, AcceleratorType.class);
+ }
+
+ /**
+ * Gets known AcceleratorType values.
+ *
+ * @return known AcceleratorType values.
+ */
+ public static Collection values() {
+ return values(AcceleratorType.class);
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ActionType.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ActionType.java
new file mode 100644
index 0000000000000..1e0c57addc0ab
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ActionType.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.azurefleet.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+public final class ActionType extends ExpandableStringEnum {
+ /**
+ * Static value Internal for ActionType.
+ */
+ public static final ActionType INTERNAL = fromString("Internal");
+
+ /**
+ * Creates a new instance of ActionType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public ActionType() {
+ }
+
+ /**
+ * Creates or finds a ActionType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ActionType.
+ */
+ public static ActionType fromString(String name) {
+ return fromString(name, ActionType.class);
+ }
+
+ /**
+ * Gets known ActionType values.
+ *
+ * @return known ActionType values.
+ */
+ public static Collection values() {
+ return values(ActionType.class);
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalCapabilities.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalCapabilities.java
new file mode 100644
index 0000000000000..ecdc3c0cb29b5
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalCapabilities.java
@@ -0,0 +1,130 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * AdditionalCapabilities for VM.
+ */
+@Fluent
+public final class AdditionalCapabilities implements JsonSerializable {
+ /*
+ * The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage
+ * account type on the VM or VMSS.
+ * Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale
+ * set only if this property is enabled.
+ */
+ private Boolean ultraSsdEnabled;
+
+ /*
+ * The flag that enables or disables hibernation capability on the VM.
+ */
+ private Boolean hibernationEnabled;
+
+ /**
+ * Creates an instance of AdditionalCapabilities class.
+ */
+ public AdditionalCapabilities() {
+ }
+
+ /**
+ * Get the ultraSsdEnabled property: The flag that enables or disables a capability to have one or more managed data
+ * disks with UltraSSD_LRS storage account type on the VM or VMSS.
+ * Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale
+ * set only if this property is enabled.
+ *
+ * @return the ultraSsdEnabled value.
+ */
+ public Boolean ultraSsdEnabled() {
+ return this.ultraSsdEnabled;
+ }
+
+ /**
+ * Set the ultraSsdEnabled property: The flag that enables or disables a capability to have one or more managed data
+ * disks with UltraSSD_LRS storage account type on the VM or VMSS.
+ * Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale
+ * set only if this property is enabled.
+ *
+ * @param ultraSsdEnabled the ultraSsdEnabled value to set.
+ * @return the AdditionalCapabilities object itself.
+ */
+ public AdditionalCapabilities withUltraSsdEnabled(Boolean ultraSsdEnabled) {
+ this.ultraSsdEnabled = ultraSsdEnabled;
+ return this;
+ }
+
+ /**
+ * Get the hibernationEnabled property: The flag that enables or disables hibernation capability on the VM.
+ *
+ * @return the hibernationEnabled value.
+ */
+ public Boolean hibernationEnabled() {
+ return this.hibernationEnabled;
+ }
+
+ /**
+ * Set the hibernationEnabled property: The flag that enables or disables hibernation capability on the VM.
+ *
+ * @param hibernationEnabled the hibernationEnabled value to set.
+ * @return the AdditionalCapabilities object itself.
+ */
+ public AdditionalCapabilities withHibernationEnabled(Boolean hibernationEnabled) {
+ this.hibernationEnabled = hibernationEnabled;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeBooleanField("ultraSSDEnabled", this.ultraSsdEnabled);
+ jsonWriter.writeBooleanField("hibernationEnabled", this.hibernationEnabled);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AdditionalCapabilities from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AdditionalCapabilities if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AdditionalCapabilities.
+ */
+ public static AdditionalCapabilities fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AdditionalCapabilities deserializedAdditionalCapabilities = new AdditionalCapabilities();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("ultraSSDEnabled".equals(fieldName)) {
+ deserializedAdditionalCapabilities.ultraSsdEnabled = reader.getNullable(JsonReader::getBoolean);
+ } else if ("hibernationEnabled".equals(fieldName)) {
+ deserializedAdditionalCapabilities.hibernationEnabled = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAdditionalCapabilities;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalLocationsProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalLocationsProfile.java
new file mode 100644
index 0000000000000..f14fabbc02d23
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalLocationsProfile.java
@@ -0,0 +1,108 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Represents the configuration for additional locations where Fleet resources may be deployed.
+ */
+@Fluent
+public final class AdditionalLocationsProfile implements JsonSerializable {
+ /*
+ * The list of location profiles.
+ */
+ private List locationProfiles;
+
+ /**
+ * Creates an instance of AdditionalLocationsProfile class.
+ */
+ public AdditionalLocationsProfile() {
+ }
+
+ /**
+ * Get the locationProfiles property: The list of location profiles.
+ *
+ * @return the locationProfiles value.
+ */
+ public List locationProfiles() {
+ return this.locationProfiles;
+ }
+
+ /**
+ * Set the locationProfiles property: The list of location profiles.
+ *
+ * @param locationProfiles the locationProfiles value to set.
+ * @return the AdditionalLocationsProfile object itself.
+ */
+ public AdditionalLocationsProfile withLocationProfiles(List locationProfiles) {
+ this.locationProfiles = locationProfiles;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (locationProfiles() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property locationProfiles in model AdditionalLocationsProfile"));
+ } else {
+ locationProfiles().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(AdditionalLocationsProfile.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("locationProfiles", this.locationProfiles,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AdditionalLocationsProfile from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AdditionalLocationsProfile if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the AdditionalLocationsProfile.
+ */
+ public static AdditionalLocationsProfile fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AdditionalLocationsProfile deserializedAdditionalLocationsProfile = new AdditionalLocationsProfile();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("locationProfiles".equals(fieldName)) {
+ List locationProfiles
+ = reader.readArray(reader1 -> LocationProfile.fromJson(reader1));
+ deserializedAdditionalLocationsProfile.locationProfiles = locationProfiles;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAdditionalLocationsProfile;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContent.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContent.java
new file mode 100644
index 0000000000000..3801d300128bf
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContent.java
@@ -0,0 +1,193 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Specifies additional XML formatted information that can be included in the
+ * Unattend.xml file, which is used by Windows Setup. Contents are defined by
+ * setting name, component name, and the pass in which the content is applied.
+ */
+@Fluent
+public final class AdditionalUnattendContent implements JsonSerializable {
+ /*
+ * The pass name. Currently, the only allowable value is OobeSystem.
+ */
+ private AdditionalUnattendContentPassName passName;
+
+ /*
+ * The component name. Currently, the only allowable value is
+ * Microsoft-Windows-Shell-Setup.
+ */
+ private AdditionalUnattendContentComponentName componentName;
+
+ /*
+ * Specifies the name of the setting to which the content applies. Possible values
+ * are: FirstLogonCommands and AutoLogon.
+ */
+ private SettingNames settingName;
+
+ /*
+ * Specifies the XML formatted content that is added to the unattend.xml file for
+ * the specified path and component. The XML must be less than 4KB and must
+ * include the root element for the setting or feature that is being inserted.
+ */
+ private String content;
+
+ /**
+ * Creates an instance of AdditionalUnattendContent class.
+ */
+ public AdditionalUnattendContent() {
+ }
+
+ /**
+ * Get the passName property: The pass name. Currently, the only allowable value is OobeSystem.
+ *
+ * @return the passName value.
+ */
+ public AdditionalUnattendContentPassName passName() {
+ return this.passName;
+ }
+
+ /**
+ * Set the passName property: The pass name. Currently, the only allowable value is OobeSystem.
+ *
+ * @param passName the passName value to set.
+ * @return the AdditionalUnattendContent object itself.
+ */
+ public AdditionalUnattendContent withPassName(AdditionalUnattendContentPassName passName) {
+ this.passName = passName;
+ return this;
+ }
+
+ /**
+ * Get the componentName property: The component name. Currently, the only allowable value is
+ * Microsoft-Windows-Shell-Setup.
+ *
+ * @return the componentName value.
+ */
+ public AdditionalUnattendContentComponentName componentName() {
+ return this.componentName;
+ }
+
+ /**
+ * Set the componentName property: The component name. Currently, the only allowable value is
+ * Microsoft-Windows-Shell-Setup.
+ *
+ * @param componentName the componentName value to set.
+ * @return the AdditionalUnattendContent object itself.
+ */
+ public AdditionalUnattendContent withComponentName(AdditionalUnattendContentComponentName componentName) {
+ this.componentName = componentName;
+ return this;
+ }
+
+ /**
+ * Get the settingName property: Specifies the name of the setting to which the content applies. Possible values
+ * are: FirstLogonCommands and AutoLogon.
+ *
+ * @return the settingName value.
+ */
+ public SettingNames settingName() {
+ return this.settingName;
+ }
+
+ /**
+ * Set the settingName property: Specifies the name of the setting to which the content applies. Possible values
+ * are: FirstLogonCommands and AutoLogon.
+ *
+ * @param settingName the settingName value to set.
+ * @return the AdditionalUnattendContent object itself.
+ */
+ public AdditionalUnattendContent withSettingName(SettingNames settingName) {
+ this.settingName = settingName;
+ return this;
+ }
+
+ /**
+ * Get the content property: Specifies the XML formatted content that is added to the unattend.xml file for
+ * the specified path and component. The XML must be less than 4KB and must
+ * include the root element for the setting or feature that is being inserted.
+ *
+ * @return the content value.
+ */
+ public String content() {
+ return this.content;
+ }
+
+ /**
+ * Set the content property: Specifies the XML formatted content that is added to the unattend.xml file for
+ * the specified path and component. The XML must be less than 4KB and must
+ * include the root element for the setting or feature that is being inserted.
+ *
+ * @param content the content value to set.
+ * @return the AdditionalUnattendContent object itself.
+ */
+ public AdditionalUnattendContent withContent(String content) {
+ this.content = content;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("passName", this.passName == null ? null : this.passName.toString());
+ jsonWriter.writeStringField("componentName", this.componentName == null ? null : this.componentName.toString());
+ jsonWriter.writeStringField("settingName", this.settingName == null ? null : this.settingName.toString());
+ jsonWriter.writeStringField("content", this.content);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AdditionalUnattendContent from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AdditionalUnattendContent if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the AdditionalUnattendContent.
+ */
+ public static AdditionalUnattendContent fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AdditionalUnattendContent deserializedAdditionalUnattendContent = new AdditionalUnattendContent();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("passName".equals(fieldName)) {
+ deserializedAdditionalUnattendContent.passName
+ = AdditionalUnattendContentPassName.fromString(reader.getString());
+ } else if ("componentName".equals(fieldName)) {
+ deserializedAdditionalUnattendContent.componentName
+ = AdditionalUnattendContentComponentName.fromString(reader.getString());
+ } else if ("settingName".equals(fieldName)) {
+ deserializedAdditionalUnattendContent.settingName = SettingNames.fromString(reader.getString());
+ } else if ("content".equals(fieldName)) {
+ deserializedAdditionalUnattendContent.content = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAdditionalUnattendContent;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContentComponentName.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContentComponentName.java
new file mode 100644
index 0000000000000..4ee0029d8d966
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContentComponentName.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.azurefleet.models;
+
+/**
+ * The component name. Currently, the only allowable value is
+ * Microsoft-Windows-Shell-Setup.
+ */
+public enum AdditionalUnattendContentComponentName {
+ /**
+ * Enum value Microsoft-Windows-Shell-Setup.
+ */
+ MICROSOFT_WINDOWS_SHELL_SETUP("Microsoft-Windows-Shell-Setup");
+
+ /**
+ * The actual serialized value for a AdditionalUnattendContentComponentName instance.
+ */
+ private final String value;
+
+ AdditionalUnattendContentComponentName(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Parses a serialized value to a AdditionalUnattendContentComponentName instance.
+ *
+ * @param value the serialized value to parse.
+ * @return the parsed AdditionalUnattendContentComponentName object, or null if unable to parse.
+ */
+ public static AdditionalUnattendContentComponentName fromString(String value) {
+ if (value == null) {
+ return null;
+ }
+ AdditionalUnattendContentComponentName[] items = AdditionalUnattendContentComponentName.values();
+ for (AdditionalUnattendContentComponentName item : items) {
+ if (item.toString().equalsIgnoreCase(value)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return this.value;
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContentPassName.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContentPassName.java
new file mode 100644
index 0000000000000..2544735eb2b6c
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContentPassName.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+/**
+ * The pass name. Currently, the only allowable value is OobeSystem.
+ */
+public enum AdditionalUnattendContentPassName {
+ /**
+ * Enum value OobeSystem.
+ */
+ OOBE_SYSTEM("OobeSystem");
+
+ /**
+ * The actual serialized value for a AdditionalUnattendContentPassName instance.
+ */
+ private final String value;
+
+ AdditionalUnattendContentPassName(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Parses a serialized value to a AdditionalUnattendContentPassName instance.
+ *
+ * @param value the serialized value to parse.
+ * @return the parsed AdditionalUnattendContentPassName object, or null if unable to parse.
+ */
+ public static AdditionalUnattendContentPassName fromString(String value) {
+ if (value == null) {
+ return null;
+ }
+ AdditionalUnattendContentPassName[] items = AdditionalUnattendContentPassName.values();
+ for (AdditionalUnattendContentPassName item : items) {
+ if (item.toString().equalsIgnoreCase(value)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return this.value;
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiEntityReference.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiEntityReference.java
new file mode 100644
index 0000000000000..10d856c1faaef
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiEntityReference.java
@@ -0,0 +1,96 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * The API entity reference.
+ */
+@Fluent
+public final class ApiEntityReference implements JsonSerializable {
+ /*
+ * The ARM resource id in the form of
+ * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...
+ */
+ private String id;
+
+ /**
+ * Creates an instance of ApiEntityReference class.
+ */
+ public ApiEntityReference() {
+ }
+
+ /**
+ * Get the id property: The ARM resource id in the form of
+ * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set the id property: The ARM resource id in the form of
+ * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...
+ *
+ * @param id the id value to set.
+ * @return the ApiEntityReference object itself.
+ */
+ public ApiEntityReference withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("id", this.id);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ApiEntityReference from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ApiEntityReference if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the ApiEntityReference.
+ */
+ public static ApiEntityReference fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ApiEntityReference deserializedApiEntityReference = new ApiEntityReference();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedApiEntityReference.id = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedApiEntityReference;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiError.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiError.java
new file mode 100644
index 0000000000000..f2e290f067f9d
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiError.java
@@ -0,0 +1,213 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * ApiError for Fleet.
+ */
+@Fluent
+public final class ApiError implements JsonSerializable {
+ /*
+ * The error code.
+ */
+ private String code;
+
+ /*
+ * The target of the particular error.
+ */
+ private String target;
+
+ /*
+ * The error message.
+ */
+ private String message;
+
+ /*
+ * The API error details
+ */
+ private List details;
+
+ /*
+ * The API inner error
+ */
+ private InnerError innererror;
+
+ /**
+ * Creates an instance of ApiError class.
+ */
+ public ApiError() {
+ }
+
+ /**
+ * Get the code property: The error code.
+ *
+ * @return the code value.
+ */
+ public String code() {
+ return this.code;
+ }
+
+ /**
+ * Set the code property: The error code.
+ *
+ * @param code the code value to set.
+ * @return the ApiError object itself.
+ */
+ public ApiError withCode(String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Get the target property: The target of the particular error.
+ *
+ * @return the target value.
+ */
+ public String target() {
+ return this.target;
+ }
+
+ /**
+ * Set the target property: The target of the particular error.
+ *
+ * @param target the target value to set.
+ * @return the ApiError object itself.
+ */
+ public ApiError withTarget(String target) {
+ this.target = target;
+ return this;
+ }
+
+ /**
+ * Get the message property: The error message.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set the message property: The error message.
+ *
+ * @param message the message value to set.
+ * @return the ApiError object itself.
+ */
+ public ApiError withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Get the details property: The API error details.
+ *
+ * @return the details value.
+ */
+ public List details() {
+ return this.details;
+ }
+
+ /**
+ * Set the details property: The API error details.
+ *
+ * @param details the details value to set.
+ * @return the ApiError object itself.
+ */
+ public ApiError withDetails(List details) {
+ this.details = details;
+ return this;
+ }
+
+ /**
+ * Get the innererror property: The API inner error.
+ *
+ * @return the innererror value.
+ */
+ public InnerError innererror() {
+ return this.innererror;
+ }
+
+ /**
+ * Set the innererror property: The API inner error.
+ *
+ * @param innererror the innererror value to set.
+ * @return the ApiError object itself.
+ */
+ public ApiError withInnererror(InnerError innererror) {
+ this.innererror = innererror;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (details() != null) {
+ details().forEach(e -> e.validate());
+ }
+ if (innererror() != null) {
+ innererror().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("code", this.code);
+ jsonWriter.writeStringField("target", this.target);
+ jsonWriter.writeStringField("message", this.message);
+ jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeJsonField("innererror", this.innererror);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ApiError from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ApiError if the JsonReader was pointing to an instance of it, or null if it was pointing
+ * to JSON null.
+ * @throws IOException If an error occurs while reading the ApiError.
+ */
+ public static ApiError fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ApiError deserializedApiError = new ApiError();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("code".equals(fieldName)) {
+ deserializedApiError.code = reader.getString();
+ } else if ("target".equals(fieldName)) {
+ deserializedApiError.target = reader.getString();
+ } else if ("message".equals(fieldName)) {
+ deserializedApiError.message = reader.getString();
+ } else if ("details".equals(fieldName)) {
+ List details = reader.readArray(reader1 -> ApiErrorBase.fromJson(reader1));
+ deserializedApiError.details = details;
+ } else if ("innererror".equals(fieldName)) {
+ deserializedApiError.innererror = InnerError.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedApiError;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiErrorBase.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiErrorBase.java
new file mode 100644
index 0000000000000..322ab53decd30
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiErrorBase.java
@@ -0,0 +1,149 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * API error base.
+ */
+@Fluent
+public final class ApiErrorBase implements JsonSerializable {
+ /*
+ * The error code.
+ */
+ private String code;
+
+ /*
+ * The target of the particular error.
+ */
+ private String target;
+
+ /*
+ * The error message.
+ */
+ private String message;
+
+ /**
+ * Creates an instance of ApiErrorBase class.
+ */
+ public ApiErrorBase() {
+ }
+
+ /**
+ * Get the code property: The error code.
+ *
+ * @return the code value.
+ */
+ public String code() {
+ return this.code;
+ }
+
+ /**
+ * Set the code property: The error code.
+ *
+ * @param code the code value to set.
+ * @return the ApiErrorBase object itself.
+ */
+ public ApiErrorBase withCode(String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Get the target property: The target of the particular error.
+ *
+ * @return the target value.
+ */
+ public String target() {
+ return this.target;
+ }
+
+ /**
+ * Set the target property: The target of the particular error.
+ *
+ * @param target the target value to set.
+ * @return the ApiErrorBase object itself.
+ */
+ public ApiErrorBase withTarget(String target) {
+ this.target = target;
+ return this;
+ }
+
+ /**
+ * Get the message property: The error message.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set the message property: The error message.
+ *
+ * @param message the message value to set.
+ * @return the ApiErrorBase object itself.
+ */
+ public ApiErrorBase withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("code", this.code);
+ jsonWriter.writeStringField("target", this.target);
+ jsonWriter.writeStringField("message", this.message);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ApiErrorBase from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ApiErrorBase if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the ApiErrorBase.
+ */
+ public static ApiErrorBase fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ApiErrorBase deserializedApiErrorBase = new ApiErrorBase();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("code".equals(fieldName)) {
+ deserializedApiErrorBase.code = reader.getString();
+ } else if ("target".equals(fieldName)) {
+ deserializedApiErrorBase.target = reader.getString();
+ } else if ("message".equals(fieldName)) {
+ deserializedApiErrorBase.message = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedApiErrorBase;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApplicationProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApplicationProfile.java
new file mode 100644
index 0000000000000..4a9855c672e9d
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApplicationProfile.java
@@ -0,0 +1,103 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Contains the list of gallery applications that should be made available to the
+ * VM/VMSS.
+ */
+@Fluent
+public final class ApplicationProfile implements JsonSerializable {
+ /*
+ * Specifies the gallery applications that should be made available to the VM/VMSS
+ */
+ private List galleryApplications;
+
+ /**
+ * Creates an instance of ApplicationProfile class.
+ */
+ public ApplicationProfile() {
+ }
+
+ /**
+ * Get the galleryApplications property: Specifies the gallery applications that should be made available to the
+ * VM/VMSS.
+ *
+ * @return the galleryApplications value.
+ */
+ public List galleryApplications() {
+ return this.galleryApplications;
+ }
+
+ /**
+ * Set the galleryApplications property: Specifies the gallery applications that should be made available to the
+ * VM/VMSS.
+ *
+ * @param galleryApplications the galleryApplications value to set.
+ * @return the ApplicationProfile object itself.
+ */
+ public ApplicationProfile withGalleryApplications(List galleryApplications) {
+ this.galleryApplications = galleryApplications;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (galleryApplications() != null) {
+ galleryApplications().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("galleryApplications", this.galleryApplications,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ApplicationProfile from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ApplicationProfile if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the ApplicationProfile.
+ */
+ public static ApplicationProfile fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ApplicationProfile deserializedApplicationProfile = new ApplicationProfile();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("galleryApplications".equals(fieldName)) {
+ List galleryApplications
+ = reader.readArray(reader1 -> VMGalleryApplication.fromJson(reader1));
+ deserializedApplicationProfile.galleryApplications = galleryApplications;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedApplicationProfile;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ArchitectureType.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ArchitectureType.java
new file mode 100644
index 0000000000000..528d18845afec
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ArchitectureType.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Architecture types supported by Azure VMs.
+ */
+public final class ArchitectureType extends ExpandableStringEnum {
+ /**
+ * Static value ARM64 for ArchitectureType.
+ */
+ public static final ArchitectureType ARM64 = fromString("ARM64");
+
+ /**
+ * Static value X64 for ArchitectureType.
+ */
+ public static final ArchitectureType X64 = fromString("X64");
+
+ /**
+ * Creates a new instance of ArchitectureType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public ArchitectureType() {
+ }
+
+ /**
+ * Creates or finds a ArchitectureType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ArchitectureType.
+ */
+ public static ArchitectureType fromString(String name) {
+ return fromString(name, ArchitectureType.class);
+ }
+
+ /**
+ * Gets known ArchitectureType values.
+ *
+ * @return known ArchitectureType values.
+ */
+ public static Collection values() {
+ return values(ArchitectureType.class);
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BaseVirtualMachineProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BaseVirtualMachineProfile.java
new file mode 100644
index 0000000000000..1f3fd322ebd06
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BaseVirtualMachineProfile.java
@@ -0,0 +1,594 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+
+/**
+ * Describes the base virtual machine profile for fleet.
+ */
+@Fluent
+public final class BaseVirtualMachineProfile implements JsonSerializable {
+ /*
+ * Specifies the operating system settings for the virtual machines in the scale
+ * set.
+ */
+ private VirtualMachineScaleSetOSProfile osProfile;
+
+ /*
+ * Specifies the storage settings for the virtual machine disks.
+ */
+ private VirtualMachineScaleSetStorageProfile storageProfile;
+
+ /*
+ * Specifies properties of the network interfaces of the virtual machines in the
+ * scale set.
+ */
+ private VirtualMachineScaleSetNetworkProfile networkProfile;
+
+ /*
+ * Specifies the Security related profile settings for the virtual machines in the
+ * scale set.
+ */
+ private SecurityProfile securityProfile;
+
+ /*
+ * Specifies the boot diagnostic settings state.
+ */
+ private DiagnosticsProfile diagnosticsProfile;
+
+ /*
+ * Specifies a collection of settings for extensions installed on virtual machines
+ * in the scale set.
+ */
+ private VirtualMachineScaleSetExtensionProfile extensionProfile;
+
+ /*
+ * Specifies that the image or disk that is being used was licensed on-premises.
+ *
Possible values for Windows Server operating system are:
+ * Windows_Client
Windows_Server
Possible values for Linux
+ * Server operating system are:
RHEL_BYOS (for RHEL)
SLES_BYOS
+ * (for SUSE)
For more information, see [Azure Hybrid Use Benefit for
+ * Windows
+ * Server](https://learn.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)
+ *
[Azure Hybrid Use Benefit for Linux
+ * Server](https://learn.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)
+ *
Minimum api-version: 2015-06-15
+ */
+ private String licenseType;
+
+ /*
+ * Specifies Scheduled Event related configurations.
+ */
+ private ScheduledEventsProfile scheduledEventsProfile;
+
+ /*
+ * UserData for the virtual machines in the scale set, which must be base-64
+ * encoded. Customer should not pass any secrets in here. Minimum api-version:
+ * 2021-03-01.
+ */
+ private String userData;
+
+ /*
+ * Specifies the capacity reservation related details of a scale set. Minimum
+ * api-version: 2021-04-01.
+ */
+ private CapacityReservationProfile capacityReservation;
+
+ /*
+ * Specifies the gallery applications that should be made available to the VM/VMSS
+ */
+ private ApplicationProfile applicationProfile;
+
+ /*
+ * Specifies the hardware profile related details of a scale set. Minimum
+ * api-version: 2021-11-01.
+ */
+ private VirtualMachineScaleSetHardwareProfile hardwareProfile;
+
+ /*
+ * Specifies the service artifact reference id used to set same image version for
+ * all virtual machines in the scale set when using 'latest' image version.
+ * Minimum api-version: 2022-11-01
+ */
+ private ServiceArtifactReference serviceArtifactReference;
+
+ /*
+ * Specifies the security posture to be used for all virtual machines in the scale
+ * set. Minimum api-version: 2023-03-01
+ */
+ private SecurityPostureReference securityPostureReference;
+
+ /*
+ * Specifies the time in which this VM profile for the Virtual Machine Scale Set
+ * was created. Minimum API version for this property is 2023-09-01. This value
+ * will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile
+ * with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00"
+ */
+ private OffsetDateTime timeCreated;
+
+ /**
+ * Creates an instance of BaseVirtualMachineProfile class.
+ */
+ public BaseVirtualMachineProfile() {
+ }
+
+ /**
+ * Get the osProfile property: Specifies the operating system settings for the virtual machines in the scale
+ * set.
+ *
+ * @return the osProfile value.
+ */
+ public VirtualMachineScaleSetOSProfile osProfile() {
+ return this.osProfile;
+ }
+
+ /**
+ * Set the osProfile property: Specifies the operating system settings for the virtual machines in the scale
+ * set.
+ *
+ * @param osProfile the osProfile value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withOsProfile(VirtualMachineScaleSetOSProfile osProfile) {
+ this.osProfile = osProfile;
+ return this;
+ }
+
+ /**
+ * Get the storageProfile property: Specifies the storage settings for the virtual machine disks.
+ *
+ * @return the storageProfile value.
+ */
+ public VirtualMachineScaleSetStorageProfile storageProfile() {
+ return this.storageProfile;
+ }
+
+ /**
+ * Set the storageProfile property: Specifies the storage settings for the virtual machine disks.
+ *
+ * @param storageProfile the storageProfile value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withStorageProfile(VirtualMachineScaleSetStorageProfile storageProfile) {
+ this.storageProfile = storageProfile;
+ return this;
+ }
+
+ /**
+ * Get the networkProfile property: Specifies properties of the network interfaces of the virtual machines in the
+ * scale set.
+ *
+ * @return the networkProfile value.
+ */
+ public VirtualMachineScaleSetNetworkProfile networkProfile() {
+ return this.networkProfile;
+ }
+
+ /**
+ * Set the networkProfile property: Specifies properties of the network interfaces of the virtual machines in the
+ * scale set.
+ *
+ * @param networkProfile the networkProfile value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withNetworkProfile(VirtualMachineScaleSetNetworkProfile networkProfile) {
+ this.networkProfile = networkProfile;
+ return this;
+ }
+
+ /**
+ * Get the securityProfile property: Specifies the Security related profile settings for the virtual machines in the
+ * scale set.
+ *
+ * @return the securityProfile value.
+ */
+ public SecurityProfile securityProfile() {
+ return this.securityProfile;
+ }
+
+ /**
+ * Set the securityProfile property: Specifies the Security related profile settings for the virtual machines in the
+ * scale set.
+ *
+ * @param securityProfile the securityProfile value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withSecurityProfile(SecurityProfile securityProfile) {
+ this.securityProfile = securityProfile;
+ return this;
+ }
+
+ /**
+ * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state.
+ *
+ * @return the diagnosticsProfile value.
+ */
+ public DiagnosticsProfile diagnosticsProfile() {
+ return this.diagnosticsProfile;
+ }
+
+ /**
+ * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state.
+ *
+ * @param diagnosticsProfile the diagnosticsProfile value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) {
+ this.diagnosticsProfile = diagnosticsProfile;
+ return this;
+ }
+
+ /**
+ * Get the extensionProfile property: Specifies a collection of settings for extensions installed on virtual
+ * machines
+ * in the scale set.
+ *
+ * @return the extensionProfile value.
+ */
+ public VirtualMachineScaleSetExtensionProfile extensionProfile() {
+ return this.extensionProfile;
+ }
+
+ /**
+ * Set the extensionProfile property: Specifies a collection of settings for extensions installed on virtual
+ * machines
+ * in the scale set.
+ *
+ * @param extensionProfile the extensionProfile value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withExtensionProfile(VirtualMachineScaleSetExtensionProfile extensionProfile) {
+ this.extensionProfile = extensionProfile;
+ return this;
+ }
+
+ /**
+ * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises.
+ * <br><br> Possible values for Windows Server operating system are: <br><br>
+ * Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux
+ * Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS
+ * (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for
+ * Windows
+ * Server](https://learn.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)
+ * <br><br> [Azure Hybrid Use Benefit for Linux
+ * Server](https://learn.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)
+ * <br><br> Minimum api-version: 2015-06-15.
+ *
+ * @return the licenseType value.
+ */
+ public String licenseType() {
+ return this.licenseType;
+ }
+
+ /**
+ * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises.
+ * <br><br> Possible values for Windows Server operating system are: <br><br>
+ * Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux
+ * Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS
+ * (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for
+ * Windows
+ * Server](https://learn.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)
+ * <br><br> [Azure Hybrid Use Benefit for Linux
+ * Server](https://learn.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)
+ * <br><br> Minimum api-version: 2015-06-15.
+ *
+ * @param licenseType the licenseType value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withLicenseType(String licenseType) {
+ this.licenseType = licenseType;
+ return this;
+ }
+
+ /**
+ * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations.
+ *
+ * @return the scheduledEventsProfile value.
+ */
+ public ScheduledEventsProfile scheduledEventsProfile() {
+ return this.scheduledEventsProfile;
+ }
+
+ /**
+ * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations.
+ *
+ * @param scheduledEventsProfile the scheduledEventsProfile value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) {
+ this.scheduledEventsProfile = scheduledEventsProfile;
+ return this;
+ }
+
+ /**
+ * Get the userData property: UserData for the virtual machines in the scale set, which must be base-64
+ * encoded. Customer should not pass any secrets in here. Minimum api-version:
+ * 2021-03-01.
+ *
+ * @return the userData value.
+ */
+ public String userData() {
+ return this.userData;
+ }
+
+ /**
+ * Set the userData property: UserData for the virtual machines in the scale set, which must be base-64
+ * encoded. Customer should not pass any secrets in here. Minimum api-version:
+ * 2021-03-01.
+ *
+ * @param userData the userData value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withUserData(String userData) {
+ this.userData = userData;
+ return this;
+ }
+
+ /**
+ * Get the capacityReservation property: Specifies the capacity reservation related details of a scale set. Minimum
+ * api-version: 2021-04-01.
+ *
+ * @return the capacityReservation value.
+ */
+ public CapacityReservationProfile capacityReservation() {
+ return this.capacityReservation;
+ }
+
+ /**
+ * Set the capacityReservation property: Specifies the capacity reservation related details of a scale set. Minimum
+ * api-version: 2021-04-01.
+ *
+ * @param capacityReservation the capacityReservation value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withCapacityReservation(CapacityReservationProfile capacityReservation) {
+ this.capacityReservation = capacityReservation;
+ return this;
+ }
+
+ /**
+ * Get the applicationProfile property: Specifies the gallery applications that should be made available to the
+ * VM/VMSS.
+ *
+ * @return the applicationProfile value.
+ */
+ public ApplicationProfile applicationProfile() {
+ return this.applicationProfile;
+ }
+
+ /**
+ * Set the applicationProfile property: Specifies the gallery applications that should be made available to the
+ * VM/VMSS.
+ *
+ * @param applicationProfile the applicationProfile value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withApplicationProfile(ApplicationProfile applicationProfile) {
+ this.applicationProfile = applicationProfile;
+ return this;
+ }
+
+ /**
+ * Get the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum
+ * api-version: 2021-11-01.
+ *
+ * @return the hardwareProfile value.
+ */
+ public VirtualMachineScaleSetHardwareProfile hardwareProfile() {
+ return this.hardwareProfile;
+ }
+
+ /**
+ * Set the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum
+ * api-version: 2021-11-01.
+ *
+ * @param hardwareProfile the hardwareProfile value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withHardwareProfile(VirtualMachineScaleSetHardwareProfile hardwareProfile) {
+ this.hardwareProfile = hardwareProfile;
+ return this;
+ }
+
+ /**
+ * Get the serviceArtifactReference property: Specifies the service artifact reference id used to set same image
+ * version for
+ * all virtual machines in the scale set when using 'latest' image version.
+ * Minimum api-version: 2022-11-01.
+ *
+ * @return the serviceArtifactReference value.
+ */
+ public ServiceArtifactReference serviceArtifactReference() {
+ return this.serviceArtifactReference;
+ }
+
+ /**
+ * Set the serviceArtifactReference property: Specifies the service artifact reference id used to set same image
+ * version for
+ * all virtual machines in the scale set when using 'latest' image version.
+ * Minimum api-version: 2022-11-01.
+ *
+ * @param serviceArtifactReference the serviceArtifactReference value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withServiceArtifactReference(ServiceArtifactReference serviceArtifactReference) {
+ this.serviceArtifactReference = serviceArtifactReference;
+ return this;
+ }
+
+ /**
+ * Get the securityPostureReference property: Specifies the security posture to be used for all virtual machines in
+ * the scale
+ * set. Minimum api-version: 2023-03-01.
+ *
+ * @return the securityPostureReference value.
+ */
+ public SecurityPostureReference securityPostureReference() {
+ return this.securityPostureReference;
+ }
+
+ /**
+ * Set the securityPostureReference property: Specifies the security posture to be used for all virtual machines in
+ * the scale
+ * set. Minimum api-version: 2023-03-01.
+ *
+ * @param securityPostureReference the securityPostureReference value to set.
+ * @return the BaseVirtualMachineProfile object itself.
+ */
+ public BaseVirtualMachineProfile withSecurityPostureReference(SecurityPostureReference securityPostureReference) {
+ this.securityPostureReference = securityPostureReference;
+ return this;
+ }
+
+ /**
+ * Get the timeCreated property: Specifies the time in which this VM profile for the Virtual Machine Scale Set
+ * was created. Minimum API version for this property is 2023-09-01. This value
+ * will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile
+ * with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00".
+ *
+ * @return the timeCreated value.
+ */
+ public OffsetDateTime timeCreated() {
+ return this.timeCreated;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (osProfile() != null) {
+ osProfile().validate();
+ }
+ if (storageProfile() != null) {
+ storageProfile().validate();
+ }
+ if (networkProfile() != null) {
+ networkProfile().validate();
+ }
+ if (securityProfile() != null) {
+ securityProfile().validate();
+ }
+ if (diagnosticsProfile() != null) {
+ diagnosticsProfile().validate();
+ }
+ if (extensionProfile() != null) {
+ extensionProfile().validate();
+ }
+ if (scheduledEventsProfile() != null) {
+ scheduledEventsProfile().validate();
+ }
+ if (capacityReservation() != null) {
+ capacityReservation().validate();
+ }
+ if (applicationProfile() != null) {
+ applicationProfile().validate();
+ }
+ if (hardwareProfile() != null) {
+ hardwareProfile().validate();
+ }
+ if (serviceArtifactReference() != null) {
+ serviceArtifactReference().validate();
+ }
+ if (securityPostureReference() != null) {
+ securityPostureReference().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("osProfile", this.osProfile);
+ jsonWriter.writeJsonField("storageProfile", this.storageProfile);
+ jsonWriter.writeJsonField("networkProfile", this.networkProfile);
+ jsonWriter.writeJsonField("securityProfile", this.securityProfile);
+ jsonWriter.writeJsonField("diagnosticsProfile", this.diagnosticsProfile);
+ jsonWriter.writeJsonField("extensionProfile", this.extensionProfile);
+ jsonWriter.writeStringField("licenseType", this.licenseType);
+ jsonWriter.writeJsonField("scheduledEventsProfile", this.scheduledEventsProfile);
+ jsonWriter.writeStringField("userData", this.userData);
+ jsonWriter.writeJsonField("capacityReservation", this.capacityReservation);
+ jsonWriter.writeJsonField("applicationProfile", this.applicationProfile);
+ jsonWriter.writeJsonField("hardwareProfile", this.hardwareProfile);
+ jsonWriter.writeJsonField("serviceArtifactReference", this.serviceArtifactReference);
+ jsonWriter.writeJsonField("securityPostureReference", this.securityPostureReference);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BaseVirtualMachineProfile from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BaseVirtualMachineProfile if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the BaseVirtualMachineProfile.
+ */
+ public static BaseVirtualMachineProfile fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ BaseVirtualMachineProfile deserializedBaseVirtualMachineProfile = new BaseVirtualMachineProfile();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("osProfile".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.osProfile = VirtualMachineScaleSetOSProfile.fromJson(reader);
+ } else if ("storageProfile".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.storageProfile
+ = VirtualMachineScaleSetStorageProfile.fromJson(reader);
+ } else if ("networkProfile".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.networkProfile
+ = VirtualMachineScaleSetNetworkProfile.fromJson(reader);
+ } else if ("securityProfile".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.securityProfile = SecurityProfile.fromJson(reader);
+ } else if ("diagnosticsProfile".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.diagnosticsProfile = DiagnosticsProfile.fromJson(reader);
+ } else if ("extensionProfile".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.extensionProfile
+ = VirtualMachineScaleSetExtensionProfile.fromJson(reader);
+ } else if ("licenseType".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.licenseType = reader.getString();
+ } else if ("scheduledEventsProfile".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.scheduledEventsProfile
+ = ScheduledEventsProfile.fromJson(reader);
+ } else if ("userData".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.userData = reader.getString();
+ } else if ("capacityReservation".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.capacityReservation
+ = CapacityReservationProfile.fromJson(reader);
+ } else if ("applicationProfile".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.applicationProfile = ApplicationProfile.fromJson(reader);
+ } else if ("hardwareProfile".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.hardwareProfile
+ = VirtualMachineScaleSetHardwareProfile.fromJson(reader);
+ } else if ("serviceArtifactReference".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.serviceArtifactReference
+ = ServiceArtifactReference.fromJson(reader);
+ } else if ("securityPostureReference".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.securityPostureReference
+ = SecurityPostureReference.fromJson(reader);
+ } else if ("timeCreated".equals(fieldName)) {
+ deserializedBaseVirtualMachineProfile.timeCreated = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedBaseVirtualMachineProfile;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BootDiagnostics.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BootDiagnostics.java
new file mode 100644
index 0000000000000..40cf1f4ac674a
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BootDiagnostics.java
@@ -0,0 +1,130 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Boot Diagnostics is a debugging feature which allows you to view Console Output
+ * and Screenshot to diagnose VM status. You can easily view the output of your
+ * console log. Azure also enables you to see a screenshot of the VM from the
+ * hypervisor.
+ */
+@Fluent
+public final class BootDiagnostics implements JsonSerializable {
+ /*
+ * Whether boot diagnostics should be enabled on the Virtual Machine.
+ */
+ private Boolean enabled;
+
+ /*
+ * Uri of the storage account to use for placing the console output and
+ * screenshot. If storageUri is not specified while enabling boot diagnostics,
+ * managed storage will be used.
+ */
+ private String storageUri;
+
+ /**
+ * Creates an instance of BootDiagnostics class.
+ */
+ public BootDiagnostics() {
+ }
+
+ /**
+ * Get the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine.
+ *
+ * @return the enabled value.
+ */
+ public Boolean enabled() {
+ return this.enabled;
+ }
+
+ /**
+ * Set the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine.
+ *
+ * @param enabled the enabled value to set.
+ * @return the BootDiagnostics object itself.
+ */
+ public BootDiagnostics withEnabled(Boolean enabled) {
+ this.enabled = enabled;
+ return this;
+ }
+
+ /**
+ * Get the storageUri property: Uri of the storage account to use for placing the console output and
+ * screenshot. If storageUri is not specified while enabling boot diagnostics,
+ * managed storage will be used.
+ *
+ * @return the storageUri value.
+ */
+ public String storageUri() {
+ return this.storageUri;
+ }
+
+ /**
+ * Set the storageUri property: Uri of the storage account to use for placing the console output and
+ * screenshot. If storageUri is not specified while enabling boot diagnostics,
+ * managed storage will be used.
+ *
+ * @param storageUri the storageUri value to set.
+ * @return the BootDiagnostics object itself.
+ */
+ public BootDiagnostics withStorageUri(String storageUri) {
+ this.storageUri = storageUri;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeBooleanField("enabled", this.enabled);
+ jsonWriter.writeStringField("storageUri", this.storageUri);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BootDiagnostics from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BootDiagnostics if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the BootDiagnostics.
+ */
+ public static BootDiagnostics fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ BootDiagnostics deserializedBootDiagnostics = new BootDiagnostics();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("enabled".equals(fieldName)) {
+ deserializedBootDiagnostics.enabled = reader.getNullable(JsonReader::getBoolean);
+ } else if ("storageUri".equals(fieldName)) {
+ deserializedBootDiagnostics.storageUri = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedBootDiagnostics;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CachingTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CachingTypes.java
new file mode 100644
index 0000000000000..f014468ba4147
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CachingTypes.java
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Specifies the caching requirements.
+ */
+public final class CachingTypes extends ExpandableStringEnum {
+ /**
+ * Static value None for CachingTypes.
+ */
+ public static final CachingTypes NONE = fromString("None");
+
+ /**
+ * Static value ReadOnly for CachingTypes.
+ */
+ public static final CachingTypes READ_ONLY = fromString("ReadOnly");
+
+ /**
+ * Static value ReadWrite for CachingTypes.
+ */
+ public static final CachingTypes READ_WRITE = fromString("ReadWrite");
+
+ /**
+ * Creates a new instance of CachingTypes value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public CachingTypes() {
+ }
+
+ /**
+ * Creates or finds a CachingTypes from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding CachingTypes.
+ */
+ public static CachingTypes fromString(String name) {
+ return fromString(name, CachingTypes.class);
+ }
+
+ /**
+ * Gets known CachingTypes values.
+ *
+ * @return known CachingTypes values.
+ */
+ public static Collection values() {
+ return values(CachingTypes.class);
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CapacityReservationProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CapacityReservationProfile.java
new file mode 100644
index 0000000000000..fb58bf63afb5d
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CapacityReservationProfile.java
@@ -0,0 +1,105 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.SubResource;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * The parameters of a capacity reservation Profile.
+ */
+@Fluent
+public final class CapacityReservationProfile implements JsonSerializable {
+ /*
+ * Specifies the capacity reservation group resource id that should be used for
+ * allocating the virtual machine or scaleset vm instances provided enough
+ * capacity has been reserved. Please refer to https://aka.ms/CapacityReservation
+ * for more details.
+ */
+ private SubResource capacityReservationGroup;
+
+ /**
+ * Creates an instance of CapacityReservationProfile class.
+ */
+ public CapacityReservationProfile() {
+ }
+
+ /**
+ * Get the capacityReservationGroup property: Specifies the capacity reservation group resource id that should be
+ * used for
+ * allocating the virtual machine or scaleset vm instances provided enough
+ * capacity has been reserved. Please refer to https://aka.ms/CapacityReservation
+ * for more details.
+ *
+ * @return the capacityReservationGroup value.
+ */
+ public SubResource capacityReservationGroup() {
+ return this.capacityReservationGroup;
+ }
+
+ /**
+ * Set the capacityReservationGroup property: Specifies the capacity reservation group resource id that should be
+ * used for
+ * allocating the virtual machine or scaleset vm instances provided enough
+ * capacity has been reserved. Please refer to https://aka.ms/CapacityReservation
+ * for more details.
+ *
+ * @param capacityReservationGroup the capacityReservationGroup value to set.
+ * @return the CapacityReservationProfile object itself.
+ */
+ public CapacityReservationProfile withCapacityReservationGroup(SubResource capacityReservationGroup) {
+ this.capacityReservationGroup = capacityReservationGroup;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("capacityReservationGroup", this.capacityReservationGroup);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of CapacityReservationProfile from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of CapacityReservationProfile if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the CapacityReservationProfile.
+ */
+ public static CapacityReservationProfile fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ CapacityReservationProfile deserializedCapacityReservationProfile = new CapacityReservationProfile();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("capacityReservationGroup".equals(fieldName)) {
+ deserializedCapacityReservationProfile.capacityReservationGroup = SubResource.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedCapacityReservationProfile;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComputeProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComputeProfile.java
new file mode 100644
index 0000000000000..f65435f783b38
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComputeProfile.java
@@ -0,0 +1,228 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azurefleet.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Compute Profile to use for running user's workloads.
+ */
+@Fluent
+public final class ComputeProfile implements JsonSerializable {
+ /*
+ * Base Virtual Machine Profile Properties to be specified according to
+ * "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile"
+ */
+ private BaseVirtualMachineProfile baseVirtualMachineProfile;
+
+ /*
+ * Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine scale sets and
+ * Virtual Machines.
+ * The default value will be the latest supported computeApiVersion by Compute Fleet.
+ */
+ private String computeApiVersion;
+
+ /*
+ * Specifies the number of fault domains to use when creating the underlying VMSS.
+ * A fault domain is a logical group of hardware within an Azure datacenter.
+ * VMs in the same fault domain share a common power source and network switch.
+ * If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible).
+ * This property cannot be updated.
+ */
+ private Integer platformFaultDomainCount;
+
+ /*
+ * Specifies VMSS and VM API entity models support two additional capabilities as of today: ultraSSDEnabled and
+ * hibernationEnabled.
+ * ultraSSDEnabled: Enables UltraSSD_LRS storage account type on the VMSS VMs.
+ * hibernationEnabled: Enables the hibernation capability on the VMSS VMs.
+ * Default value is null if not specified. This property cannot be updated once set.
+ */
+ private AdditionalCapabilities additionalVirtualMachineCapabilities;
+
+ /**
+ * Creates an instance of ComputeProfile class.
+ */
+ public ComputeProfile() {
+ }
+
+ /**
+ * Get the baseVirtualMachineProfile property: Base Virtual Machine Profile Properties to be specified according to
+ * "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile".
+ *
+ * @return the baseVirtualMachineProfile value.
+ */
+ public BaseVirtualMachineProfile baseVirtualMachineProfile() {
+ return this.baseVirtualMachineProfile;
+ }
+
+ /**
+ * Set the baseVirtualMachineProfile property: Base Virtual Machine Profile Properties to be specified according to
+ * "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile".
+ *
+ * @param baseVirtualMachineProfile the baseVirtualMachineProfile value to set.
+ * @return the ComputeProfile object itself.
+ */
+ public ComputeProfile withBaseVirtualMachineProfile(BaseVirtualMachineProfile baseVirtualMachineProfile) {
+ this.baseVirtualMachineProfile = baseVirtualMachineProfile;
+ return this;
+ }
+
+ /**
+ * Get the computeApiVersion property: Specifies the Microsoft.Compute API version to use when creating underlying
+ * Virtual Machine scale sets and Virtual Machines.
+ * The default value will be the latest supported computeApiVersion by Compute Fleet.
+ *
+ * @return the computeApiVersion value.
+ */
+ public String computeApiVersion() {
+ return this.computeApiVersion;
+ }
+
+ /**
+ * Set the computeApiVersion property: Specifies the Microsoft.Compute API version to use when creating underlying
+ * Virtual Machine scale sets and Virtual Machines.
+ * The default value will be the latest supported computeApiVersion by Compute Fleet.
+ *
+ * @param computeApiVersion the computeApiVersion value to set.
+ * @return the ComputeProfile object itself.
+ */
+ public ComputeProfile withComputeApiVersion(String computeApiVersion) {
+ this.computeApiVersion = computeApiVersion;
+ return this;
+ }
+
+ /**
+ * Get the platformFaultDomainCount property: Specifies the number of fault domains to use when creating the
+ * underlying VMSS.
+ * A fault domain is a logical group of hardware within an Azure datacenter.
+ * VMs in the same fault domain share a common power source and network switch.
+ * If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible).
+ * This property cannot be updated.
+ *
+ * @return the platformFaultDomainCount value.
+ */
+ public Integer platformFaultDomainCount() {
+ return this.platformFaultDomainCount;
+ }
+
+ /**
+ * Set the platformFaultDomainCount property: Specifies the number of fault domains to use when creating the
+ * underlying VMSS.
+ * A fault domain is a logical group of hardware within an Azure datacenter.
+ * VMs in the same fault domain share a common power source and network switch.
+ * If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible).
+ * This property cannot be updated.
+ *
+ * @param platformFaultDomainCount the platformFaultDomainCount value to set.
+ * @return the ComputeProfile object itself.
+ */
+ public ComputeProfile withPlatformFaultDomainCount(Integer platformFaultDomainCount) {
+ this.platformFaultDomainCount = platformFaultDomainCount;
+ return this;
+ }
+
+ /**
+ * Get the additionalVirtualMachineCapabilities property: Specifies VMSS and VM API entity models support two
+ * additional capabilities as of today: ultraSSDEnabled and hibernationEnabled.
+ * ultraSSDEnabled: Enables UltraSSD_LRS storage account type on the VMSS VMs.
+ * hibernationEnabled: Enables the hibernation capability on the VMSS VMs.
+ * Default value is null if not specified. This property cannot be updated once set.
+ *
+ * @return the additionalVirtualMachineCapabilities value.
+ */
+ public AdditionalCapabilities additionalVirtualMachineCapabilities() {
+ return this.additionalVirtualMachineCapabilities;
+ }
+
+ /**
+ * Set the additionalVirtualMachineCapabilities property: Specifies VMSS and VM API entity models support two
+ * additional capabilities as of today: ultraSSDEnabled and hibernationEnabled.
+ * ultraSSDEnabled: Enables UltraSSD_LRS storage account type on the VMSS VMs.
+ * hibernationEnabled: Enables the hibernation capability on the VMSS VMs.
+ * Default value is null if not specified. This property cannot be updated once set.
+ *
+ * @param additionalVirtualMachineCapabilities the additionalVirtualMachineCapabilities value to set.
+ * @return the ComputeProfile object itself.
+ */
+ public ComputeProfile
+ withAdditionalVirtualMachineCapabilities(AdditionalCapabilities additionalVirtualMachineCapabilities) {
+ this.additionalVirtualMachineCapabilities = additionalVirtualMachineCapabilities;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (baseVirtualMachineProfile() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property baseVirtualMachineProfile in model ComputeProfile"));
+ } else {
+ baseVirtualMachineProfile().validate();
+ }
+ if (additionalVirtualMachineCapabilities() != null) {
+ additionalVirtualMachineCapabilities().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ComputeProfile.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("baseVirtualMachineProfile", this.baseVirtualMachineProfile);
+ jsonWriter.writeStringField("computeApiVersion", this.computeApiVersion);
+ jsonWriter.writeNumberField("platformFaultDomainCount", this.platformFaultDomainCount);
+ jsonWriter.writeJsonField("additionalVirtualMachineCapabilities", this.additionalVirtualMachineCapabilities);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ComputeProfile from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ComputeProfile if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ComputeProfile.
+ */
+ public static ComputeProfile fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ComputeProfile deserializedComputeProfile = new ComputeProfile();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("baseVirtualMachineProfile".equals(fieldName)) {
+ deserializedComputeProfile.baseVirtualMachineProfile = BaseVirtualMachineProfile.fromJson(reader);
+ } else if ("computeApiVersion".equals(fieldName)) {
+ deserializedComputeProfile.computeApiVersion = reader.getString();
+ } else if ("platformFaultDomainCount".equals(fieldName)) {
+ deserializedComputeProfile.platformFaultDomainCount = reader.getNullable(JsonReader::getInt);
+ } else if ("additionalVirtualMachineCapabilities".equals(fieldName)) {
+ deserializedComputeProfile.additionalVirtualMachineCapabilities
+ = AdditionalCapabilities.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedComputeProfile;
+ });
+ }
+}
diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CpuManufacturer.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CpuManufacturer.java
new file mode 100644
index 0000000000000..294ac8ec2423a
--- /dev/null
+++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CpuManufacturer.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.azurefleet.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Cpu Manufacturers supported by Azure VMs.
+ */
+public final class CpuManufacturer extends ExpandableStringEnum