net.bytebuddy
byte-buddy
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/AdvisorManager.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/AdvisorManager.java
index 154be7aa65e5..0a2a6bd391fd 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/AdvisorManager.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/AdvisorManager.java
@@ -25,15 +25,19 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.advisor.fluent.AdvisorManagementClient;
import com.azure.resourcemanager.advisor.implementation.AdvisorManagementClientBuilder;
+import com.azure.resourcemanager.advisor.implementation.AdvisorScoresImpl;
import com.azure.resourcemanager.advisor.implementation.ConfigurationsImpl;
import com.azure.resourcemanager.advisor.implementation.OperationsImpl;
import com.azure.resourcemanager.advisor.implementation.RecommendationMetadatasImpl;
import com.azure.resourcemanager.advisor.implementation.RecommendationsImpl;
+import com.azure.resourcemanager.advisor.implementation.ResourceProvidersImpl;
import com.azure.resourcemanager.advisor.implementation.SuppressionsImpl;
+import com.azure.resourcemanager.advisor.models.AdvisorScores;
import com.azure.resourcemanager.advisor.models.Configurations;
import com.azure.resourcemanager.advisor.models.Operations;
import com.azure.resourcemanager.advisor.models.RecommendationMetadatas;
import com.azure.resourcemanager.advisor.models.Recommendations;
+import com.azure.resourcemanager.advisor.models.ResourceProviders;
import com.azure.resourcemanager.advisor.models.Suppressions;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
@@ -42,7 +46,10 @@
import java.util.Objects;
import java.util.stream.Collectors;
-/** Entry point to AdvisorManager. REST APIs for Azure Advisor. */
+/**
+ * Entry point to AdvisorManager.
+ * REST APIs for Azure Advisor.
+ */
public final class AdvisorManager {
private RecommendationMetadatas recommendationMetadatas;
@@ -54,23 +61,25 @@ public final class AdvisorManager {
private Suppressions suppressions;
+ private ResourceProviders resourceProviders;
+
+ private AdvisorScores advisorScores;
+
private final AdvisorManagementClient clientObject;
private AdvisorManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
- this.clientObject =
- new AdvisorManagementClientBuilder()
- .pipeline(httpPipeline)
- .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
- .subscriptionId(profile.getSubscriptionId())
- .defaultPollInterval(defaultPollInterval)
- .buildClient();
+ this.clientObject = new AdvisorManagementClientBuilder().pipeline(httpPipeline)
+ .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
+ .subscriptionId(profile.getSubscriptionId())
+ .defaultPollInterval(defaultPollInterval)
+ .buildClient();
}
/**
* Creates an instance of Advisor service API entry point.
- *
+ *
* @param credential the credential to use.
* @param profile the Azure profile for client.
* @return the Advisor service API instance.
@@ -83,7 +92,7 @@ public static AdvisorManager authenticate(TokenCredential credential, AzureProfi
/**
* Creates an instance of Advisor service API entry point.
- *
+ *
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the Advisor service API instance.
@@ -96,14 +105,16 @@ public static AdvisorManager authenticate(HttpPipeline httpPipeline, AzureProfil
/**
* Gets a Configurable instance that can be used to create AdvisorManager with optional configuration.
- *
+ *
* @return the Configurable instance allowing configurations.
*/
public static Configurable configure() {
return new AdvisorManager.Configurable();
}
- /** The Configurable allowing configurations to be set. */
+ /**
+ * The Configurable allowing configurations to be set.
+ */
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
@@ -175,8 +186,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
/**
* Sets the retry options for the HTTP pipeline retry policy.
- *
- * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * 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.
@@ -193,8 +204,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) {
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
- this.defaultPollInterval =
- Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
+ this.defaultPollInterval
+ = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
@@ -214,15 +225,13 @@ public AdvisorManager authenticate(TokenCredential credential, AzureProfile prof
Objects.requireNonNull(profile, "'profile' cannot be null.");
StringBuilder userAgentBuilder = new StringBuilder();
- userAgentBuilder
- .append("azsdk-java")
+ userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.advisor")
.append("/")
- .append("1.0.0-beta.2");
+ .append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
- userAgentBuilder
- .append(" (")
+ userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
.append("; ")
.append(Configuration.getGlobalConfiguration().get("os.name"))
@@ -247,51 +256,41 @@ public AdvisorManager authenticate(TokenCredential credential, AzureProfile prof
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()));
+ policies.addAll(this.policies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
- policies
- .addAll(
- this
- .policies
- .stream()
- .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
- .collect(Collectors.toList()));
+ 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();
+ HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
return new AdvisorManager(httpPipeline, profile, defaultPollInterval);
}
}
/**
* Gets the resource collection API of RecommendationMetadatas.
- *
+ *
* @return Resource collection API of RecommendationMetadatas.
*/
public RecommendationMetadatas recommendationMetadatas() {
if (this.recommendationMetadatas == null) {
- this.recommendationMetadatas =
- new RecommendationMetadatasImpl(clientObject.getRecommendationMetadatas(), this);
+ this.recommendationMetadatas
+ = new RecommendationMetadatasImpl(clientObject.getRecommendationMetadatas(), this);
}
return recommendationMetadatas;
}
/**
* Gets the resource collection API of Configurations. It manages ConfigData.
- *
+ *
* @return Resource collection API of Configurations.
*/
public Configurations configurations() {
@@ -303,7 +302,7 @@ public Configurations configurations() {
/**
* Gets the resource collection API of Recommendations.
- *
+ *
* @return Resource collection API of Recommendations.
*/
public Recommendations recommendations() {
@@ -315,7 +314,7 @@ public Recommendations recommendations() {
/**
* Gets the resource collection API of Operations.
- *
+ *
* @return Resource collection API of Operations.
*/
public Operations operations() {
@@ -327,7 +326,7 @@ public Operations operations() {
/**
* Gets the resource collection API of Suppressions. It manages SuppressionContract.
- *
+ *
* @return Resource collection API of Suppressions.
*/
public Suppressions suppressions() {
@@ -338,8 +337,34 @@ public Suppressions suppressions() {
}
/**
- * @return Wrapped service client AdvisorManagementClient providing direct access to the underlying auto-generated
- * API implementation, based on Azure REST API.
+ * Gets the resource collection API of ResourceProviders.
+ *
+ * @return Resource collection API of ResourceProviders.
+ */
+ public ResourceProviders resourceProviders() {
+ if (this.resourceProviders == null) {
+ this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this);
+ }
+ return resourceProviders;
+ }
+
+ /**
+ * Gets the resource collection API of AdvisorScores.
+ *
+ * @return Resource collection API of AdvisorScores.
+ */
+ public AdvisorScores advisorScores() {
+ if (this.advisorScores == null) {
+ this.advisorScores = new AdvisorScoresImpl(clientObject.getAdvisorScores(), this);
+ }
+ return advisorScores;
+ }
+
+ /**
+ * Gets wrapped service client AdvisorManagementClient providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client AdvisorManagementClient.
*/
public AdvisorManagementClient serviceClient() {
return this.clientObject;
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/AdvisorManagementClient.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/AdvisorManagementClient.java
index 247423ce021c..0afd38ac26bf 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/AdvisorManagementClient.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/AdvisorManagementClient.java
@@ -7,75 +7,91 @@
import com.azure.core.http.HttpPipeline;
import java.time.Duration;
-/** The interface for AdvisorManagementClient class. */
+/**
+ * The interface for AdvisorManagementClient class.
+ */
public interface AdvisorManagementClient {
/**
* Gets The Azure subscription ID.
- *
+ *
* @return the subscriptionId value.
*/
String getSubscriptionId();
/**
* Gets server parameter.
- *
+ *
* @return the endpoint value.
*/
String getEndpoint();
/**
* Gets Api Version.
- *
+ *
* @return the apiVersion value.
*/
String getApiVersion();
/**
* Gets The HTTP pipeline to send requests through.
- *
+ *
* @return the httpPipeline value.
*/
HttpPipeline getHttpPipeline();
/**
* Gets The default poll interval for long-running operation.
- *
+ *
* @return the defaultPollInterval value.
*/
Duration getDefaultPollInterval();
/**
* Gets the RecommendationMetadatasClient object to access its operations.
- *
+ *
* @return the RecommendationMetadatasClient object.
*/
RecommendationMetadatasClient getRecommendationMetadatas();
/**
* Gets the ConfigurationsClient object to access its operations.
- *
+ *
* @return the ConfigurationsClient object.
*/
ConfigurationsClient getConfigurations();
/**
* Gets the RecommendationsClient object to access its operations.
- *
+ *
* @return the RecommendationsClient object.
*/
RecommendationsClient getRecommendations();
/**
* Gets the OperationsClient object to access its operations.
- *
+ *
* @return the OperationsClient object.
*/
OperationsClient getOperations();
/**
* Gets the SuppressionsClient object to access its operations.
- *
+ *
* @return the SuppressionsClient object.
*/
SuppressionsClient getSuppressions();
+
+ /**
+ * Gets the ResourceProvidersClient object to access its operations.
+ *
+ * @return the ResourceProvidersClient object.
+ */
+ ResourceProvidersClient getResourceProviders();
+
+ /**
+ * Gets the AdvisorScoresClient object to access its operations.
+ *
+ * @return the AdvisorScoresClient object.
+ */
+ AdvisorScoresClient getAdvisorScores();
}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/AdvisorScoresClient.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/AdvisorScoresClient.java
new file mode 100644
index 000000000000..792a6f27854a
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/AdvisorScoresClient.java
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.advisor.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.advisor.fluent.models.AdvisorScoreEntityInner;
+import com.azure.resourcemanager.advisor.fluent.models.AdvisorScoreResponseInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in AdvisorScoresClient.
+ */
+public interface AdvisorScoresClient {
+ /**
+ * Gets the list of advisor scores.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of advisor scores along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listWithResponse(Context context);
+
+ /**
+ * Gets the list of advisor scores.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of advisor scores.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AdvisorScoreResponseInner list();
+
+ /**
+ * Gets the advisor score.
+ *
+ * @param name The scope of Advisor score entity.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the advisor score along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String name, Context context);
+
+ /**
+ * Gets the advisor score.
+ *
+ * @param name The scope of Advisor score entity.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the advisor score.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AdvisorScoreEntityInner get(String name);
+}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/ConfigurationsClient.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/ConfigurationsClient.java
index da4558e53845..0411e662bbaa 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/ConfigurationsClient.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/ConfigurationsClient.java
@@ -12,13 +12,15 @@
import com.azure.resourcemanager.advisor.fluent.models.ConfigDataInner;
import com.azure.resourcemanager.advisor.models.ConfigurationName;
-/** An instance of this class provides access to all the operations defined in ConfigurationsClient. */
+/**
+ * An instance of this class provides access to all the operations defined in ConfigurationsClient.
+ */
public interface ConfigurationsClient {
/**
* Retrieve Azure Advisor configurations.
- *
- * Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
- *
+ *
+ * Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
+ *
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of Advisor configurations as paginated response with {@link PagedIterable}.
@@ -28,9 +30,9 @@ public interface ConfigurationsClient {
/**
* Retrieve Azure Advisor configurations.
- *
- *
Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
- *
+ *
+ * Retrieve Azure Advisor configurations and also retrieve configurations of contained resource groups.
+ *
* @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.
@@ -42,9 +44,9 @@ public interface ConfigurationsClient {
/**
* Create/Overwrite Azure Advisor configuration.
- *
- *
Create/Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
- *
+ *
+ * Create/Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
+ *
* @param configurationName Advisor configuration name. Value must be 'default'.
* @param configContract The Azure Advisor configuration data structure.
* @param context The context to associate with this operation.
@@ -54,14 +56,14 @@ public interface ConfigurationsClient {
* @return the Advisor configuration data structure along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response createInSubscriptionWithResponse(
- ConfigurationName configurationName, ConfigDataInner configContract, Context context);
+ Response createInSubscriptionWithResponse(ConfigurationName configurationName,
+ ConfigDataInner configContract, Context context);
/**
* Create/Overwrite Azure Advisor configuration.
- *
- * Create/Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
- *
+ *
+ * Create/Overwrite Azure Advisor configuration and also delete all configurations of contained resource groups.
+ *
* @param configurationName Advisor configuration name. Value must be 'default'.
* @param configContract The Azure Advisor configuration data structure.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -74,7 +76,7 @@ Response createInSubscriptionWithResponse(
/**
* Retrieve Azure Advisor configurations.
- *
+ *
* @param resourceGroup The name of the Azure resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -86,7 +88,7 @@ Response createInSubscriptionWithResponse(
/**
* Retrieve Azure Advisor configurations.
- *
+ *
* @param resourceGroup The name of the Azure resource group.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -99,7 +101,7 @@ Response createInSubscriptionWithResponse(
/**
* Create/Overwrite Azure Advisor configuration.
- *
+ *
* @param configurationName Advisor configuration name. Value must be 'default'.
* @param resourceGroup The name of the Azure resource group.
* @param configContract The Azure Advisor configuration data structure.
@@ -110,12 +112,12 @@ Response createInSubscriptionWithResponse(
* @return the Advisor configuration data structure along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response createInResourceGroupWithResponse(
- ConfigurationName configurationName, String resourceGroup, ConfigDataInner configContract, Context context);
+ Response createInResourceGroupWithResponse(ConfigurationName configurationName,
+ String resourceGroup, ConfigDataInner configContract, Context context);
/**
* Create/Overwrite Azure Advisor configuration.
- *
+ *
* @param configurationName Advisor configuration name. Value must be 'default'.
* @param resourceGroup The name of the Azure resource group.
* @param configContract The Azure Advisor configuration data structure.
@@ -125,6 +127,6 @@ Response createInResourceGroupWithResponse(
* @return the Advisor configuration data structure.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- ConfigDataInner createInResourceGroup(
- ConfigurationName configurationName, String resourceGroup, ConfigDataInner configContract);
+ ConfigDataInner createInResourceGroup(ConfigurationName configurationName, String resourceGroup,
+ ConfigDataInner configContract);
}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/OperationsClient.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/OperationsClient.java
index 207a500de026..ba316720abe0 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/OperationsClient.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/OperationsClient.java
@@ -10,11 +10,13 @@
import com.azure.core.util.Context;
import com.azure.resourcemanager.advisor.fluent.models.OperationEntityInner;
-/** An instance of this class provides access to all the operations defined in OperationsClient. */
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
public interface OperationsClient {
/**
* Lists all the available Advisor REST API operations.
- *
+ *
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of Advisor operations as paginated response with {@link PagedIterable}.
@@ -24,7 +26,7 @@ public interface OperationsClient {
/**
* Lists all the available Advisor REST API operations.
- *
+ *
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/RecommendationMetadatasClient.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/RecommendationMetadatasClient.java
index 4a3d8846bb0e..f2e50ab0c401 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/RecommendationMetadatasClient.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/RecommendationMetadatasClient.java
@@ -11,15 +11,19 @@
import com.azure.core.util.Context;
import com.azure.resourcemanager.advisor.fluent.models.MetadataEntityInner;
-/** An instance of this class provides access to all the operations defined in RecommendationMetadatasClient. */
+/**
+ * An instance of this class provides access to all the operations defined in RecommendationMetadatasClient.
+ */
public interface RecommendationMetadatasClient {
/**
* Gets the metadata entity.
- *
+ *
* @param name Name of metadata entity.
* @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
+ * status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the metadata entity along with {@link Response}.
*/
@@ -28,10 +32,12 @@ public interface RecommendationMetadatasClient {
/**
* Gets the metadata entity.
- *
+ *
* @param name Name of metadata entity.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
+ * status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the metadata entity.
*/
@@ -40,7 +46,7 @@ public interface RecommendationMetadatasClient {
/**
* Gets the list of metadata entities.
- *
+ *
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of metadata entities as paginated response with {@link PagedIterable}.
@@ -50,7 +56,7 @@ public interface RecommendationMetadatasClient {
/**
* Gets the list of metadata entities.
- *
+ *
* @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.
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/RecommendationsClient.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/RecommendationsClient.java
index b3867c15a0da..67f03eb0353d 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/RecommendationsClient.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/RecommendationsClient.java
@@ -13,12 +13,14 @@
import com.azure.resourcemanager.advisor.models.RecommendationsGenerateResponse;
import java.util.UUID;
-/** An instance of this class provides access to all the operations defined in RecommendationsClient. */
+/**
+ * An instance of this class provides access to all the operations defined in RecommendationsClient.
+ */
public interface RecommendationsClient {
/**
* Initiates the recommendation generation or computation process for a subscription. This operation is
* asynchronous. The generated recommendations are stored in a cache in the Advisor service.
- *
+ *
* @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.
@@ -31,7 +33,7 @@ public interface RecommendationsClient {
/**
* Initiates the recommendation generation or computation process for a subscription. This operation is
* asynchronous. The generated recommendations are stored in a cache in the Advisor service.
- *
+ *
* @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.
*/
@@ -41,9 +43,9 @@ public interface RecommendationsClient {
/**
* Retrieves the status of the recommendation computation or generation process. Invoke this API after calling the
* generation recommendation. The URI of this API is returned in the Location field of the response header.
- *
+ *
* @param operationId The operation ID, which can be found from the Location field in the generate recommendation
- * response header.
+ * response header.
* @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.
@@ -56,9 +58,9 @@ public interface RecommendationsClient {
/**
* Retrieves the status of the recommendation computation or generation process. Invoke this API after calling the
* generation recommendation. The URI of this API is returned in the Location field of the response header.
- *
+ *
* @param operationId The operation ID, which can be found from the Location field in the generate recommendation
- * response header.
+ * response header.
* @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.
@@ -69,7 +71,7 @@ public interface RecommendationsClient {
/**
* Obtains cached recommendations for a subscription. The recommendations are generated or computed by invoking
* generateRecommendations.
- *
+ *
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of Advisor recommendations as paginated response with {@link PagedIterable}.
@@ -80,10 +82,10 @@ public interface RecommendationsClient {
/**
* Obtains cached recommendations for a subscription. The recommendations are generated or computed by invoking
* generateRecommendations.
- *
+ *
* @param filter The filter to apply to the recommendations.<br>Filter can be applied to properties
- * ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', '[Category](#category)'] with operators ['eq',
- * 'and', 'or'].<br>Example:<br>- $filter=Category eq 'Cost' and ResourceGroup eq 'MyResourceGroup'.
+ * ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', '[Category](#category)'] with operators ['eq', 'and',
+ * 'or'].<br>Example:<br>- $filter=Category eq 'Cost' and ResourceGroup eq 'MyResourceGroup'.
* @param top The number of recommendations per page if a paged version of this API is being used.
* @param skipToken The page-continuation token to use with a paged version of this API.
* @param context The context to associate with this operation.
@@ -97,9 +99,9 @@ public interface RecommendationsClient {
/**
* Obtains details of a cached recommendation.
- *
+ *
* @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which the
- * recommendation applies.
+ * recommendation applies.
* @param recommendationId The recommendation ID.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -108,14 +110,14 @@ public interface RecommendationsClient {
* @return advisor Recommendation along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response getWithResponse(
- String resourceUri, String recommendationId, Context context);
+ Response getWithResponse(String resourceUri, String recommendationId,
+ Context context);
/**
* Obtains details of a cached recommendation.
- *
+ *
* @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which the
- * recommendation applies.
+ * recommendation applies.
* @param recommendationId The recommendation ID.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/ResourceProvidersClient.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/ResourceProvidersClient.java
new file mode 100644
index 000000000000..6db2a5723817
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/ResourceProvidersClient.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.advisor.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.advisor.fluent.models.PredictionResponseInner;
+import com.azure.resourcemanager.advisor.models.PredictionRequest;
+
+/**
+ * An instance of this class provides access to all the operations defined in ResourceProvidersClient.
+ */
+public interface ResourceProvidersClient {
+ /**
+ * Predicts a recommendation.
+ *
+ * @param predictionRequest Parameters for predict recommendation.
+ * @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 response used by predictions along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response predictWithResponse(PredictionRequest predictionRequest, Context context);
+
+ /**
+ * Predicts a recommendation.
+ *
+ * @param predictionRequest Parameters for predict recommendation.
+ * @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 response used by predictions.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PredictionResponseInner predict(PredictionRequest predictionRequest);
+}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/SuppressionsClient.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/SuppressionsClient.java
index 8bf20b370fb7..697364534b8a 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/SuppressionsClient.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/SuppressionsClient.java
@@ -11,38 +11,44 @@
import com.azure.core.util.Context;
import com.azure.resourcemanager.advisor.fluent.models.SuppressionContractInner;
-/** An instance of this class provides access to all the operations defined in SuppressionsClient. */
+/**
+ * An instance of this class provides access to all the operations defined in SuppressionsClient.
+ */
public interface SuppressionsClient {
/**
* Obtains the details of a suppression.
- *
+ *
* @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which the
- * recommendation applies.
+ * recommendation applies.
* @param recommendationId The recommendation ID.
* @param name The name of the suppression.
* @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
+ * status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with
- * the rule along with {@link Response}.
+ * the rule along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response getWithResponse(
- String resourceUri, String recommendationId, String name, Context context);
+ Response getWithResponse(String resourceUri, String recommendationId, String name,
+ Context context);
/**
* Obtains the details of a suppression.
- *
+ *
* @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which the
- * recommendation applies.
+ * recommendation applies.
* @param recommendationId The recommendation ID.
* @param name The name of the suppression.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
+ * status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with
- * the rule.
+ * the rule.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
SuppressionContractInner get(String resourceUri, String recommendationId, String name);
@@ -50,52 +56,52 @@ Response getWithResponse(
/**
* Enables the snoozed or dismissed attribute of a recommendation. The snoozed or dismissed attribute is referred to
* as a suppression. Use this API to create or update the snoozed or dismissed status of a recommendation.
- *
+ *
* @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which the
- * recommendation applies.
+ * recommendation applies.
* @param recommendationId The recommendation ID.
* @param name The name of the suppression.
* @param suppressionContract The snoozed or dismissed attribute; for example, the snooze duration.
* @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
+ * status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with
- * the rule along with {@link Response}.
+ * the rule along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- Response createWithResponse(
- String resourceUri,
- String recommendationId,
- String name,
- SuppressionContractInner suppressionContract,
- Context context);
+ Response createWithResponse(String resourceUri, String recommendationId, String name,
+ SuppressionContractInner suppressionContract, Context context);
/**
* Enables the snoozed or dismissed attribute of a recommendation. The snoozed or dismissed attribute is referred to
* as a suppression. Use this API to create or update the snoozed or dismissed status of a recommendation.
- *
+ *
* @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which the
- * recommendation applies.
+ * recommendation applies.
* @param recommendationId The recommendation ID.
* @param name The name of the suppression.
* @param suppressionContract The snoozed or dismissed attribute; for example, the snooze duration.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on
+ * status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with
- * the rule.
+ * the rule.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- SuppressionContractInner create(
- String resourceUri, String recommendationId, String name, SuppressionContractInner suppressionContract);
+ SuppressionContractInner create(String resourceUri, String recommendationId, String name,
+ SuppressionContractInner suppressionContract);
/**
* Enables the activation of a snoozed or dismissed recommendation. The snoozed or dismissed attribute of a
* recommendation is referred to as a suppression.
- *
+ *
* @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which the
- * recommendation applies.
+ * recommendation applies.
* @param recommendationId The recommendation ID.
* @param name The name of the suppression.
* @param context The context to associate with this operation.
@@ -110,9 +116,9 @@ SuppressionContractInner create(
/**
* Enables the activation of a snoozed or dismissed recommendation. The snoozed or dismissed attribute of a
* recommendation is referred to as a suppression.
- *
+ *
* @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to which the
- * recommendation applies.
+ * recommendation applies.
* @param recommendationId The recommendation ID.
* @param name The name of the suppression.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -125,7 +131,7 @@ SuppressionContractInner create(
/**
* Retrieves the list of snoozed or dismissed suppressions for a subscription. The snoozed or dismissed attribute of
* a recommendation is referred to as a suppression.
- *
+ *
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of Advisor suppressions as paginated response with {@link PagedIterable}.
@@ -136,7 +142,7 @@ SuppressionContractInner create(
/**
* Retrieves the list of snoozed or dismissed suppressions for a subscription. The snoozed or dismissed attribute of
* a recommendation is referred to as a suppression.
- *
+ *
* @param top The number of suppressions per page if a paged version of this API is being used.
* @param skipToken The page-continuation token to use with a paged version of this API.
* @param context The context to associate with this operation.
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/AdvisorScoreEntityInner.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/AdvisorScoreEntityInner.java
new file mode 100644
index 000000000000..bec5a787f319
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/AdvisorScoreEntityInner.java
@@ -0,0 +1,166 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.advisor.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.advisor.models.AdvisorScoreEntityProperties;
+import java.io.IOException;
+
+/**
+ * The details of Advisor score for a single category.
+ */
+@Fluent
+public final class AdvisorScoreEntityInner extends ProxyResource {
+ /*
+ * The Advisor score data.
+ */
+ private AdvisorScoreEntityProperties 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 AdvisorScoreEntityInner class.
+ */
+ public AdvisorScoreEntityInner() {
+ }
+
+ /**
+ * Get the properties property: The Advisor score data.
+ *
+ * @return the properties value.
+ */
+ public AdvisorScoreEntityProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The Advisor score data.
+ *
+ * @param properties the properties value to set.
+ * @return the AdvisorScoreEntityInner object itself.
+ */
+ public AdvisorScoreEntityInner withProperties(AdvisorScoreEntityProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @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 AdvisorScoreEntityInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AdvisorScoreEntityInner 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 AdvisorScoreEntityInner.
+ */
+ public static AdvisorScoreEntityInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AdvisorScoreEntityInner deserializedAdvisorScoreEntityInner = new AdvisorScoreEntityInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedAdvisorScoreEntityInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedAdvisorScoreEntityInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedAdvisorScoreEntityInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedAdvisorScoreEntityInner.properties = AdvisorScoreEntityProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedAdvisorScoreEntityInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAdvisorScoreEntityInner;
+ });
+ }
+}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/AdvisorScoreResponseInner.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/AdvisorScoreResponseInner.java
new file mode 100644
index 000000000000..c00b56e2ed48
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/AdvisorScoreResponseInner.java
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.advisor.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * The AdvisorScoreResponse model.
+ */
+@Fluent
+public final class AdvisorScoreResponseInner implements JsonSerializable {
+ /*
+ * The list of operations.
+ */
+ private List value;
+
+ /**
+ * Creates an instance of AdvisorScoreResponseInner class.
+ */
+ public AdvisorScoreResponseInner() {
+ }
+
+ /**
+ * Get the value property: The list of operations.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: The list of operations.
+ *
+ * @param value the value value to set.
+ * @return the AdvisorScoreResponseInner object itself.
+ */
+ public AdvisorScoreResponseInner withValue(List value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (value() != null) {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AdvisorScoreResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AdvisorScoreResponseInner 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 AdvisorScoreResponseInner.
+ */
+ public static AdvisorScoreResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AdvisorScoreResponseInner deserializedAdvisorScoreResponseInner = new AdvisorScoreResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value
+ = reader.readArray(reader1 -> AdvisorScoreEntityInner.fromJson(reader1));
+ deserializedAdvisorScoreResponseInner.value = value;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAdvisorScoreResponseInner;
+ });
+ }
+}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataInner.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataInner.java
index 3f877b5e763e..981d910fbbaf 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataInner.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataInner.java
@@ -6,36 +6,103 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.advisor.models.CpuThreshold;
import com.azure.resourcemanager.advisor.models.DigestConfig;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.resourcemanager.advisor.models.DurationModel;
+import java.io.IOException;
import java.util.List;
-/** The Advisor configuration data structure. */
+/**
+ * The Advisor configuration data structure.
+ */
@Fluent
public final class ConfigDataInner extends ProxyResource {
/*
* The Advisor configuration data structure.
*/
- @JsonProperty(value = "properties")
private ConfigDataProperties innerProperties;
- /** Creates an instance of ConfigDataInner class. */
+ /*
+ * 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 ConfigDataInner class.
+ */
public ConfigDataInner() {
}
/**
* Get the innerProperties property: The Advisor configuration data structure.
- *
+ *
* @return the innerProperties value.
*/
private ConfigDataProperties innerProperties() {
return this.innerProperties;
}
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @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;
+ }
+
/**
* Get the exclude property: Exclude the resource from Advisor evaluations. Valid values: False (default) or True.
- *
+ *
* @return the exclude value.
*/
public Boolean exclude() {
@@ -44,7 +111,7 @@ public Boolean exclude() {
/**
* Set the exclude property: Exclude the resource from Advisor evaluations. Valid values: False (default) or True.
- *
+ *
* @param exclude the exclude value to set.
* @return the ConfigDataInner object itself.
*/
@@ -59,7 +126,7 @@ public ConfigDataInner withExclude(Boolean exclude) {
/**
* Get the lowCpuThreshold property: Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid
* only for subscriptions. Valid values: 5 (default), 10, 15 or 20.
- *
+ *
* @return the lowCpuThreshold value.
*/
public CpuThreshold lowCpuThreshold() {
@@ -69,7 +136,7 @@ public CpuThreshold lowCpuThreshold() {
/**
* Set the lowCpuThreshold property: Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid
* only for subscriptions. Valid values: 5 (default), 10, 15 or 20.
- *
+ *
* @param lowCpuThreshold the lowCpuThreshold value to set.
* @return the ConfigDataInner object itself.
*/
@@ -81,9 +148,34 @@ public ConfigDataInner withLowCpuThreshold(CpuThreshold lowCpuThreshold) {
return this;
}
+ /**
+ * Get the duration property: Minimum duration for Advisor low CPU utilization evaluation. Valid only for
+ * subscriptions. Valid values: 7 (default), 14, 21, 30, 60 or 90.
+ *
+ * @return the duration value.
+ */
+ public DurationModel duration() {
+ return this.innerProperties() == null ? null : this.innerProperties().duration();
+ }
+
+ /**
+ * Set the duration property: Minimum duration for Advisor low CPU utilization evaluation. Valid only for
+ * subscriptions. Valid values: 7 (default), 14, 21, 30, 60 or 90.
+ *
+ * @param duration the duration value to set.
+ * @return the ConfigDataInner object itself.
+ */
+ public ConfigDataInner withDuration(DurationModel duration) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ConfigDataProperties();
+ }
+ this.innerProperties().withDuration(duration);
+ return this;
+ }
+
/**
* Get the digests property: Advisor digest configuration. Valid only for subscriptions.
- *
+ *
* @return the digests value.
*/
public List digests() {
@@ -92,7 +184,7 @@ public List digests() {
/**
* Set the digests property: Advisor digest configuration. Valid only for subscriptions.
- *
+ *
* @param digests the digests value to set.
* @return the ConfigDataInner object itself.
*/
@@ -106,7 +198,7 @@ public ConfigDataInner withDigests(List digests) {
/**
* Validates the instance.
- *
+ *
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
@@ -114,4 +206,49 @@ public void validate() {
innerProperties().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ConfigDataInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ConfigDataInner 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 ConfigDataInner.
+ */
+ public static ConfigDataInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ConfigDataInner deserializedConfigDataInner = new ConfigDataInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedConfigDataInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedConfigDataInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedConfigDataInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedConfigDataInner.innerProperties = ConfigDataProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedConfigDataInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedConfigDataInner;
+ });
+ }
}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataProperties.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataProperties.java
index e2d8a76caac5..7212275dfb5e 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataProperties.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataProperties.java
@@ -5,40 +5,52 @@
package com.azure.resourcemanager.advisor.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.advisor.models.CpuThreshold;
import com.azure.resourcemanager.advisor.models.DigestConfig;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.azure.resourcemanager.advisor.models.DurationModel;
+import java.io.IOException;
import java.util.List;
-/** Configuration data properties. */
+/**
+ * Configuration data properties.
+ */
@Fluent
-public final class ConfigDataProperties {
+public final class ConfigDataProperties implements JsonSerializable {
/*
* Exclude the resource from Advisor evaluations. Valid values: False (default) or True.
*/
- @JsonProperty(value = "exclude")
private Boolean exclude;
/*
* Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid only for subscriptions. Valid
* values: 5 (default), 10, 15 or 20.
*/
- @JsonProperty(value = "lowCpuThreshold")
private CpuThreshold lowCpuThreshold;
+ /*
+ * Minimum duration for Advisor low CPU utilization evaluation. Valid only for subscriptions. Valid values: 7
+ * (default), 14, 21, 30, 60 or 90.
+ */
+ private DurationModel duration;
+
/*
* Advisor digest configuration. Valid only for subscriptions
*/
- @JsonProperty(value = "digests")
private List digests;
- /** Creates an instance of ConfigDataProperties class. */
+ /**
+ * Creates an instance of ConfigDataProperties class.
+ */
public ConfigDataProperties() {
}
/**
* Get the exclude property: Exclude the resource from Advisor evaluations. Valid values: False (default) or True.
- *
+ *
* @return the exclude value.
*/
public Boolean exclude() {
@@ -47,7 +59,7 @@ public Boolean exclude() {
/**
* Set the exclude property: Exclude the resource from Advisor evaluations. Valid values: False (default) or True.
- *
+ *
* @param exclude the exclude value to set.
* @return the ConfigDataProperties object itself.
*/
@@ -59,7 +71,7 @@ public ConfigDataProperties withExclude(Boolean exclude) {
/**
* Get the lowCpuThreshold property: Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid
* only for subscriptions. Valid values: 5 (default), 10, 15 or 20.
- *
+ *
* @return the lowCpuThreshold value.
*/
public CpuThreshold lowCpuThreshold() {
@@ -69,7 +81,7 @@ public CpuThreshold lowCpuThreshold() {
/**
* Set the lowCpuThreshold property: Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid
* only for subscriptions. Valid values: 5 (default), 10, 15 or 20.
- *
+ *
* @param lowCpuThreshold the lowCpuThreshold value to set.
* @return the ConfigDataProperties object itself.
*/
@@ -78,9 +90,31 @@ public ConfigDataProperties withLowCpuThreshold(CpuThreshold lowCpuThreshold) {
return this;
}
+ /**
+ * Get the duration property: Minimum duration for Advisor low CPU utilization evaluation. Valid only for
+ * subscriptions. Valid values: 7 (default), 14, 21, 30, 60 or 90.
+ *
+ * @return the duration value.
+ */
+ public DurationModel duration() {
+ return this.duration;
+ }
+
+ /**
+ * Set the duration property: Minimum duration for Advisor low CPU utilization evaluation. Valid only for
+ * subscriptions. Valid values: 7 (default), 14, 21, 30, 60 or 90.
+ *
+ * @param duration the duration value to set.
+ * @return the ConfigDataProperties object itself.
+ */
+ public ConfigDataProperties withDuration(DurationModel duration) {
+ this.duration = duration;
+ return this;
+ }
+
/**
* Get the digests property: Advisor digest configuration. Valid only for subscriptions.
- *
+ *
* @return the digests value.
*/
public List digests() {
@@ -89,7 +123,7 @@ public List digests() {
/**
* Set the digests property: Advisor digest configuration. Valid only for subscriptions.
- *
+ *
* @param digests the digests value to set.
* @return the ConfigDataProperties object itself.
*/
@@ -100,7 +134,7 @@ public ConfigDataProperties withDigests(List digests) {
/**
* Validates the instance.
- *
+ *
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
@@ -108,4 +142,51 @@ public void validate() {
digests().forEach(e -> e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeBooleanField("exclude", this.exclude);
+ jsonWriter.writeStringField("lowCpuThreshold",
+ this.lowCpuThreshold == null ? null : this.lowCpuThreshold.toString());
+ jsonWriter.writeStringField("duration", this.duration == null ? null : this.duration.toString());
+ jsonWriter.writeArrayField("digests", this.digests, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ConfigDataProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ConfigDataProperties 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 ConfigDataProperties.
+ */
+ public static ConfigDataProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ConfigDataProperties deserializedConfigDataProperties = new ConfigDataProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("exclude".equals(fieldName)) {
+ deserializedConfigDataProperties.exclude = reader.getNullable(JsonReader::getBoolean);
+ } else if ("lowCpuThreshold".equals(fieldName)) {
+ deserializedConfigDataProperties.lowCpuThreshold = CpuThreshold.fromString(reader.getString());
+ } else if ("duration".equals(fieldName)) {
+ deserializedConfigDataProperties.duration = DurationModel.fromString(reader.getString());
+ } else if ("digests".equals(fieldName)) {
+ List digests = reader.readArray(reader1 -> DigestConfig.fromJson(reader1));
+ deserializedConfigDataProperties.digests = digests;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedConfigDataProperties;
+ });
+ }
}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityInner.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityInner.java
index 3aadf5667be7..1c323dd233c4 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityInner.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityInner.java
@@ -5,45 +5,49 @@
package com.azure.resourcemanager.advisor.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.advisor.models.MetadataSupportedValueDetail;
import com.azure.resourcemanager.advisor.models.Scenario;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
-/** The metadata entity contract. */
+/**
+ * The metadata entity contract.
+ */
@Fluent
-public final class MetadataEntityInner {
+public final class MetadataEntityInner implements JsonSerializable {
/*
* The resource Id of the metadata entity.
*/
- @JsonProperty(value = "id")
private String id;
/*
* The type of the metadata entity.
*/
- @JsonProperty(value = "type")
private String type;
/*
* The name of the metadata entity.
*/
- @JsonProperty(value = "name")
private String name;
/*
* The metadata entity properties.
*/
- @JsonProperty(value = "properties")
private MetadataEntityProperties innerProperties;
- /** Creates an instance of MetadataEntityInner class. */
+ /**
+ * Creates an instance of MetadataEntityInner class.
+ */
public MetadataEntityInner() {
}
/**
* Get the id property: The resource Id of the metadata entity.
- *
+ *
* @return the id value.
*/
public String id() {
@@ -52,7 +56,7 @@ public String id() {
/**
* Set the id property: The resource Id of the metadata entity.
- *
+ *
* @param id the id value to set.
* @return the MetadataEntityInner object itself.
*/
@@ -63,7 +67,7 @@ public MetadataEntityInner withId(String id) {
/**
* Get the type property: The type of the metadata entity.
- *
+ *
* @return the type value.
*/
public String type() {
@@ -72,7 +76,7 @@ public String type() {
/**
* Set the type property: The type of the metadata entity.
- *
+ *
* @param type the type value to set.
* @return the MetadataEntityInner object itself.
*/
@@ -83,7 +87,7 @@ public MetadataEntityInner withType(String type) {
/**
* Get the name property: The name of the metadata entity.
- *
+ *
* @return the name value.
*/
public String name() {
@@ -92,7 +96,7 @@ public String name() {
/**
* Set the name property: The name of the metadata entity.
- *
+ *
* @param name the name value to set.
* @return the MetadataEntityInner object itself.
*/
@@ -103,7 +107,7 @@ public MetadataEntityInner withName(String name) {
/**
* Get the innerProperties property: The metadata entity properties.
- *
+ *
* @return the innerProperties value.
*/
private MetadataEntityProperties innerProperties() {
@@ -112,7 +116,7 @@ private MetadataEntityProperties innerProperties() {
/**
* Get the displayName property: The display name.
- *
+ *
* @return the displayName value.
*/
public String displayName() {
@@ -121,7 +125,7 @@ public String displayName() {
/**
* Set the displayName property: The display name.
- *
+ *
* @param displayName the displayName value to set.
* @return the MetadataEntityInner object itself.
*/
@@ -135,7 +139,7 @@ public MetadataEntityInner withDisplayName(String displayName) {
/**
* Get the dependsOn property: The list of keys on which this entity depends on.
- *
+ *
* @return the dependsOn value.
*/
public List dependsOn() {
@@ -144,7 +148,7 @@ public List dependsOn() {
/**
* Set the dependsOn property: The list of keys on which this entity depends on.
- *
+ *
* @param dependsOn the dependsOn value to set.
* @return the MetadataEntityInner object itself.
*/
@@ -158,7 +162,7 @@ public MetadataEntityInner withDependsOn(List dependsOn) {
/**
* Get the applicableScenarios property: The list of scenarios applicable to this metadata entity.
- *
+ *
* @return the applicableScenarios value.
*/
public List applicableScenarios() {
@@ -167,7 +171,7 @@ public List applicableScenarios() {
/**
* Set the applicableScenarios property: The list of scenarios applicable to this metadata entity.
- *
+ *
* @param applicableScenarios the applicableScenarios value to set.
* @return the MetadataEntityInner object itself.
*/
@@ -181,7 +185,7 @@ public MetadataEntityInner withApplicableScenarios(List applicableScen
/**
* Get the supportedValues property: The list of supported values.
- *
+ *
* @return the supportedValues value.
*/
public List supportedValues() {
@@ -190,7 +194,7 @@ public List supportedValues() {
/**
* Set the supportedValues property: The list of supported values.
- *
+ *
* @param supportedValues the supportedValues value to set.
* @return the MetadataEntityInner object itself.
*/
@@ -204,7 +208,7 @@ public MetadataEntityInner withSupportedValues(List {
+ MetadataEntityInner deserializedMetadataEntityInner = new MetadataEntityInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedMetadataEntityInner.id = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedMetadataEntityInner.type = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedMetadataEntityInner.name = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedMetadataEntityInner.innerProperties = MetadataEntityProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedMetadataEntityInner;
+ });
+ }
}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityProperties.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityProperties.java
index 1f2187ba8082..ea4042d9f2bf 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityProperties.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityProperties.java
@@ -5,45 +5,49 @@
package com.azure.resourcemanager.advisor.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.advisor.models.MetadataSupportedValueDetail;
import com.azure.resourcemanager.advisor.models.Scenario;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.util.List;
-/** The metadata entity properties. */
+/**
+ * The metadata entity properties.
+ */
@Fluent
-public final class MetadataEntityProperties {
+public final class MetadataEntityProperties implements JsonSerializable {
/*
* The display name.
*/
- @JsonProperty(value = "displayName")
private String displayName;
/*
* The list of keys on which this entity depends on.
*/
- @JsonProperty(value = "dependsOn")
private List dependsOn;
/*
* The list of scenarios applicable to this metadata entity.
*/
- @JsonProperty(value = "applicableScenarios")
private List applicableScenarios;
/*
* The list of supported values.
*/
- @JsonProperty(value = "supportedValues")
private List supportedValues;
- /** Creates an instance of MetadataEntityProperties class. */
+ /**
+ * Creates an instance of MetadataEntityProperties class.
+ */
public MetadataEntityProperties() {
}
/**
* Get the displayName property: The display name.
- *
+ *
* @return the displayName value.
*/
public String displayName() {
@@ -52,7 +56,7 @@ public String displayName() {
/**
* Set the displayName property: The display name.
- *
+ *
* @param displayName the displayName value to set.
* @return the MetadataEntityProperties object itself.
*/
@@ -63,7 +67,7 @@ public MetadataEntityProperties withDisplayName(String displayName) {
/**
* Get the dependsOn property: The list of keys on which this entity depends on.
- *
+ *
* @return the dependsOn value.
*/
public List dependsOn() {
@@ -72,7 +76,7 @@ public List dependsOn() {
/**
* Set the dependsOn property: The list of keys on which this entity depends on.
- *
+ *
* @param dependsOn the dependsOn value to set.
* @return the MetadataEntityProperties object itself.
*/
@@ -83,7 +87,7 @@ public MetadataEntityProperties withDependsOn(List dependsOn) {
/**
* Get the applicableScenarios property: The list of scenarios applicable to this metadata entity.
- *
+ *
* @return the applicableScenarios value.
*/
public List applicableScenarios() {
@@ -92,7 +96,7 @@ public List applicableScenarios() {
/**
* Set the applicableScenarios property: The list of scenarios applicable to this metadata entity.
- *
+ *
* @param applicableScenarios the applicableScenarios value to set.
* @return the MetadataEntityProperties object itself.
*/
@@ -103,7 +107,7 @@ public MetadataEntityProperties withApplicableScenarios(List applicabl
/**
* Get the supportedValues property: The list of supported values.
- *
+ *
* @return the supportedValues value.
*/
public List supportedValues() {
@@ -112,7 +116,7 @@ public List supportedValues() {
/**
* Set the supportedValues property: The list of supported values.
- *
+ *
* @param supportedValues the supportedValues value to set.
* @return the MetadataEntityProperties object itself.
*/
@@ -123,7 +127,7 @@ public MetadataEntityProperties withSupportedValues(List e.validate());
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("displayName", this.displayName);
+ jsonWriter.writeArrayField("dependsOn", this.dependsOn, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeArrayField("applicableScenarios", this.applicableScenarios,
+ (writer, element) -> writer.writeString(element == null ? null : element.toString()));
+ jsonWriter.writeArrayField("supportedValues", this.supportedValues,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of MetadataEntityProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of MetadataEntityProperties 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 MetadataEntityProperties.
+ */
+ public static MetadataEntityProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ MetadataEntityProperties deserializedMetadataEntityProperties = new MetadataEntityProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("displayName".equals(fieldName)) {
+ deserializedMetadataEntityProperties.displayName = reader.getString();
+ } else if ("dependsOn".equals(fieldName)) {
+ List dependsOn = reader.readArray(reader1 -> reader1.getString());
+ deserializedMetadataEntityProperties.dependsOn = dependsOn;
+ } else if ("applicableScenarios".equals(fieldName)) {
+ List applicableScenarios
+ = reader.readArray(reader1 -> Scenario.fromString(reader1.getString()));
+ deserializedMetadataEntityProperties.applicableScenarios = applicableScenarios;
+ } else if ("supportedValues".equals(fieldName)) {
+ List supportedValues
+ = reader.readArray(reader1 -> MetadataSupportedValueDetail.fromJson(reader1));
+ deserializedMetadataEntityProperties.supportedValues = supportedValues;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedMetadataEntityProperties;
+ });
+ }
}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/OperationEntityInner.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/OperationEntityInner.java
index fa14b5241f15..032431ed1d6a 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/OperationEntityInner.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/OperationEntityInner.java
@@ -5,31 +5,37 @@
package com.azure.resourcemanager.advisor.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.advisor.models.OperationDisplayInfo;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
-/** The operation supported by Advisor. */
+/**
+ * The operation supported by Advisor.
+ */
@Fluent
-public final class OperationEntityInner {
+public final class OperationEntityInner implements JsonSerializable {
/*
* Operation name: {provider}/{resource}/{operation}.
*/
- @JsonProperty(value = "name")
private String name;
/*
* The operation supported by Advisor.
*/
- @JsonProperty(value = "display")
private OperationDisplayInfo display;
- /** Creates an instance of OperationEntityInner class. */
+ /**
+ * Creates an instance of OperationEntityInner class.
+ */
public OperationEntityInner() {
}
/**
* Get the name property: Operation name: {provider}/{resource}/{operation}.
- *
+ *
* @return the name value.
*/
public String name() {
@@ -38,7 +44,7 @@ public String name() {
/**
* Set the name property: Operation name: {provider}/{resource}/{operation}.
- *
+ *
* @param name the name value to set.
* @return the OperationEntityInner object itself.
*/
@@ -49,7 +55,7 @@ public OperationEntityInner withName(String name) {
/**
* Get the display property: The operation supported by Advisor.
- *
+ *
* @return the display value.
*/
public OperationDisplayInfo display() {
@@ -58,7 +64,7 @@ public OperationDisplayInfo display() {
/**
* Set the display property: The operation supported by Advisor.
- *
+ *
* @param display the display value to set.
* @return the OperationEntityInner object itself.
*/
@@ -69,7 +75,7 @@ public OperationEntityInner withDisplay(OperationDisplayInfo display) {
/**
* Validates the instance.
- *
+ *
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
@@ -77,4 +83,43 @@ public void validate() {
display().validate();
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("name", this.name);
+ jsonWriter.writeJsonField("display", this.display);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationEntityInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationEntityInner 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 OperationEntityInner.
+ */
+ public static OperationEntityInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationEntityInner deserializedOperationEntityInner = new OperationEntityInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedOperationEntityInner.name = reader.getString();
+ } else if ("display".equals(fieldName)) {
+ deserializedOperationEntityInner.display = OperationDisplayInfo.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationEntityInner;
+ });
+ }
}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/PredictionRequestProperties.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/PredictionRequestProperties.java
new file mode 100644
index 000000000000..d156f7613798
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/PredictionRequestProperties.java
@@ -0,0 +1,124 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.advisor.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.advisor.models.PredictionType;
+import java.io.IOException;
+
+/**
+ * Properties given for the predictor.
+ */
+@Fluent
+public final class PredictionRequestProperties implements JsonSerializable {
+ /*
+ * Type of the prediction.
+ */
+ private PredictionType predictionType;
+
+ /*
+ * Extended properties are arguments specific for each prediction type.
+ */
+ private Object extendedProperties;
+
+ /**
+ * Creates an instance of PredictionRequestProperties class.
+ */
+ public PredictionRequestProperties() {
+ }
+
+ /**
+ * Get the predictionType property: Type of the prediction.
+ *
+ * @return the predictionType value.
+ */
+ public PredictionType predictionType() {
+ return this.predictionType;
+ }
+
+ /**
+ * Set the predictionType property: Type of the prediction.
+ *
+ * @param predictionType the predictionType value to set.
+ * @return the PredictionRequestProperties object itself.
+ */
+ public PredictionRequestProperties withPredictionType(PredictionType predictionType) {
+ this.predictionType = predictionType;
+ return this;
+ }
+
+ /**
+ * Get the extendedProperties property: Extended properties are arguments specific for each prediction type.
+ *
+ * @return the extendedProperties value.
+ */
+ public Object extendedProperties() {
+ return this.extendedProperties;
+ }
+
+ /**
+ * Set the extendedProperties property: Extended properties are arguments specific for each prediction type.
+ *
+ * @param extendedProperties the extendedProperties value to set.
+ * @return the PredictionRequestProperties object itself.
+ */
+ public PredictionRequestProperties withExtendedProperties(Object extendedProperties) {
+ this.extendedProperties = extendedProperties;
+ 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("predictionType",
+ this.predictionType == null ? null : this.predictionType.toString());
+ jsonWriter.writeUntypedField("extendedProperties", this.extendedProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PredictionRequestProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PredictionRequestProperties 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 PredictionRequestProperties.
+ */
+ public static PredictionRequestProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PredictionRequestProperties deserializedPredictionRequestProperties = new PredictionRequestProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("predictionType".equals(fieldName)) {
+ deserializedPredictionRequestProperties.predictionType
+ = PredictionType.fromString(reader.getString());
+ } else if ("extendedProperties".equals(fieldName)) {
+ deserializedPredictionRequestProperties.extendedProperties = reader.readUntyped();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPredictionRequestProperties;
+ });
+ }
+}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/PredictionResponseInner.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/PredictionResponseInner.java
new file mode 100644
index 000000000000..011479258f4e
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/PredictionResponseInner.java
@@ -0,0 +1,251 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.advisor.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.advisor.models.Category;
+import com.azure.resourcemanager.advisor.models.Impact;
+import com.azure.resourcemanager.advisor.models.PredictionType;
+import com.azure.resourcemanager.advisor.models.ShortDescription;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+
+/**
+ * Response used by predictions.
+ */
+@Fluent
+public final class PredictionResponseInner implements JsonSerializable {
+ /*
+ * The properties of the prediction.
+ */
+ private PredictionResponseProperties innerProperties;
+
+ /**
+ * Creates an instance of PredictionResponseInner class.
+ */
+ public PredictionResponseInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The properties of the prediction.
+ *
+ * @return the innerProperties value.
+ */
+ private PredictionResponseProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the extendedProperties property: Extended properties.
+ *
+ * @return the extendedProperties value.
+ */
+ public Object extendedProperties() {
+ return this.innerProperties() == null ? null : this.innerProperties().extendedProperties();
+ }
+
+ /**
+ * Set the extendedProperties property: Extended properties.
+ *
+ * @param extendedProperties the extendedProperties value to set.
+ * @return the PredictionResponseInner object itself.
+ */
+ public PredictionResponseInner withExtendedProperties(Object extendedProperties) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PredictionResponseProperties();
+ }
+ this.innerProperties().withExtendedProperties(extendedProperties);
+ return this;
+ }
+
+ /**
+ * Get the predictionType property: Type of the prediction.
+ *
+ * @return the predictionType value.
+ */
+ public PredictionType predictionType() {
+ return this.innerProperties() == null ? null : this.innerProperties().predictionType();
+ }
+
+ /**
+ * Set the predictionType property: Type of the prediction.
+ *
+ * @param predictionType the predictionType value to set.
+ * @return the PredictionResponseInner object itself.
+ */
+ public PredictionResponseInner withPredictionType(PredictionType predictionType) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PredictionResponseProperties();
+ }
+ this.innerProperties().withPredictionType(predictionType);
+ return this;
+ }
+
+ /**
+ * Get the category property: The category of the recommendation.
+ *
+ * @return the category value.
+ */
+ public Category category() {
+ return this.innerProperties() == null ? null : this.innerProperties().category();
+ }
+
+ /**
+ * Set the category property: The category of the recommendation.
+ *
+ * @param category the category value to set.
+ * @return the PredictionResponseInner object itself.
+ */
+ public PredictionResponseInner withCategory(Category category) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PredictionResponseProperties();
+ }
+ this.innerProperties().withCategory(category);
+ return this;
+ }
+
+ /**
+ * Get the impact property: The business impact of the recommendation.
+ *
+ * @return the impact value.
+ */
+ public Impact impact() {
+ return this.innerProperties() == null ? null : this.innerProperties().impact();
+ }
+
+ /**
+ * Set the impact property: The business impact of the recommendation.
+ *
+ * @param impact the impact value to set.
+ * @return the PredictionResponseInner object itself.
+ */
+ public PredictionResponseInner withImpact(Impact impact) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PredictionResponseProperties();
+ }
+ this.innerProperties().withImpact(impact);
+ return this;
+ }
+
+ /**
+ * Get the impactedField property: The resource type identified by Advisor.
+ *
+ * @return the impactedField value.
+ */
+ public String impactedField() {
+ return this.innerProperties() == null ? null : this.innerProperties().impactedField();
+ }
+
+ /**
+ * Set the impactedField property: The resource type identified by Advisor.
+ *
+ * @param impactedField the impactedField value to set.
+ * @return the PredictionResponseInner object itself.
+ */
+ public PredictionResponseInner withImpactedField(String impactedField) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PredictionResponseProperties();
+ }
+ this.innerProperties().withImpactedField(impactedField);
+ return this;
+ }
+
+ /**
+ * Get the lastUpdated property: The most recent time that Advisor checked the validity of the recommendation.
+ *
+ * @return the lastUpdated value.
+ */
+ public OffsetDateTime lastUpdated() {
+ return this.innerProperties() == null ? null : this.innerProperties().lastUpdated();
+ }
+
+ /**
+ * Set the lastUpdated property: The most recent time that Advisor checked the validity of the recommendation.
+ *
+ * @param lastUpdated the lastUpdated value to set.
+ * @return the PredictionResponseInner object itself.
+ */
+ public PredictionResponseInner withLastUpdated(OffsetDateTime lastUpdated) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PredictionResponseProperties();
+ }
+ this.innerProperties().withLastUpdated(lastUpdated);
+ return this;
+ }
+
+ /**
+ * Get the shortDescription property: A summary of the recommendation.
+ *
+ * @return the shortDescription value.
+ */
+ public ShortDescription shortDescription() {
+ return this.innerProperties() == null ? null : this.innerProperties().shortDescription();
+ }
+
+ /**
+ * Set the shortDescription property: A summary of the recommendation.
+ *
+ * @param shortDescription the shortDescription value to set.
+ * @return the PredictionResponseInner object itself.
+ */
+ public PredictionResponseInner withShortDescription(ShortDescription shortDescription) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PredictionResponseProperties();
+ }
+ this.innerProperties().withShortDescription(shortDescription);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.innerProperties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PredictionResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PredictionResponseInner 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 PredictionResponseInner.
+ */
+ public static PredictionResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PredictionResponseInner deserializedPredictionResponseInner = new PredictionResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("properties".equals(fieldName)) {
+ deserializedPredictionResponseInner.innerProperties = PredictionResponseProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPredictionResponseInner;
+ });
+ }
+}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/PredictionResponseProperties.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/PredictionResponseProperties.java
new file mode 100644
index 000000000000..c39043dccaa8
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/PredictionResponseProperties.java
@@ -0,0 +1,275 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.advisor.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.advisor.models.Category;
+import com.azure.resourcemanager.advisor.models.Impact;
+import com.azure.resourcemanager.advisor.models.PredictionType;
+import com.azure.resourcemanager.advisor.models.ShortDescription;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * Properties of the prediction.
+ */
+@Fluent
+public final class PredictionResponseProperties implements JsonSerializable {
+ /*
+ * Extended properties
+ */
+ private Object extendedProperties;
+
+ /*
+ * Type of the prediction.
+ */
+ private PredictionType predictionType;
+
+ /*
+ * The category of the recommendation.
+ */
+ private Category category;
+
+ /*
+ * The business impact of the recommendation.
+ */
+ private Impact impact;
+
+ /*
+ * The resource type identified by Advisor.
+ */
+ private String impactedField;
+
+ /*
+ * The most recent time that Advisor checked the validity of the recommendation.
+ */
+ private OffsetDateTime lastUpdated;
+
+ /*
+ * A summary of the recommendation.
+ */
+ private ShortDescription shortDescription;
+
+ /**
+ * Creates an instance of PredictionResponseProperties class.
+ */
+ public PredictionResponseProperties() {
+ }
+
+ /**
+ * Get the extendedProperties property: Extended properties.
+ *
+ * @return the extendedProperties value.
+ */
+ public Object extendedProperties() {
+ return this.extendedProperties;
+ }
+
+ /**
+ * Set the extendedProperties property: Extended properties.
+ *
+ * @param extendedProperties the extendedProperties value to set.
+ * @return the PredictionResponseProperties object itself.
+ */
+ public PredictionResponseProperties withExtendedProperties(Object extendedProperties) {
+ this.extendedProperties = extendedProperties;
+ return this;
+ }
+
+ /**
+ * Get the predictionType property: Type of the prediction.
+ *
+ * @return the predictionType value.
+ */
+ public PredictionType predictionType() {
+ return this.predictionType;
+ }
+
+ /**
+ * Set the predictionType property: Type of the prediction.
+ *
+ * @param predictionType the predictionType value to set.
+ * @return the PredictionResponseProperties object itself.
+ */
+ public PredictionResponseProperties withPredictionType(PredictionType predictionType) {
+ this.predictionType = predictionType;
+ return this;
+ }
+
+ /**
+ * Get the category property: The category of the recommendation.
+ *
+ * @return the category value.
+ */
+ public Category category() {
+ return this.category;
+ }
+
+ /**
+ * Set the category property: The category of the recommendation.
+ *
+ * @param category the category value to set.
+ * @return the PredictionResponseProperties object itself.
+ */
+ public PredictionResponseProperties withCategory(Category category) {
+ this.category = category;
+ return this;
+ }
+
+ /**
+ * Get the impact property: The business impact of the recommendation.
+ *
+ * @return the impact value.
+ */
+ public Impact impact() {
+ return this.impact;
+ }
+
+ /**
+ * Set the impact property: The business impact of the recommendation.
+ *
+ * @param impact the impact value to set.
+ * @return the PredictionResponseProperties object itself.
+ */
+ public PredictionResponseProperties withImpact(Impact impact) {
+ this.impact = impact;
+ return this;
+ }
+
+ /**
+ * Get the impactedField property: The resource type identified by Advisor.
+ *
+ * @return the impactedField value.
+ */
+ public String impactedField() {
+ return this.impactedField;
+ }
+
+ /**
+ * Set the impactedField property: The resource type identified by Advisor.
+ *
+ * @param impactedField the impactedField value to set.
+ * @return the PredictionResponseProperties object itself.
+ */
+ public PredictionResponseProperties withImpactedField(String impactedField) {
+ this.impactedField = impactedField;
+ return this;
+ }
+
+ /**
+ * Get the lastUpdated property: The most recent time that Advisor checked the validity of the recommendation.
+ *
+ * @return the lastUpdated value.
+ */
+ public OffsetDateTime lastUpdated() {
+ return this.lastUpdated;
+ }
+
+ /**
+ * Set the lastUpdated property: The most recent time that Advisor checked the validity of the recommendation.
+ *
+ * @param lastUpdated the lastUpdated value to set.
+ * @return the PredictionResponseProperties object itself.
+ */
+ public PredictionResponseProperties withLastUpdated(OffsetDateTime lastUpdated) {
+ this.lastUpdated = lastUpdated;
+ return this;
+ }
+
+ /**
+ * Get the shortDescription property: A summary of the recommendation.
+ *
+ * @return the shortDescription value.
+ */
+ public ShortDescription shortDescription() {
+ return this.shortDescription;
+ }
+
+ /**
+ * Set the shortDescription property: A summary of the recommendation.
+ *
+ * @param shortDescription the shortDescription value to set.
+ * @return the PredictionResponseProperties object itself.
+ */
+ public PredictionResponseProperties withShortDescription(ShortDescription shortDescription) {
+ this.shortDescription = shortDescription;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (shortDescription() != null) {
+ shortDescription().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeUntypedField("extendedProperties", this.extendedProperties);
+ jsonWriter.writeStringField("predictionType",
+ this.predictionType == null ? null : this.predictionType.toString());
+ jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString());
+ jsonWriter.writeStringField("impact", this.impact == null ? null : this.impact.toString());
+ jsonWriter.writeStringField("impactedField", this.impactedField);
+ jsonWriter.writeStringField("lastUpdated",
+ this.lastUpdated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdated));
+ jsonWriter.writeJsonField("shortDescription", this.shortDescription);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PredictionResponseProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PredictionResponseProperties 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 PredictionResponseProperties.
+ */
+ public static PredictionResponseProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PredictionResponseProperties deserializedPredictionResponseProperties = new PredictionResponseProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("extendedProperties".equals(fieldName)) {
+ deserializedPredictionResponseProperties.extendedProperties = reader.readUntyped();
+ } else if ("predictionType".equals(fieldName)) {
+ deserializedPredictionResponseProperties.predictionType
+ = PredictionType.fromString(reader.getString());
+ } else if ("category".equals(fieldName)) {
+ deserializedPredictionResponseProperties.category = Category.fromString(reader.getString());
+ } else if ("impact".equals(fieldName)) {
+ deserializedPredictionResponseProperties.impact = Impact.fromString(reader.getString());
+ } else if ("impactedField".equals(fieldName)) {
+ deserializedPredictionResponseProperties.impactedField = reader.getString();
+ } else if ("lastUpdated".equals(fieldName)) {
+ deserializedPredictionResponseProperties.lastUpdated = reader
+ .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
+ } else if ("shortDescription".equals(fieldName)) {
+ deserializedPredictionResponseProperties.shortDescription = ShortDescription.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPredictionResponseProperties;
+ });
+ }
+}
diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/RecommendationProperties.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/RecommendationProperties.java
index 68616b818011..482e0447184c 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/RecommendationProperties.java
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/RecommendationProperties.java
@@ -5,139 +5,133 @@
package com.azure.resourcemanager.advisor.fluent.models;
import com.azure.core.annotation.Fluent;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
import com.azure.resourcemanager.advisor.models.Category;
import com.azure.resourcemanager.advisor.models.Impact;
import com.azure.resourcemanager.advisor.models.ResourceMetadata;
+import com.azure.resourcemanager.advisor.models.Risk;
import com.azure.resourcemanager.advisor.models.ShortDescription;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.IOException;
import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.UUID;
-/** The properties of the recommendation. */
+/**
+ * The properties of the recommendation.
+ */
@Fluent
-public final class RecommendationProperties {
+public final class RecommendationProperties implements JsonSerializable {
/*
* The category of the recommendation.
*/
- @JsonProperty(value = "category")
private Category category;
/*
* The business impact of the recommendation.
*/
- @JsonProperty(value = "impact")
private Impact impact;
/*
* The resource type identified by Advisor.
*/
- @JsonProperty(value = "impactedField")
private String impactedField;
/*
* The resource identified by Advisor.
*/
- @JsonProperty(value = "impactedValue")
private String impactedValue;
/*
* The most recent time that Advisor checked the validity of the recommendation.
*/
- @JsonProperty(value = "lastUpdated")
private OffsetDateTime lastUpdated;
/*
* The recommendation metadata.
*/
- @JsonProperty(value = "metadata")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map metadata;
/*
* The recommendation-type GUID.
*/
- @JsonProperty(value = "recommendationTypeId")
private String recommendationTypeId;
+ /*
+ * The potential risk of not implementing the recommendation.
+ */
+ private Risk risk;
+
/*
* A summary of the recommendation.
*/
- @JsonProperty(value = "shortDescription")
private ShortDescription shortDescription;
/*
* The list of snoozed and dismissed rules for the recommendation.
*/
- @JsonProperty(value = "suppressionIds")
private List suppressionIds;
/*
* Extended properties
*/
- @JsonProperty(value = "extendedProperties")
- @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map extendedProperties;
/*
* Metadata of resource that was assessed
*/
- @JsonProperty(value = "resourceMetadata")
private ResourceMetadata resourceMetadata;
/*
* The detailed description of recommendation.
*/
- @JsonProperty(value = "description")
private String description;
/*
* The label of recommendation.
*/
- @JsonProperty(value = "label")
private String label;
/*
* The link to learn more about recommendation and generation logic.
*/
- @JsonProperty(value = "learnMoreLink")
private String learnMoreLink;
/*
* The potential benefit of implementing recommendation.
*/
- @JsonProperty(value = "potentialBenefits")
private String potentialBenefits;
/*
* The list of recommended actions to implement recommendation.
*/
- @JsonProperty(value = "actions")
private List