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 Compute Recommender service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Compute Recommender service API instance.
+ */
+ public ComputeRecommenderManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder.append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.computerecommender")
+ .append("/")
+ .append(clientVersion);
+ 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 ComputeRecommenderManager(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 SpotPlacementScores.
+ *
+ * @return Resource collection API of SpotPlacementScores.
+ */
+ public SpotPlacementScores spotPlacementScores() {
+ if (this.spotPlacementScores == null) {
+ this.spotPlacementScores = new SpotPlacementScoresImpl(clientObject.getSpotPlacementScores(), this);
+ }
+ return spotPlacementScores;
+ }
+
+ /**
+ * Gets wrapped service client ComputeRecommenderManagementClient providing direct access to the underlying
+ * auto-generated API implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client ComputeRecommenderManagementClient.
+ */
+ public ComputeRecommenderManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/ComputeRecommenderManagementClient.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/ComputeRecommenderManagementClient.java
new file mode 100644
index 000000000000..409c8f438cc1
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/ComputeRecommenderManagementClient.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for ComputeRecommenderManagementClient class.
+ */
+public interface ComputeRecommenderManagementClient {
+ /**
+ * Gets Service host.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @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 SpotPlacementScoresClient object to access its operations.
+ *
+ * @return the SpotPlacementScoresClient object.
+ */
+ SpotPlacementScoresClient getSpotPlacementScores();
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/OperationsClient.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/OperationsClient.java
new file mode 100644
index 000000000000..1aaf9e946bc6
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/OperationsClient.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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.computerecommender.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/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/SpotPlacementScoresClient.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/SpotPlacementScoresClient.java
new file mode 100644
index 000000000000..b77be5f62251
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/SpotPlacementScoresClient.java
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner;
+import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput;
+
+/**
+ * An instance of this class provides access to all the operations defined in SpotPlacementScoresClient.
+ */
+public interface SpotPlacementScoresClient {
+ /**
+ * Gets Spot Placement Scores metadata.
+ *
+ * @param location The name of the Azure region.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return spot Placement Scores metadata along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String location, Context context);
+
+ /**
+ * Gets Spot Placement Scores metadata.
+ *
+ * @param location The name of the Azure region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return spot Placement Scores metadata.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ComputeDiagnosticBaseInner get(String location);
+
+ /**
+ * Generates placement scores for Spot VM skus.
+ *
+ * @param location The name of the Azure region.
+ * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores
+ * operation.
+ * @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 spotPlacementScores API response along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response postWithResponse(String location,
+ SpotPlacementScoresInput spotPlacementScoresInput, Context context);
+
+ /**
+ * Generates placement scores for Spot VM skus.
+ *
+ * @param location The name of the Azure region.
+ * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores
+ * 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 spotPlacementScores API response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SpotPlacementScoresResponseInner post(String location, SpotPlacementScoresInput spotPlacementScoresInput);
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/ComputeDiagnosticBaseInner.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/ComputeDiagnosticBaseInner.java
new file mode 100644
index 000000000000..d18e61cb621f
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/ComputeDiagnosticBaseInner.java
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.computerecommender.models.DiagnosticProperties;
+import java.io.IOException;
+
+/**
+ * Contains metadata of a diagnostic type.
+ */
+@Immutable
+public final class ComputeDiagnosticBaseInner extends ProxyResource {
+ /*
+ * Contains additional properties of a diagnostic
+ */
+ private DiagnosticProperties properties;
+
+ /*
+ * 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 ComputeDiagnosticBaseInner class.
+ */
+ private ComputeDiagnosticBaseInner() {
+ }
+
+ /**
+ * Get the properties property: Contains additional properties of a diagnostic.
+ *
+ * @return the properties value.
+ */
+ public DiagnosticProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ComputeDiagnosticBaseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ComputeDiagnosticBaseInner 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 ComputeDiagnosticBaseInner.
+ */
+ public static ComputeDiagnosticBaseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ComputeDiagnosticBaseInner deserializedComputeDiagnosticBaseInner = new ComputeDiagnosticBaseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedComputeDiagnosticBaseInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedComputeDiagnosticBaseInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedComputeDiagnosticBaseInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedComputeDiagnosticBaseInner.properties = DiagnosticProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedComputeDiagnosticBaseInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedComputeDiagnosticBaseInner;
+ });
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/OperationInner.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/OperationInner.java
new file mode 100644
index 000000000000..0a190b2204ac
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/OperationInner.java
@@ -0,0 +1,161 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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.computerecommender.models.ActionType;
+import com.azure.resourcemanager.computerecommender.models.OperationDisplay;
+import com.azure.resourcemanager.computerecommender.models.Origin;
+import java.io.IOException;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Immutable
+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 Azure
+ * Resource Manager/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;
+
+ /*
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ private ActionType actionType;
+
+ /**
+ * Creates an instance of OperationInner class.
+ */
+ private 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 Azure Resource Manager/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;
+ }
+
+ /**
+ * 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: Extensible 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/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/SpotPlacementScoresResponseInner.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/SpotPlacementScoresResponseInner.java
new file mode 100644
index 000000000000..7ae2a61a2964
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/SpotPlacementScoresResponseInner.java
@@ -0,0 +1,169 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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.computerecommender.models.PlacementScore;
+import com.azure.resourcemanager.computerecommender.models.ResourceSize;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * SpotPlacementScores API response.
+ */
+@Immutable
+public final class SpotPlacementScoresResponseInner implements JsonSerializable {
+ /*
+ * The desired regions
+ */
+ private List desiredLocations;
+
+ /*
+ * The desired virtual machine SKU sizes.
+ */
+ private List desiredSizes;
+
+ /*
+ * Desired instance count per region/zone based on the scope.
+ */
+ private Integer desiredCount;
+
+ /*
+ * Defines if the scope is zonal or regional.
+ */
+ private Boolean availabilityZones;
+
+ /*
+ * A placement score indicating the likelihood of successfully allocating the specified Spot VM(s), as well as the
+ * expected lifetimes of the Spot VM(s) after allocation.
+ */
+ private List placementScores;
+
+ /**
+ * Creates an instance of SpotPlacementScoresResponseInner class.
+ */
+ private SpotPlacementScoresResponseInner() {
+ }
+
+ /**
+ * Get the desiredLocations property: The desired regions.
+ *
+ * @return the desiredLocations value.
+ */
+ public List desiredLocations() {
+ return this.desiredLocations;
+ }
+
+ /**
+ * Get the desiredSizes property: The desired virtual machine SKU sizes.
+ *
+ * @return the desiredSizes value.
+ */
+ public List desiredSizes() {
+ return this.desiredSizes;
+ }
+
+ /**
+ * Get the desiredCount property: Desired instance count per region/zone based on the scope.
+ *
+ * @return the desiredCount value.
+ */
+ public Integer desiredCount() {
+ return this.desiredCount;
+ }
+
+ /**
+ * Get the availabilityZones property: Defines if the scope is zonal or regional.
+ *
+ * @return the availabilityZones value.
+ */
+ public Boolean availabilityZones() {
+ return this.availabilityZones;
+ }
+
+ /**
+ * Get the placementScores property: A placement score indicating the likelihood of successfully allocating the
+ * specified Spot VM(s), as well as the expected lifetimes of the Spot VM(s) after allocation.
+ *
+ * @return the placementScores value.
+ */
+ public List placementScores() {
+ return this.placementScores;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (desiredSizes() != null) {
+ desiredSizes().forEach(e -> e.validate());
+ }
+ if (placementScores() != null) {
+ placementScores().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("desiredLocations", this.desiredLocations,
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeArrayField("desiredSizes", this.desiredSizes, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeNumberField("desiredCount", this.desiredCount);
+ jsonWriter.writeBooleanField("availabilityZones", this.availabilityZones);
+ jsonWriter.writeArrayField("placementScores", this.placementScores,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of SpotPlacementScoresResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of SpotPlacementScoresResponseInner 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 SpotPlacementScoresResponseInner.
+ */
+ public static SpotPlacementScoresResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ SpotPlacementScoresResponseInner deserializedSpotPlacementScoresResponseInner
+ = new SpotPlacementScoresResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("desiredLocations".equals(fieldName)) {
+ List desiredLocations = reader.readArray(reader1 -> reader1.getString());
+ deserializedSpotPlacementScoresResponseInner.desiredLocations = desiredLocations;
+ } else if ("desiredSizes".equals(fieldName)) {
+ List desiredSizes = reader.readArray(reader1 -> ResourceSize.fromJson(reader1));
+ deserializedSpotPlacementScoresResponseInner.desiredSizes = desiredSizes;
+ } else if ("desiredCount".equals(fieldName)) {
+ deserializedSpotPlacementScoresResponseInner.desiredCount = reader.getNullable(JsonReader::getInt);
+ } else if ("availabilityZones".equals(fieldName)) {
+ deserializedSpotPlacementScoresResponseInner.availabilityZones
+ = reader.getNullable(JsonReader::getBoolean);
+ } else if ("placementScores".equals(fieldName)) {
+ List placementScores
+ = reader.readArray(reader1 -> PlacementScore.fromJson(reader1));
+ deserializedSpotPlacementScoresResponseInner.placementScores = placementScores;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedSpotPlacementScoresResponseInner;
+ });
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/models/package-info.java
new file mode 100644
index 000000000000..6d1e4773a4f3
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the inner data models for ComputeRecommender.
+ * The Compute Recommender Resource Provider Client.
+ */
+package com.azure.resourcemanager.computerecommender.fluent.models;
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/fluent/package-info.java
new file mode 100644
index 000000000000..5ef2a82b8a3b
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the service clients for ComputeRecommender.
+ * The Compute Recommender Resource Provider Client.
+ */
+package com.azure.resourcemanager.computerecommender.fluent;
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeDiagnosticBaseImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeDiagnosticBaseImpl.java
new file mode 100644
index 000000000000..f356abae9a50
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeDiagnosticBaseImpl.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner;
+import com.azure.resourcemanager.computerecommender.models.ComputeDiagnosticBase;
+import com.azure.resourcemanager.computerecommender.models.DiagnosticProperties;
+
+public final class ComputeDiagnosticBaseImpl implements ComputeDiagnosticBase {
+ private ComputeDiagnosticBaseInner innerObject;
+
+ private final com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager;
+
+ ComputeDiagnosticBaseImpl(ComputeDiagnosticBaseInner innerObject,
+ com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public DiagnosticProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ComputeDiagnosticBaseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientBuilder.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientBuilder.java
new file mode 100644
index 000000000000..efa298241949
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientBuilder.java
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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 ComputeRecommenderManagementClientImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { ComputeRecommenderManagementClientImpl.class })
+public final class ComputeRecommenderManagementClientBuilder {
+ /*
+ * Service host
+ */
+ private String endpoint;
+
+ /**
+ * Sets Service host.
+ *
+ * @param endpoint the endpoint value.
+ * @return the ComputeRecommenderManagementClientBuilder.
+ */
+ public ComputeRecommenderManagementClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * 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 ComputeRecommenderManagementClientBuilder.
+ */
+ public ComputeRecommenderManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the ComputeRecommenderManagementClientBuilder.
+ */
+ public ComputeRecommenderManagementClientBuilder 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 ComputeRecommenderManagementClientBuilder.
+ */
+ public ComputeRecommenderManagementClientBuilder 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 ComputeRecommenderManagementClientBuilder.
+ */
+ public ComputeRecommenderManagementClientBuilder 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 ComputeRecommenderManagementClientBuilder.
+ */
+ public ComputeRecommenderManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of ComputeRecommenderManagementClientImpl with the provided parameters.
+ *
+ * @return an instance of ComputeRecommenderManagementClientImpl.
+ */
+ public ComputeRecommenderManagementClientImpl 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();
+ ComputeRecommenderManagementClientImpl client = new ComputeRecommenderManagementClientImpl(localPipeline,
+ localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId);
+ return client;
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientImpl.java
new file mode 100644
index 000000000000..51380ee27f72
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ComputeRecommenderManagementClientImpl.java
@@ -0,0 +1,324 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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.management.polling.SyncPollerFactory;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.computerecommender.fluent.ComputeRecommenderManagementClient;
+import com.azure.resourcemanager.computerecommender.fluent.OperationsClient;
+import com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient;
+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 ComputeRecommenderManagementClientImpl type.
+ */
+@ServiceClient(builder = ComputeRecommenderManagementClientBuilder.class)
+public final class ComputeRecommenderManagementClientImpl implements ComputeRecommenderManagementClient {
+ /**
+ * Service host.
+ */
+ private final String endpoint;
+
+ /**
+ * Gets Service host.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Version parameter.
+ */
+ private final String apiVersion;
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /**
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * The HTTP pipeline to send requests through.
+ */
+ 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 SpotPlacementScoresClient object to access its operations.
+ */
+ private final SpotPlacementScoresClient spotPlacementScores;
+
+ /**
+ * Gets the SpotPlacementScoresClient object to access its operations.
+ *
+ * @return the SpotPlacementScoresClient object.
+ */
+ public SpotPlacementScoresClient getSpotPlacementScores() {
+ return this.spotPlacementScores;
+ }
+
+ /**
+ * Initializes an instance of ComputeRecommenderManagementClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param endpoint Service host.
+ * @param subscriptionId The ID of the target subscription. The value must be an UUID.
+ */
+ ComputeRecommenderManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.endpoint = endpoint;
+ this.subscriptionId = subscriptionId;
+ this.apiVersion = "2025-06-05";
+ this.operations = new OperationsClientImpl(this);
+ this.spotPlacementScores = new SpotPlacementScoresClientImpl(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 long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @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 SyncPoller for poll result and final result.
+ */
+ public SyncPoller, U> getLroResult(Response activationResponse,
+ Type pollResultType, Type finalResultType, Context context) {
+ return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType,
+ defaultPollInterval, () -> activationResponse, context);
+ }
+
+ /**
+ * Gets the final result, or an error, based on last async poll response.
+ *
+ * @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(ComputeRecommenderManagementClientImpl.class);
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationImpl.java
new file mode 100644
index 000000000000..b35e0f0d2e81
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.implementation;
+
+import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner;
+import com.azure.resourcemanager.computerecommender.models.ActionType;
+import com.azure.resourcemanager.computerecommender.models.Operation;
+import com.azure.resourcemanager.computerecommender.models.OperationDisplay;
+import com.azure.resourcemanager.computerecommender.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager;
+
+ OperationImpl(OperationInner innerObject,
+ com.azure.resourcemanager.computerecommender.ComputeRecommenderManager 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.computerecommender.ComputeRecommenderManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsClientImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsClientImpl.java
new file mode 100644
index 000000000000..42da49f9b7e7
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsClientImpl.java
@@ -0,0 +1,284 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.computerecommender.fluent.OperationsClient;
+import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner;
+import com.azure.resourcemanager.computerecommender.implementation.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 ComputeRecommenderManagementClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(ComputeRecommenderManagementClientImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ComputeRecommenderManagementClientOperations to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "ComputeRecommenderManagementClientOperations")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.Compute/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.Compute/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * 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.
+ *
+ * @throws 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.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage() {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * 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<>(() -> listSinglePage(), nextLink -> listNextSinglePage(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 PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink, Context context) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class);
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsImpl.java
new file mode 100644
index 000000000000..9e2cfbdb8f0d
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/OperationsImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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.computerecommender.fluent.OperationsClient;
+import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner;
+import com.azure.resourcemanager.computerecommender.models.Operation;
+import com.azure.resourcemanager.computerecommender.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.computerecommender.ComputeRecommenderManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient,
+ com.azure.resourcemanager.computerecommender.ComputeRecommenderManager 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.computerecommender.ComputeRecommenderManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ResourceManagerUtils.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ResourceManagerUtils.java
new file mode 100644
index 000000000000..c15552844a8c
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/ResourceManagerUtils.java
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresClientImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresClientImpl.java
new file mode 100644
index 000000000000..ededcb6e9224
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresClientImpl.java
@@ -0,0 +1,304 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.implementation;
+
+import com.azure.core.annotation.BodyParam;
+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.Post;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient;
+import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner;
+import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in SpotPlacementScoresClient.
+ */
+public final class SpotPlacementScoresClientImpl implements SpotPlacementScoresClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final SpotPlacementScoresService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final ComputeRecommenderManagementClientImpl client;
+
+ /**
+ * Initializes an instance of SpotPlacementScoresClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ SpotPlacementScoresClientImpl(ComputeRecommenderManagementClientImpl client) {
+ this.service = RestProxy.create(SpotPlacementScoresService.class, client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ComputeRecommenderManagementClientSpotPlacementScores to be used by
+ * the proxy service to perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "ComputeRecommenderManagementClientSpotPlacementScores")
+ public interface SpotPlacementScoresService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response getSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context);
+
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot/generate")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> post(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("location") String location, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") SpotPlacementScoresInput spotPlacementScoresInput, Context context);
+
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot/generate")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response postSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("location") String location, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") SpotPlacementScoresInput spotPlacementScoresInput, Context context);
+ }
+
+ /**
+ * Gets Spot Placement Scores metadata.
+ *
+ * @param location The name of the Azure region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return spot Placement Scores metadata along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String location) {
+ 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 (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), location, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets Spot Placement Scores metadata.
+ *
+ * @param location The name of the Azure region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return spot Placement Scores metadata on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String location) {
+ return getWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets Spot Placement Scores metadata.
+ *
+ * @param location The name of the Azure region.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return spot Placement Scores metadata along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(String location, Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (location == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter location is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ location, accept, context);
+ }
+
+ /**
+ * Gets Spot Placement Scores metadata.
+ *
+ * @param location The name of the Azure region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return spot Placement Scores metadata.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ComputeDiagnosticBaseInner get(String location) {
+ return getWithResponse(location, Context.NONE).getValue();
+ }
+
+ /**
+ * Generates placement scores for Spot VM skus.
+ *
+ * @param location The name of the Azure region.
+ * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores
+ * 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 spotPlacementScores API response along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> postWithResponseAsync(String location,
+ SpotPlacementScoresInput spotPlacementScoresInput) {
+ 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 (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
+ }
+ if (spotPlacementScoresInput == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter spotPlacementScoresInput is required and cannot be null."));
+ } else {
+ spotPlacementScoresInput.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), location, contentType, accept, spotPlacementScoresInput, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Generates placement scores for Spot VM skus.
+ *
+ * @param location The name of the Azure region.
+ * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores
+ * 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 spotPlacementScores API response on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono postAsync(String location,
+ SpotPlacementScoresInput spotPlacementScoresInput) {
+ return postWithResponseAsync(location, spotPlacementScoresInput)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Generates placement scores for Spot VM skus.
+ *
+ * @param location The name of the Azure region.
+ * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores
+ * operation.
+ * @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 spotPlacementScores API response along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response postWithResponse(String location,
+ SpotPlacementScoresInput spotPlacementScoresInput, Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (location == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter location is required and cannot be null."));
+ }
+ if (spotPlacementScoresInput == null) {
+ throw LOGGER.atError()
+ .log(
+ new IllegalArgumentException("Parameter spotPlacementScoresInput is required and cannot be null."));
+ } else {
+ spotPlacementScoresInput.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ location, contentType, accept, spotPlacementScoresInput, context);
+ }
+
+ /**
+ * Generates placement scores for Spot VM skus.
+ *
+ * @param location The name of the Azure region.
+ * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores
+ * 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 spotPlacementScores API response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SpotPlacementScoresResponseInner post(String location, SpotPlacementScoresInput spotPlacementScoresInput) {
+ return postWithResponse(location, spotPlacementScoresInput, Context.NONE).getValue();
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(SpotPlacementScoresClientImpl.class);
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresImpl.java
new file mode 100644
index 000000000000..1975479c976d
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresImpl.java
@@ -0,0 +1,79 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient;
+import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner;
+import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner;
+import com.azure.resourcemanager.computerecommender.models.ComputeDiagnosticBase;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScores;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresResponse;
+
+public final class SpotPlacementScoresImpl implements SpotPlacementScores {
+ private static final ClientLogger LOGGER = new ClientLogger(SpotPlacementScoresImpl.class);
+
+ private final SpotPlacementScoresClient innerClient;
+
+ private final com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager;
+
+ public SpotPlacementScoresImpl(SpotPlacementScoresClient innerClient,
+ com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getWithResponse(String location, Context context) {
+ Response inner = this.serviceClient().getWithResponse(location, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new ComputeDiagnosticBaseImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public ComputeDiagnosticBase get(String location) {
+ ComputeDiagnosticBaseInner inner = this.serviceClient().get(location);
+ if (inner != null) {
+ return new ComputeDiagnosticBaseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response postWithResponse(String location,
+ SpotPlacementScoresInput spotPlacementScoresInput, Context context) {
+ Response inner
+ = this.serviceClient().postWithResponse(location, spotPlacementScoresInput, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new SpotPlacementScoresResponseImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public SpotPlacementScoresResponse post(String location, SpotPlacementScoresInput spotPlacementScoresInput) {
+ SpotPlacementScoresResponseInner inner = this.serviceClient().post(location, spotPlacementScoresInput);
+ if (inner != null) {
+ return new SpotPlacementScoresResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private SpotPlacementScoresClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresResponseImpl.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresResponseImpl.java
new file mode 100644
index 000000000000..7e72cd74380b
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/SpotPlacementScoresResponseImpl.java
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.implementation;
+
+import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner;
+import com.azure.resourcemanager.computerecommender.models.PlacementScore;
+import com.azure.resourcemanager.computerecommender.models.ResourceSize;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresResponse;
+import java.util.Collections;
+import java.util.List;
+
+public final class SpotPlacementScoresResponseImpl implements SpotPlacementScoresResponse {
+ private SpotPlacementScoresResponseInner innerObject;
+
+ private final com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager;
+
+ SpotPlacementScoresResponseImpl(SpotPlacementScoresResponseInner innerObject,
+ com.azure.resourcemanager.computerecommender.ComputeRecommenderManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public List desiredLocations() {
+ List inner = this.innerModel().desiredLocations();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public List desiredSizes() {
+ List inner = this.innerModel().desiredSizes();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public Integer desiredCount() {
+ return this.innerModel().desiredCount();
+ }
+
+ public Boolean availabilityZones() {
+ return this.innerModel().availabilityZones();
+ }
+
+ public List placementScores() {
+ List inner = this.innerModel().placementScores();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public SpotPlacementScoresResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/models/OperationListResult.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/models/OperationListResult.java
new file mode 100644
index 000000000000..ab3cb4942819
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/models/OperationListResult.java
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.implementation.models;
+
+import com.azure.core.annotation.Immutable;
+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.computerecommender.fluent.models.OperationInner;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of
+ * results.
+ */
+@Immutable
+public final class OperationListResult implements JsonSerializable {
+ /*
+ * The Operation items on this page
+ */
+ private List value;
+
+ /*
+ * The link to the next page of items
+ */
+ private String nextLink;
+
+ /**
+ * Creates an instance of OperationListResult class.
+ */
+ private OperationListResult() {
+ }
+
+ /**
+ * Get the value property: The Operation items on this page.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Get the nextLink property: The link to the next page of items.
+ *
+ * @return the nextLink value.
+ */
+ public String nextLink() {
+ return this.nextLink;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (value() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property value in model OperationListResult"));
+ } else {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("nextLink", this.nextLink);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationListResult from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the OperationListResult.
+ */
+ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationListResult deserializedOperationListResult = new OperationListResult();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1));
+ deserializedOperationListResult.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedOperationListResult.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationListResult;
+ });
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/implementation/package-info.java
new file mode 100644
index 000000000000..6c267d22736c
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the implementations for ComputeRecommender.
+ * The Compute Recommender Resource Provider Client.
+ */
+package com.azure.resourcemanager.computerecommender.implementation;
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ActionType.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ActionType.java
new file mode 100644
index 000000000000..3e1ca43a1ca2
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ActionType.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+public final class ActionType extends ExpandableStringEnum {
+ /**
+ * Actions are for internal-only APIs.
+ */
+ public static final ActionType INTERNAL = fromString("Internal");
+
+ /**
+ * Creates a new instance of ActionType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public ActionType() {
+ }
+
+ /**
+ * Creates or finds a ActionType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ActionType.
+ */
+ public static ActionType fromString(String name) {
+ return fromString(name, ActionType.class);
+ }
+
+ /**
+ * Gets known ActionType values.
+ *
+ * @return known ActionType values.
+ */
+ public static Collection values() {
+ return values(ActionType.class);
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ComputeDiagnosticBase.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ComputeDiagnosticBase.java
new file mode 100644
index 000000000000..ba32cf168053
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ComputeDiagnosticBase.java
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner;
+
+/**
+ * An immutable client-side representation of ComputeDiagnosticBase.
+ */
+public interface ComputeDiagnosticBase {
+ /**
+ * Gets the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * Gets the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * Gets the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * Gets the properties property: Contains additional properties of a diagnostic.
+ *
+ * @return the properties value.
+ */
+ DiagnosticProperties properties();
+
+ /**
+ * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ SystemData systemData();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner object.
+ *
+ * @return the inner object.
+ */
+ ComputeDiagnosticBaseInner innerModel();
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/DiagnosticProperties.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/DiagnosticProperties.java
new file mode 100644
index 000000000000..945b1abbcd2f
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/DiagnosticProperties.java
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Contains additional properties of a diagnostic.
+ */
+@Immutable
+public final class DiagnosticProperties implements JsonSerializable {
+ /*
+ * Describes what are the supported resource types for a diagnostic.
+ */
+ private List supportedResourceTypes;
+
+ /**
+ * Creates an instance of DiagnosticProperties class.
+ */
+ private DiagnosticProperties() {
+ }
+
+ /**
+ * Get the supportedResourceTypes property: Describes what are the supported resource types for a diagnostic.
+ *
+ * @return the supportedResourceTypes value.
+ */
+ public List supportedResourceTypes() {
+ return this.supportedResourceTypes;
+ }
+
+ /**
+ * 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.writeArrayField("supportedResourceTypes", this.supportedResourceTypes,
+ (writer, element) -> writer.writeString(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DiagnosticProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DiagnosticProperties 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 DiagnosticProperties.
+ */
+ public static DiagnosticProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DiagnosticProperties deserializedDiagnosticProperties = new DiagnosticProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("supportedResourceTypes".equals(fieldName)) {
+ List supportedResourceTypes = reader.readArray(reader1 -> reader1.getString());
+ deserializedDiagnosticProperties.supportedResourceTypes = supportedResourceTypes;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDiagnosticProperties;
+ });
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operation.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operation.java
new file mode 100644
index 000000000000..94a4c2736488
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operation.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner;
+
+/**
+ * An immutable client-side representation of Operation.
+ */
+public interface Operation {
+ /**
+ * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ *
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
+ * operations and "false" for Azure Resource Manager/control-plane operations.
+ *
+ * @return the isDataAction value.
+ */
+ Boolean isDataAction();
+
+ /**
+ * Gets the display property: Localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ OperationDisplay display();
+
+ /**
+ * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
+ * audit logs UX. Default value is "user,system".
+ *
+ * @return the origin value.
+ */
+ Origin origin();
+
+ /**
+ * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are
+ * for internal only APIs.
+ *
+ * @return the actionType value.
+ */
+ ActionType actionType();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.computerecommender.fluent.models.OperationInner object.
+ *
+ * @return the inner object.
+ */
+ OperationInner innerModel();
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/OperationDisplay.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/OperationDisplay.java
new file mode 100644
index 000000000000..ef1c9965b4cc
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/OperationDisplay.java
@@ -0,0 +1,136 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Localized display information for and operation.
+ */
+@Immutable
+public final class OperationDisplay implements JsonSerializable {
+ /*
+ * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or
+ * "Microsoft Compute".
+ */
+ private String provider;
+
+ /*
+ * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or
+ * "Job Schedule Collections".
+ */
+ private String resource;
+
+ /*
+ * The concise, localized friendly name for the operation; suitable for dropdowns. E.g.
+ * "Create or Update Virtual Machine", "Restart Virtual Machine".
+ */
+ private String operation;
+
+ /*
+ * The short, localized friendly description of the operation; suitable for tool tips and detailed views.
+ */
+ private String description;
+
+ /**
+ * Creates an instance of OperationDisplay class.
+ */
+ private OperationDisplay() {
+ }
+
+ /**
+ * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring
+ * Insights" or "Microsoft Compute".
+ *
+ * @return the provider value.
+ */
+ public String provider() {
+ return this.provider;
+ }
+
+ /**
+ * Get the resource property: The localized friendly name of the resource type related to this operation. E.g.
+ * "Virtual Machines" or "Job Schedule Collections".
+ *
+ * @return the resource value.
+ */
+ public String resource() {
+ return this.resource;
+ }
+
+ /**
+ * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g.
+ * "Create or Update Virtual Machine", "Restart Virtual Machine".
+ *
+ * @return the operation value.
+ */
+ public String operation() {
+ return this.operation;
+ }
+
+ /**
+ * Get the description property: The short, localized friendly description of the operation; suitable for tool tips
+ * and detailed views.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.description;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationDisplay from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationDisplay 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 OperationDisplay.
+ */
+ public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationDisplay deserializedOperationDisplay = new OperationDisplay();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("provider".equals(fieldName)) {
+ deserializedOperationDisplay.provider = reader.getString();
+ } else if ("resource".equals(fieldName)) {
+ deserializedOperationDisplay.resource = reader.getString();
+ } else if ("operation".equals(fieldName)) {
+ deserializedOperationDisplay.operation = reader.getString();
+ } else if ("description".equals(fieldName)) {
+ deserializedOperationDisplay.description = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationDisplay;
+ });
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operations.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operations.java
new file mode 100644
index 000000000000..2c8ffdb66304
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Operations.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+
+/**
+ * Resource collection API of Operations.
+ */
+public interface Operations {
+ /**
+ * List the operations for the provider.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ 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}.
+ */
+ PagedIterable list(Context context);
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Origin.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Origin.java
new file mode 100644
index 000000000000..2897713dc336
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/Origin.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value
+ * is "user,system".
+ */
+public final class Origin extends ExpandableStringEnum {
+ /**
+ * Indicates the operation is initiated by a user.
+ */
+ public static final Origin USER = fromString("user");
+
+ /**
+ * Indicates the operation is initiated by a system.
+ */
+ public static final Origin SYSTEM = fromString("system");
+
+ /**
+ * Indicates the operation is initiated by a user or system.
+ */
+ public static final Origin USER_SYSTEM = fromString("user,system");
+
+ /**
+ * Creates a new instance of Origin value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public Origin() {
+ }
+
+ /**
+ * Creates or finds a Origin from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding Origin.
+ */
+ public static Origin fromString(String name) {
+ return fromString(name, Origin.class);
+ }
+
+ /**
+ * Gets known Origin values.
+ *
+ * @return known Origin values.
+ */
+ public static Collection values() {
+ return values(Origin.class);
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/PlacementScore.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/PlacementScore.java
new file mode 100644
index 000000000000..c4c6ea7c911e
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/PlacementScore.java
@@ -0,0 +1,152 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * The spot placement score for sku/region/zone combination.
+ */
+@Immutable
+public final class PlacementScore implements JsonSerializable {
+ /*
+ * The resource's CRP virtual machine SKU size.
+ */
+ private String sku;
+
+ /*
+ * The region.
+ */
+ private String region;
+
+ /*
+ * The availability zone.
+ */
+ private String availabilityZone;
+
+ /*
+ * A placement score indicating the likelihood of successfully allocating the specified Spot VM(s), as well as the
+ * expected lifetimes of the Spot VM(s) after allocation.
+ */
+ private String score;
+
+ /*
+ * Whether the desired quota is available.
+ */
+ private Boolean isQuotaAvailable;
+
+ /**
+ * Creates an instance of PlacementScore class.
+ */
+ private PlacementScore() {
+ }
+
+ /**
+ * Get the sku property: The resource's CRP virtual machine SKU size.
+ *
+ * @return the sku value.
+ */
+ public String sku() {
+ return this.sku;
+ }
+
+ /**
+ * Get the region property: The region.
+ *
+ * @return the region value.
+ */
+ public String region() {
+ return this.region;
+ }
+
+ /**
+ * Get the availabilityZone property: The availability zone.
+ *
+ * @return the availabilityZone value.
+ */
+ public String availabilityZone() {
+ return this.availabilityZone;
+ }
+
+ /**
+ * Get the score property: A placement score indicating the likelihood of successfully allocating the specified Spot
+ * VM(s), as well as the expected lifetimes of the Spot VM(s) after allocation.
+ *
+ * @return the score value.
+ */
+ public String score() {
+ return this.score;
+ }
+
+ /**
+ * Get the isQuotaAvailable property: Whether the desired quota is available.
+ *
+ * @return the isQuotaAvailable value.
+ */
+ public Boolean isQuotaAvailable() {
+ return this.isQuotaAvailable;
+ }
+
+ /**
+ * 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("sku", this.sku);
+ jsonWriter.writeStringField("region", this.region);
+ jsonWriter.writeStringField("availabilityZone", this.availabilityZone);
+ jsonWriter.writeStringField("score", this.score);
+ jsonWriter.writeBooleanField("isQuotaAvailable", this.isQuotaAvailable);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PlacementScore from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PlacementScore 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 PlacementScore.
+ */
+ public static PlacementScore fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PlacementScore deserializedPlacementScore = new PlacementScore();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("sku".equals(fieldName)) {
+ deserializedPlacementScore.sku = reader.getString();
+ } else if ("region".equals(fieldName)) {
+ deserializedPlacementScore.region = reader.getString();
+ } else if ("availabilityZone".equals(fieldName)) {
+ deserializedPlacementScore.availabilityZone = reader.getString();
+ } else if ("score".equals(fieldName)) {
+ deserializedPlacementScore.score = reader.getString();
+ } else if ("isQuotaAvailable".equals(fieldName)) {
+ deserializedPlacementScore.isQuotaAvailable = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPlacementScore;
+ });
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ResourceSize.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ResourceSize.java
new file mode 100644
index 000000000000..5b511966eb4a
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/ResourceSize.java
@@ -0,0 +1,93 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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;
+
+/**
+ * SpotPlacementRecommender API response.
+ */
+@Fluent
+public final class ResourceSize implements JsonSerializable {
+ /*
+ * The resource's CRP virtual machine SKU size.
+ */
+ private String sku;
+
+ /**
+ * Creates an instance of ResourceSize class.
+ */
+ public ResourceSize() {
+ }
+
+ /**
+ * Get the sku property: The resource's CRP virtual machine SKU size.
+ *
+ * @return the sku value.
+ */
+ public String sku() {
+ return this.sku;
+ }
+
+ /**
+ * Set the sku property: The resource's CRP virtual machine SKU size.
+ *
+ * @param sku the sku value to set.
+ * @return the ResourceSize object itself.
+ */
+ public ResourceSize withSku(String sku) {
+ this.sku = sku;
+ 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("sku", this.sku);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ResourceSize from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ResourceSize 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 ResourceSize.
+ */
+ public static ResourceSize fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ResourceSize deserializedResourceSize = new ResourceSize();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("sku".equals(fieldName)) {
+ deserializedResourceSize.sku = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedResourceSize;
+ });
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScores.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScores.java
new file mode 100644
index 000000000000..309edca01a51
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScores.java
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+
+/**
+ * Resource collection API of SpotPlacementScores.
+ */
+public interface SpotPlacementScores {
+ /**
+ * Gets Spot Placement Scores metadata.
+ *
+ * @param location The name of the Azure region.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return spot Placement Scores metadata along with {@link Response}.
+ */
+ Response getWithResponse(String location, Context context);
+
+ /**
+ * Gets Spot Placement Scores metadata.
+ *
+ * @param location The name of the Azure region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return spot Placement Scores metadata.
+ */
+ ComputeDiagnosticBase get(String location);
+
+ /**
+ * Generates placement scores for Spot VM skus.
+ *
+ * @param location The name of the Azure region.
+ * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores
+ * operation.
+ * @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 spotPlacementScores API response along with {@link Response}.
+ */
+ Response postWithResponse(String location,
+ SpotPlacementScoresInput spotPlacementScoresInput, Context context);
+
+ /**
+ * Generates placement scores for Spot VM skus.
+ *
+ * @param location The name of the Azure region.
+ * @param spotPlacementScoresInput SpotPlacementScores object supplied in the body of the Post spot placement scores
+ * 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 spotPlacementScores API response.
+ */
+ SpotPlacementScoresResponse post(String location, SpotPlacementScoresInput spotPlacementScoresInput);
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresInput.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresInput.java
new file mode 100644
index 000000000000..969cce874531
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresInput.java
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.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;
+
+/**
+ * SpotPlacementScores API Input.
+ */
+@Fluent
+public final class SpotPlacementScoresInput implements JsonSerializable {
+ /*
+ * The desired regions
+ */
+ private List desiredLocations;
+
+ /*
+ * The desired virtual machine SKU sizes.
+ */
+ private List desiredSizes;
+
+ /*
+ * Desired instance count per region/zone based on the scope.
+ */
+ private Integer desiredCount;
+
+ /*
+ * Defines if the scope is zonal or regional.
+ */
+ private Boolean availabilityZones;
+
+ /**
+ * Creates an instance of SpotPlacementScoresInput class.
+ */
+ public SpotPlacementScoresInput() {
+ }
+
+ /**
+ * Get the desiredLocations property: The desired regions.
+ *
+ * @return the desiredLocations value.
+ */
+ public List desiredLocations() {
+ return this.desiredLocations;
+ }
+
+ /**
+ * Set the desiredLocations property: The desired regions.
+ *
+ * @param desiredLocations the desiredLocations value to set.
+ * @return the SpotPlacementScoresInput object itself.
+ */
+ public SpotPlacementScoresInput withDesiredLocations(List desiredLocations) {
+ this.desiredLocations = desiredLocations;
+ return this;
+ }
+
+ /**
+ * Get the desiredSizes property: The desired virtual machine SKU sizes.
+ *
+ * @return the desiredSizes value.
+ */
+ public List desiredSizes() {
+ return this.desiredSizes;
+ }
+
+ /**
+ * Set the desiredSizes property: The desired virtual machine SKU sizes.
+ *
+ * @param desiredSizes the desiredSizes value to set.
+ * @return the SpotPlacementScoresInput object itself.
+ */
+ public SpotPlacementScoresInput withDesiredSizes(List desiredSizes) {
+ this.desiredSizes = desiredSizes;
+ return this;
+ }
+
+ /**
+ * Get the desiredCount property: Desired instance count per region/zone based on the scope.
+ *
+ * @return the desiredCount value.
+ */
+ public Integer desiredCount() {
+ return this.desiredCount;
+ }
+
+ /**
+ * Set the desiredCount property: Desired instance count per region/zone based on the scope.
+ *
+ * @param desiredCount the desiredCount value to set.
+ * @return the SpotPlacementScoresInput object itself.
+ */
+ public SpotPlacementScoresInput withDesiredCount(Integer desiredCount) {
+ this.desiredCount = desiredCount;
+ return this;
+ }
+
+ /**
+ * Get the availabilityZones property: Defines if the scope is zonal or regional.
+ *
+ * @return the availabilityZones value.
+ */
+ public Boolean availabilityZones() {
+ return this.availabilityZones;
+ }
+
+ /**
+ * Set the availabilityZones property: Defines if the scope is zonal or regional.
+ *
+ * @param availabilityZones the availabilityZones value to set.
+ * @return the SpotPlacementScoresInput object itself.
+ */
+ public SpotPlacementScoresInput withAvailabilityZones(Boolean availabilityZones) {
+ this.availabilityZones = availabilityZones;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (desiredSizes() != null) {
+ desiredSizes().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("desiredLocations", this.desiredLocations,
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeArrayField("desiredSizes", this.desiredSizes, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeNumberField("desiredCount", this.desiredCount);
+ jsonWriter.writeBooleanField("availabilityZones", this.availabilityZones);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of SpotPlacementScoresInput from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of SpotPlacementScoresInput 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 SpotPlacementScoresInput.
+ */
+ public static SpotPlacementScoresInput fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ SpotPlacementScoresInput deserializedSpotPlacementScoresInput = new SpotPlacementScoresInput();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("desiredLocations".equals(fieldName)) {
+ List desiredLocations = reader.readArray(reader1 -> reader1.getString());
+ deserializedSpotPlacementScoresInput.desiredLocations = desiredLocations;
+ } else if ("desiredSizes".equals(fieldName)) {
+ List desiredSizes = reader.readArray(reader1 -> ResourceSize.fromJson(reader1));
+ deserializedSpotPlacementScoresInput.desiredSizes = desiredSizes;
+ } else if ("desiredCount".equals(fieldName)) {
+ deserializedSpotPlacementScoresInput.desiredCount = reader.getNullable(JsonReader::getInt);
+ } else if ("availabilityZones".equals(fieldName)) {
+ deserializedSpotPlacementScoresInput.availabilityZones = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedSpotPlacementScoresInput;
+ });
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresResponse.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresResponse.java
new file mode 100644
index 000000000000..e3dce8b6d6e2
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/SpotPlacementScoresResponse.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.models;
+
+import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner;
+import java.util.List;
+
+/**
+ * An immutable client-side representation of SpotPlacementScoresResponse.
+ */
+public interface SpotPlacementScoresResponse {
+ /**
+ * Gets the desiredLocations property: The desired regions.
+ *
+ * @return the desiredLocations value.
+ */
+ List desiredLocations();
+
+ /**
+ * Gets the desiredSizes property: The desired virtual machine SKU sizes.
+ *
+ * @return the desiredSizes value.
+ */
+ List desiredSizes();
+
+ /**
+ * Gets the desiredCount property: Desired instance count per region/zone based on the scope.
+ *
+ * @return the desiredCount value.
+ */
+ Integer desiredCount();
+
+ /**
+ * Gets the availabilityZones property: Defines if the scope is zonal or regional.
+ *
+ * @return the availabilityZones value.
+ */
+ Boolean availabilityZones();
+
+ /**
+ * Gets the placementScores property: A placement score indicating the likelihood of successfully allocating the
+ * specified Spot VM(s), as well as the expected lifetimes of the Spot VM(s) after allocation.
+ *
+ * @return the placementScores value.
+ */
+ List placementScores();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner
+ * object.
+ *
+ * @return the inner object.
+ */
+ SpotPlacementScoresResponseInner innerModel();
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/models/package-info.java
new file mode 100644
index 000000000000..fd1003bc0b86
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the data models for ComputeRecommender.
+ * The Compute Recommender Resource Provider Client.
+ */
+package com.azure.resourcemanager.computerecommender.models;
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/package-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/package-info.java
new file mode 100644
index 000000000000..22e0bd7d6aa9
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/com/azure/resourcemanager/computerecommender/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+/**
+ * Package containing the classes for ComputeRecommender.
+ * The Compute Recommender Resource Provider Client.
+ */
+package com.azure.resourcemanager.computerecommender;
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/module-info.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/module-info.java
new file mode 100644
index 000000000000..27edc446481d
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/java/module-info.java
@@ -0,0 +1,16 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+module com.azure.resourcemanager.computerecommender {
+ requires transitive com.azure.core.management;
+
+ exports com.azure.resourcemanager.computerecommender;
+ exports com.azure.resourcemanager.computerecommender.fluent;
+ exports com.azure.resourcemanager.computerecommender.fluent.models;
+ exports com.azure.resourcemanager.computerecommender.models;
+
+ opens com.azure.resourcemanager.computerecommender.fluent.models to com.azure.core;
+ opens com.azure.resourcemanager.computerecommender.models to com.azure.core;
+ opens com.azure.resourcemanager.computerecommender.implementation.models to com.azure.core;
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_apiview_properties.json b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_apiview_properties.json
new file mode 100644
index 000000000000..9790322889a2
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_apiview_properties.json
@@ -0,0 +1,25 @@
+{
+ "flavor": "azure",
+ "CrossLanguageDefinitionId": {
+ "com.azure.resourcemanager.computerecommender.fluent.ComputeRecommenderManagementClient": "Microsoft.Compute",
+ "com.azure.resourcemanager.computerecommender.fluent.OperationsClient": "Microsoft.Compute.Operations",
+ "com.azure.resourcemanager.computerecommender.fluent.OperationsClient.list": "Azure.ResourceManager.Operations.list",
+ "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient": "Microsoft.Compute",
+ "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.get": "Microsoft.Compute.ComputeDiagnosticBases.get",
+ "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.getWithResponse": "Microsoft.Compute.ComputeDiagnosticBases.get",
+ "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.post": "Microsoft.Compute.ComputeDiagnosticBases.post",
+ "com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.postWithResponse": "Microsoft.Compute.ComputeDiagnosticBases.post",
+ "com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner": "Microsoft.Compute.ComputeDiagnosticBase",
+ "com.azure.resourcemanager.computerecommender.fluent.models.OperationInner": "Azure.ResourceManager.CommonTypes.Operation",
+ "com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner": "Microsoft.Compute.SpotPlacementScoresResponse",
+ "com.azure.resourcemanager.computerecommender.implementation.ComputeRecommenderManagementClientBuilder": "Microsoft.Compute",
+ "com.azure.resourcemanager.computerecommender.implementation.models.OperationListResult": "Azure.ResourceManager.CommonTypes.OperationListResult",
+ "com.azure.resourcemanager.computerecommender.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
+ "com.azure.resourcemanager.computerecommender.models.DiagnosticProperties": "Microsoft.Compute.DiagnosticProperties",
+ "com.azure.resourcemanager.computerecommender.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
+ "com.azure.resourcemanager.computerecommender.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
+ "com.azure.resourcemanager.computerecommender.models.PlacementScore": "Microsoft.Compute.PlacementScore",
+ "com.azure.resourcemanager.computerecommender.models.ResourceSize": "Microsoft.Compute.ResourceSize",
+ "com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput": "Microsoft.Compute.SpotPlacementScoresInput"
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_metadata.json b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_metadata.json
new file mode 100644
index 000000000000..c1686cc54c12
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/azure-resourcemanager-computerecommender_metadata.json
@@ -0,0 +1 @@
+{"flavor":"azure","apiVersion":"2025-06-05","crossLanguageDefinitions":{"com.azure.resourcemanager.computerecommender.fluent.ComputeRecommenderManagementClient":"Microsoft.Compute","com.azure.resourcemanager.computerecommender.fluent.OperationsClient":"Microsoft.Compute.Operations","com.azure.resourcemanager.computerecommender.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient":"Microsoft.Compute","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.get":"Microsoft.Compute.ComputeDiagnosticBases.get","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.getWithResponse":"Microsoft.Compute.ComputeDiagnosticBases.get","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.post":"Microsoft.Compute.ComputeDiagnosticBases.post","com.azure.resourcemanager.computerecommender.fluent.SpotPlacementScoresClient.postWithResponse":"Microsoft.Compute.ComputeDiagnosticBases.post","com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner":"Microsoft.Compute.ComputeDiagnosticBase","com.azure.resourcemanager.computerecommender.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner":"Microsoft.Compute.SpotPlacementScoresResponse","com.azure.resourcemanager.computerecommender.implementation.ComputeRecommenderManagementClientBuilder":"Microsoft.Compute","com.azure.resourcemanager.computerecommender.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.computerecommender.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.computerecommender.models.DiagnosticProperties":"Microsoft.Compute.DiagnosticProperties","com.azure.resourcemanager.computerecommender.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.computerecommender.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.computerecommender.models.PlacementScore":"Microsoft.Compute.PlacementScore","com.azure.resourcemanager.computerecommender.models.ResourceSize":"Microsoft.Compute.ResourceSize","com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput":"Microsoft.Compute.SpotPlacementScoresInput"}}
\ No newline at end of file
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/proxy-config.json b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/proxy-config.json
new file mode 100644
index 000000000000..c4e71646ce5a
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/proxy-config.json
@@ -0,0 +1 @@
+[["com.azure.resourcemanager.computerecommender.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.computerecommender.implementation.SpotPlacementScoresClientImpl$SpotPlacementScoresService"]]
\ No newline at end of file
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/reflect-config.json b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/reflect-config.json
new file mode 100644
index 000000000000..0637a088a01e
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-computerecommender/reflect-config.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/azure-resourcemanager-computerecommender.properties b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/azure-resourcemanager-computerecommender.properties
new file mode 100644
index 000000000000..defbd48204e4
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/main/resources/azure-resourcemanager-computerecommender.properties
@@ -0,0 +1 @@
+version=${project.version}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/OperationsListSamples.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/OperationsListSamples.java
new file mode 100644
index 000000000000..46b24dc968dc
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/OperationsListSamples.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+/**
+ * Samples for Operations List.
+ */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file: 2025-06-05/Operations_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: Operations_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeRecommenderManager.
+ */
+ public static void
+ operationsListMinimumSetGen(com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) {
+ manager.operations().list(com.azure.core.util.Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: 2025-06-05/Operations_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: Operations_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeRecommenderManager.
+ */
+ public static void
+ operationsListMaximumSetGen(com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) {
+ manager.operations().list(com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetSamples.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetSamples.java
new file mode 100644
index 000000000000..df170db2f582
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+/**
+ * Samples for SpotPlacementScores Get.
+ */
+public final class SpotPlacementScoresGetSamples {
+ /*
+ * x-ms-original-file: 2025-06-05/GetSpotPlacementScores.json
+ */
+ /**
+ * Sample code: Gets the metadata of Spot Placement Scores.
+ *
+ * @param manager Entry point to ComputeRecommenderManager.
+ */
+ public static void getsTheMetadataOfSpotPlacementScores(
+ com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) {
+ manager.spotPlacementScores().getWithResponse("eastus", com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostSamples.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostSamples.java
new file mode 100644
index 000000000000..f62518c4b2d1
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/samples/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.resourcemanager.computerecommender.models.ResourceSize;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput;
+import java.util.Arrays;
+
+/**
+ * Samples for SpotPlacementScores Post.
+ */
+public final class SpotPlacementScoresPostSamples {
+ /*
+ * x-ms-original-file: 2025-06-05/GenerateSpotPlacementScores.json
+ */
+ /**
+ * Sample code: Returns spot VM placement scores for given configurations.
+ *
+ * @param manager Entry point to ComputeRecommenderManager.
+ */
+ public static void returnsSpotVMPlacementScoresForGivenConfigurations(
+ com.azure.resourcemanager.computerecommender.ComputeRecommenderManager manager) {
+ manager.spotPlacementScores()
+ .postWithResponse("eastus",
+ new SpotPlacementScoresInput().withDesiredLocations(Arrays.asList("eastus", "eastus2"))
+ .withDesiredSizes(Arrays.asList(new ResourceSize().withSku("Standard_D2_v2")))
+ .withDesiredCount(1)
+ .withAvailabilityZones(true),
+ com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ComputeDiagnosticBaseInnerTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ComputeDiagnosticBaseInnerTests.java
new file mode 100644
index 000000000000..ee2594ce947d
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ComputeDiagnosticBaseInnerTests.java
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.computerecommender.fluent.models.ComputeDiagnosticBaseInner;
+import org.junit.jupiter.api.Assertions;
+
+public final class ComputeDiagnosticBaseInnerTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ ComputeDiagnosticBaseInner model = BinaryData.fromString(
+ "{\"properties\":{\"supportedResourceTypes\":[\"bpzvgn\",\"zsymglzufcyzkohd\",\"ihanuf\",\"fcbjysagithxqha\"]},\"id\":\"fpikxwczb\",\"name\":\"scnpqxuhivy\",\"type\":\"n\"}")
+ .toObject(ComputeDiagnosticBaseInner.class);
+ Assertions.assertEquals("bpzvgn", model.properties().supportedResourceTypes().get(0));
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/DiagnosticPropertiesTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/DiagnosticPropertiesTests.java
new file mode 100644
index 000000000000..7cf42943ba90
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/DiagnosticPropertiesTests.java
@@ -0,0 +1,18 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.computerecommender.models.DiagnosticProperties;
+import org.junit.jupiter.api.Assertions;
+
+public final class DiagnosticPropertiesTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ DiagnosticProperties model
+ = BinaryData.fromString("{\"supportedResourceTypes\":[\"ybrk\"]}").toObject(DiagnosticProperties.class);
+ Assertions.assertEquals("ybrk", model.supportedResourceTypes().get(0));
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationDisplayTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationDisplayTests.java
new file mode 100644
index 000000000000..c36cf61e7d12
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationDisplayTests.java
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.computerecommender.models.OperationDisplay;
+
+public final class OperationDisplayTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ OperationDisplay model = BinaryData.fromString(
+ "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}")
+ .toObject(OperationDisplay.class);
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationInnerTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationInnerTests.java
new file mode 100644
index 000000000000..17db54d1a770
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationInnerTests.java
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.computerecommender.fluent.models.OperationInner;
+
+public final class OperationInnerTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ OperationInner model = BinaryData.fromString(
+ "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}")
+ .toObject(OperationInner.class);
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationListResultTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationListResultTests.java
new file mode 100644
index 000000000000..a8c8432d8139
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationListResultTests.java
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.computerecommender.implementation.models.OperationListResult;
+import org.junit.jupiter.api.Assertions;
+
+public final class OperationListResultTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ OperationListResult model = BinaryData.fromString(
+ "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}")
+ .toObject(OperationListResult.class);
+ Assertions.assertEquals("kfo", model.nextLink());
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationsListMockTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationsListMockTests.java
new file mode 100644
index 000000000000..1049cf8b3a97
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/OperationsListMockTests.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.models.AzureCloud;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.computerecommender.ComputeRecommenderManager;
+import com.azure.resourcemanager.computerecommender.models.Operation;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class OperationsListMockTests {
+ @Test
+ public void testList() throws Exception {
+ String responseStr
+ = "{\"value\":[{\"name\":\"f\",\"isDataAction\":false,\"display\":{\"provider\":\"zgvfcjrwz\",\"resource\":\"xjtfelluwfzit\",\"operation\":\"peqfpjkjl\",\"description\":\"fpdvhpfxxypi\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}";
+
+ HttpClient httpClient
+ = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8)));
+ ComputeRecommenderManager manager = ComputeRecommenderManager.configure()
+ .withHttpClient(httpClient)
+ .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+ new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD));
+
+ PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE);
+
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/PlacementScoreTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/PlacementScoreTests.java
new file mode 100644
index 000000000000..8c8119a7846e
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/PlacementScoreTests.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.computerecommender.models.PlacementScore;
+import org.junit.jupiter.api.Assertions;
+
+public final class PlacementScoreTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ PlacementScore model = BinaryData.fromString(
+ "{\"sku\":\"hbcryffdfdosyge\",\"region\":\"aojakhmsbzjhcrz\",\"availabilityZone\":\"dphlxaolt\",\"score\":\"trg\",\"isQuotaAvailable\":false}")
+ .toObject(PlacementScore.class);
+ Assertions.assertEquals("hbcryffdfdosyge", model.sku());
+ Assertions.assertEquals("aojakhmsbzjhcrz", model.region());
+ Assertions.assertEquals("dphlxaolt", model.availabilityZone());
+ Assertions.assertEquals("trg", model.score());
+ Assertions.assertFalse(model.isQuotaAvailable());
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ResourceSizeTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ResourceSizeTests.java
new file mode 100644
index 000000000000..326791ecbbf1
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/ResourceSizeTests.java
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.computerecommender.models.ResourceSize;
+import org.junit.jupiter.api.Assertions;
+
+public final class ResourceSizeTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ ResourceSize model = BinaryData.fromString("{\"sku\":\"ahuxinpm\"}").toObject(ResourceSize.class);
+ Assertions.assertEquals("ahuxinpm", model.sku());
+ }
+
+ @org.junit.jupiter.api.Test
+ public void testSerialize() throws Exception {
+ ResourceSize model = new ResourceSize().withSku("ahuxinpm");
+ model = BinaryData.fromObject(model).toObject(ResourceSize.class);
+ Assertions.assertEquals("ahuxinpm", model.sku());
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetWithResponseMockTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetWithResponseMockTests.java
new file mode 100644
index 000000000000..5fb24b273ecd
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresGetWithResponseMockTests.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.models.AzureCloud;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.computerecommender.ComputeRecommenderManager;
+import com.azure.resourcemanager.computerecommender.models.ComputeDiagnosticBase;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class SpotPlacementScoresGetWithResponseMockTests {
+ @Test
+ public void testGetWithResponse() throws Exception {
+ String responseStr
+ = "{\"properties\":{\"supportedResourceTypes\":[\"ginuvamih\",\"ognarxzxtheotus\",\"vyevcciqi\",\"nhungbw\"]},\"id\":\"rnfygxgispem\",\"name\":\"tzfkufubl\",\"type\":\"ofx\"}";
+
+ HttpClient httpClient
+ = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8)));
+ ComputeRecommenderManager manager = ComputeRecommenderManager.configure()
+ .withHttpClient(httpClient)
+ .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+ new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD));
+
+ ComputeDiagnosticBase response
+ = manager.spotPlacementScores().getWithResponse("yhuybbkpod", com.azure.core.util.Context.NONE).getValue();
+
+ Assertions.assertEquals("ginuvamih", response.properties().supportedResourceTypes().get(0));
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresInputTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresInputTests.java
new file mode 100644
index 000000000000..edd5d0005f22
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresInputTests.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.computerecommender.models.ResourceSize;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput;
+import java.util.Arrays;
+import org.junit.jupiter.api.Assertions;
+
+public final class SpotPlacementScoresInputTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ SpotPlacementScoresInput model = BinaryData.fromString(
+ "{\"desiredLocations\":[\"umjgrtfwvuk\",\"gaudcc\",\"nhsjcnyej\"],\"desiredSizes\":[{\"sku\":\"htnapczwlokjyem\"},{\"sku\":\"vnipjox\"},{\"sku\":\"nchgej\"},{\"sku\":\"odmailzyd\"}],\"desiredCount\":52138230,\"availabilityZones\":true}")
+ .toObject(SpotPlacementScoresInput.class);
+ Assertions.assertEquals("umjgrtfwvuk", model.desiredLocations().get(0));
+ Assertions.assertEquals("htnapczwlokjyem", model.desiredSizes().get(0).sku());
+ Assertions.assertEquals(52138230, model.desiredCount());
+ Assertions.assertTrue(model.availabilityZones());
+ }
+
+ @org.junit.jupiter.api.Test
+ public void testSerialize() throws Exception {
+ SpotPlacementScoresInput model
+ = new SpotPlacementScoresInput().withDesiredLocations(Arrays.asList("umjgrtfwvuk", "gaudcc", "nhsjcnyej"))
+ .withDesiredSizes(
+ Arrays.asList(new ResourceSize().withSku("htnapczwlokjyem"), new ResourceSize().withSku("vnipjox"),
+ new ResourceSize().withSku("nchgej"), new ResourceSize().withSku("odmailzyd")))
+ .withDesiredCount(52138230)
+ .withAvailabilityZones(true);
+ model = BinaryData.fromObject(model).toObject(SpotPlacementScoresInput.class);
+ Assertions.assertEquals("umjgrtfwvuk", model.desiredLocations().get(0));
+ Assertions.assertEquals("htnapczwlokjyem", model.desiredSizes().get(0).sku());
+ Assertions.assertEquals(52138230, model.desiredCount());
+ Assertions.assertTrue(model.availabilityZones());
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostWithResponseMockTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostWithResponseMockTests.java
new file mode 100644
index 000000000000..76332f1e75dc
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresPostWithResponseMockTests.java
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.models.AzureCloud;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.computerecommender.ComputeRecommenderManager;
+import com.azure.resourcemanager.computerecommender.models.ResourceSize;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresInput;
+import com.azure.resourcemanager.computerecommender.models.SpotPlacementScoresResponse;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class SpotPlacementScoresPostWithResponseMockTests {
+ @Test
+ public void testPostWithResponse() throws Exception {
+ String responseStr
+ = "{\"desiredLocations\":[\"wrwclxxwrljd\",\"uskcqvkocrcj\",\"kwt\",\"hxbnjbiksqrg\"],\"desiredSizes\":[{\"sku\":\"inqpjwnzll\"},{\"sku\":\"mppeebvmgxs\"},{\"sku\":\"kyqduujit\"}],\"desiredCount\":1447556622,\"availabilityZones\":true,\"placementScores\":[{\"sku\":\"ndhkrw\",\"region\":\"appd\",\"availabilityZone\":\"dkvwrwjfe\",\"score\":\"nhutjeltmrldhugj\",\"isQuotaAvailable\":true},{\"sku\":\"tqxhocdgeab\",\"region\":\"phut\",\"availabilityZone\":\"ndv\",\"score\":\"ozwyiftyhxhuro\",\"isQuotaAvailable\":true}]}";
+
+ HttpClient httpClient
+ = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8)));
+ ComputeRecommenderManager manager = ComputeRecommenderManager.configure()
+ .withHttpClient(httpClient)
+ .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+ new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD));
+
+ SpotPlacementScoresResponse response = manager.spotPlacementScores()
+ .postWithResponse("eofjaeqjh",
+ new SpotPlacementScoresInput().withDesiredLocations(Arrays.asList("asvm"))
+ .withDesiredSizes(Arrays.asList(new ResourceSize().withSku("ulngsntn")))
+ .withDesiredCount(588307069)
+ .withAvailabilityZones(false),
+ com.azure.core.util.Context.NONE)
+ .getValue();
+
+ Assertions.assertEquals("wrwclxxwrljd", response.desiredLocations().get(0));
+ Assertions.assertEquals("inqpjwnzll", response.desiredSizes().get(0).sku());
+ Assertions.assertEquals(1447556622, response.desiredCount());
+ Assertions.assertTrue(response.availabilityZones());
+ Assertions.assertEquals("ndhkrw", response.placementScores().get(0).sku());
+ Assertions.assertEquals("appd", response.placementScores().get(0).region());
+ Assertions.assertEquals("dkvwrwjfe", response.placementScores().get(0).availabilityZone());
+ Assertions.assertEquals("nhutjeltmrldhugj", response.placementScores().get(0).score());
+ Assertions.assertTrue(response.placementScores().get(0).isQuotaAvailable());
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresResponseInnerTests.java b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresResponseInnerTests.java
new file mode 100644
index 000000000000..a854d0452bfe
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/src/test/java/com/azure/resourcemanager/computerecommender/generated/SpotPlacementScoresResponseInnerTests.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.computerecommender.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.computerecommender.fluent.models.SpotPlacementScoresResponseInner;
+import org.junit.jupiter.api.Assertions;
+
+public final class SpotPlacementScoresResponseInnerTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ SpotPlacementScoresResponseInner model = BinaryData.fromString(
+ "{\"desiredLocations\":[\"aqwi\",\"jsprozvcpute\",\"jvwmfda\"],\"desiredSizes\":[{\"sku\":\"dvpjhulsuuvmk\"}],\"desiredCount\":1523765181,\"availabilityZones\":false,\"placementScores\":[{\"sku\":\"dio\",\"region\":\"pslwejdpvw\",\"availabilityZone\":\"oqpsoa\",\"score\":\"tazak\",\"isQuotaAvailable\":true}]}")
+ .toObject(SpotPlacementScoresResponseInner.class);
+ Assertions.assertEquals("aqwi", model.desiredLocations().get(0));
+ Assertions.assertEquals("dvpjhulsuuvmk", model.desiredSizes().get(0).sku());
+ Assertions.assertEquals(1523765181, model.desiredCount());
+ Assertions.assertFalse(model.availabilityZones());
+ Assertions.assertEquals("dio", model.placementScores().get(0).sku());
+ Assertions.assertEquals("pslwejdpvw", model.placementScores().get(0).region());
+ Assertions.assertEquals("oqpsoa", model.placementScores().get(0).availabilityZone());
+ Assertions.assertEquals("tazak", model.placementScores().get(0).score());
+ Assertions.assertTrue(model.placementScores().get(0).isQuotaAvailable());
+ }
+}
diff --git a/sdk/computerecommender/azure-resourcemanager-computerecommender/tsp-location.yaml b/sdk/computerecommender/azure-resourcemanager-computerecommender/tsp-location.yaml
new file mode 100644
index 000000000000..35205566bf6f
--- /dev/null
+++ b/sdk/computerecommender/azure-resourcemanager-computerecommender/tsp-location.yaml
@@ -0,0 +1,4 @@
+directory: specification/compute/resource-manager/Microsoft.Compute/RecommenderRP
+commit: 4bf96d0b0334d1f2e95205ca8f0d7495f7db2f0f
+repo: Azure/azure-rest-api-specs
+additionalDirectories:
diff --git a/sdk/computerecommender/ci.yml b/sdk/computerecommender/ci.yml
new file mode 100644
index 000000000000..2933b4c50820
--- /dev/null
+++ b/sdk/computerecommender/ci.yml
@@ -0,0 +1,46 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+
+trigger:
+ branches:
+ include:
+ - main
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/computerecommender/ci.yml
+ - sdk/computerecommender/azure-resourcemanager-computerecommender/
+ exclude:
+ - sdk/computerecommender/pom.xml
+ - sdk/computerecommender/azure-resourcemanager-computerecommender/pom.xml
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/computerecommender/ci.yml
+ - sdk/computerecommender/azure-resourcemanager-computerecommender/
+ exclude:
+ - sdk/computerecommender/pom.xml
+ - sdk/computerecommender/azure-resourcemanager-computerecommender/pom.xml
+
+parameters:
+ - name: release_azureresourcemanagercomputerecommender
+ displayName: azure-resourcemanager-computerecommender
+ type: boolean
+ default: false
+
+extends:
+ template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
+ parameters:
+ ServiceDirectory: computerecommender
+ Artifacts:
+ - name: azure-resourcemanager-computerecommender
+ groupId: com.azure.resourcemanager
+ safeName: azureresourcemanagercomputerecommender
+ releaseInBatch: ${{ parameters.release_azureresourcemanagercomputerecommender }}
diff --git a/sdk/computerecommender/pom.xml b/sdk/computerecommender/pom.xml
new file mode 100644
index 000000000000..5c3ef6a5d882
--- /dev/null
+++ b/sdk/computerecommender/pom.xml
@@ -0,0 +1,15 @@
+
+
+ 4.0.0
+ com.azure
+ azure-computerecommender-service
+ pom
+ 1.0.0
+
+
+ azure-resourcemanager-computerecommender
+
+