diff --git a/sdk/advisor/azure-resourcemanager-advisor/CHANGELOG.md b/sdk/advisor/azure-resourcemanager-advisor/CHANGELOG.md
index 16ab1f416970a..3e0e936700996 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/CHANGELOG.md
+++ b/sdk/advisor/azure-resourcemanager-advisor/CHANGELOG.md
@@ -1,7 +1,8 @@
# Release History
-## 1.0.0-beta.2 (Unreleased)
+## 1.0.0-beta.1 (2022-02-22)
+- Azure Resource Manager Advisor client library for Java. This package contains Microsoft Azure SDK for Advisor Management SDK. REST APIs for Azure Advisor. Package tag package-2020-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
## 1.0.0-beta.1 (2021-04-12)
diff --git a/sdk/advisor/azure-resourcemanager-advisor/README.md b/sdk/advisor/azure-resourcemanager-advisor/README.md
index 002b37ebfdb7d..dee46db529377 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/README.md
+++ b/sdk/advisor/azure-resourcemanager-advisor/README.md
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-advisor
- 1.0.0-beta.1
+ 1.0.0-beta.2
```
[//]: # ({x-version-update-end})
@@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on
## Examples
+[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/advisor/azure-resourcemanager-advisor/SAMPLE.md)
+
+
## Troubleshooting
## Next steps
diff --git a/sdk/advisor/azure-resourcemanager-advisor/SAMPLE.md b/sdk/advisor/azure-resourcemanager-advisor/SAMPLE.md
new file mode 100644
index 0000000000000..659610b703a9a
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/SAMPLE.md
@@ -0,0 +1,387 @@
+# Code snippets and samples
+
+
+## Configurations
+
+- [CreateInResourceGroup](#configurations_createinresourcegroup)
+- [CreateInSubscription](#configurations_createinsubscription)
+- [List](#configurations_list)
+- [ListByResourceGroup](#configurations_listbyresourcegroup)
+
+## RecommendationMetadata
+
+- [Get](#recommendationmetadata_get)
+- [List](#recommendationmetadata_list)
+
+## Recommendations
+
+- [Generate](#recommendations_generate)
+- [Get](#recommendations_get)
+- [GetGenerateStatus](#recommendations_getgeneratestatus)
+- [List](#recommendations_list)
+
+## Suppressions
+
+- [Create](#suppressions_create)
+- [Delete](#suppressions_delete)
+- [Get](#suppressions_get)
+- [List](#suppressions_list)
+### Configurations_CreateInResourceGroup
+
+```java
+import com.azure.resourcemanager.advisor.models.Category;
+import com.azure.resourcemanager.advisor.models.ConfigurationName;
+import com.azure.resourcemanager.advisor.models.CpuThreshold;
+import com.azure.resourcemanager.advisor.models.DigestConfig;
+import com.azure.resourcemanager.advisor.models.DigestConfigState;
+import java.util.Arrays;
+
+/** Samples for Configurations CreateInResourceGroup. */
+public final class ConfigurationsCreateInResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/CreateConfiguration.json
+ */
+ /**
+ * Sample code: PutConfigurations.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void putConfigurations(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager
+ .configurations()
+ .define(ConfigurationName.DEFAULT)
+ .withExistingResourceGroup("resourceGroup")
+ .withExclude(true)
+ .withLowCpuThreshold(CpuThreshold.FIVE)
+ .withDigests(
+ Arrays
+ .asList(
+ new DigestConfig()
+ .withName("digestConfigName")
+ .withActionGroupResourceId(
+ "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/microsoft.insights/actionGroups/actionGroupName")
+ .withFrequency(30)
+ .withCategories(
+ Arrays
+ .asList(
+ Category.HIGH_AVAILABILITY,
+ Category.SECURITY,
+ Category.PERFORMANCE,
+ Category.COST,
+ Category.OPERATIONAL_EXCELLENCE))
+ .withLanguage("en")
+ .withState(DigestConfigState.ACTIVE)))
+ .create();
+ }
+}
+```
+
+### Configurations_CreateInSubscription
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.advisor.fluent.models.ConfigDataInner;
+import com.azure.resourcemanager.advisor.models.Category;
+import com.azure.resourcemanager.advisor.models.ConfigurationName;
+import com.azure.resourcemanager.advisor.models.CpuThreshold;
+import com.azure.resourcemanager.advisor.models.DigestConfig;
+import com.azure.resourcemanager.advisor.models.DigestConfigState;
+import java.util.Arrays;
+
+/** Samples for Configurations CreateInSubscription. */
+public final class ConfigurationsCreateInSubscriptionSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/CreateConfiguration.json
+ */
+ /**
+ * Sample code: PutConfigurations.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void putConfigurations(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager
+ .configurations()
+ .createInSubscriptionWithResponse(
+ ConfigurationName.DEFAULT,
+ new ConfigDataInner()
+ .withExclude(true)
+ .withLowCpuThreshold(CpuThreshold.FIVE)
+ .withDigests(
+ Arrays
+ .asList(
+ new DigestConfig()
+ .withName("digestConfigName")
+ .withActionGroupResourceId(
+ "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/microsoft.insights/actionGroups/actionGroupName")
+ .withFrequency(30)
+ .withCategories(
+ Arrays
+ .asList(
+ Category.HIGH_AVAILABILITY,
+ Category.SECURITY,
+ Category.PERFORMANCE,
+ Category.COST,
+ Category.OPERATIONAL_EXCELLENCE))
+ .withLanguage("en")
+ .withState(DigestConfigState.ACTIVE))),
+ Context.NONE);
+ }
+}
+```
+
+### Configurations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Configurations List. */
+public final class ConfigurationsListSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/ListConfigurations.json
+ */
+ /**
+ * Sample code: GetConfigurations.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void getConfigurations(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.configurations().list(Context.NONE);
+ }
+}
+```
+
+### Configurations_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Configurations ListByResourceGroup. */
+public final class ConfigurationsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/ListConfigurations.json
+ */
+ /**
+ * Sample code: GetConfigurations.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void getConfigurations(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.configurations().listByResourceGroup("resourceGroup", Context.NONE);
+ }
+}
+```
+
+### RecommendationMetadata_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RecommendationMetadata Get. */
+public final class RecommendationMetadataGetSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/GetRecommendationMetadataEntity.json
+ */
+ /**
+ * Sample code: GetMetadata.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void getMetadata(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.recommendationMetadatas().getWithResponse("types", Context.NONE);
+ }
+}
+```
+
+### RecommendationMetadata_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RecommendationMetadata List. */
+public final class RecommendationMetadataListSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/ListRecommendationMetadata.json
+ */
+ /**
+ * Sample code: GetMetadata.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void getMetadata(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.recommendationMetadatas().list(Context.NONE);
+ }
+}
+```
+
+### Recommendations_Generate
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Recommendations Generate. */
+public final class RecommendationsGenerateSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/GenerateRecommendations.json
+ */
+ /**
+ * Sample code: GenerateRecommendations.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void generateRecommendations(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.recommendations().generateWithResponse(Context.NONE);
+ }
+}
+```
+
+### Recommendations_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Recommendations Get. */
+public final class RecommendationsGetSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/GetRecommendationDetail.json
+ */
+ /**
+ * Sample code: GetRecommendationDetail.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void getRecommendationDetail(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.recommendations().getWithResponse("resourceUri", "recommendationId", Context.NONE);
+ }
+}
+```
+
+### Recommendations_GetGenerateStatus
+
+```java
+import com.azure.core.util.Context;
+import java.util.UUID;
+
+/** Samples for Recommendations GetGenerateStatus. */
+public final class RecommendationsGetGenerateStatusSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/EmptyResponse.json
+ */
+ /**
+ * Sample code: GetGenerateStatus.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void getGenerateStatus(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.recommendations().getGenerateStatusWithResponse(UUID.fromString("operationGUID"), Context.NONE);
+ }
+}
+```
+
+### Recommendations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Recommendations List. */
+public final class RecommendationsListSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/ListRecommendations.json
+ */
+ /**
+ * Sample code: ListRecommendations.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void listRecommendations(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.recommendations().list(null, 10, null, Context.NONE);
+ }
+}
+```
+
+### Suppressions_Create
+
+```java
+/** Samples for Suppressions Create. */
+public final class SuppressionsCreateSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/CreateSuppression.json
+ */
+ /**
+ * Sample code: CreateSuppression.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void createSuppression(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager
+ .suppressions()
+ .define("suppressionName1")
+ .withExistingRecommendation("resourceUri", "recommendationId")
+ .withTtl("07:00:00:00")
+ .create();
+ }
+}
+```
+
+### Suppressions_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Suppressions Delete. */
+public final class SuppressionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/DeleteSuppression.json
+ */
+ /**
+ * Sample code: DeleteSuppression.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void deleteSuppression(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.suppressions().deleteWithResponse("resourceUri", "recommendationId", "suppressionName1", Context.NONE);
+ }
+}
+```
+
+### Suppressions_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Suppressions Get. */
+public final class SuppressionsGetSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/GetSuppressionDetail.json
+ */
+ /**
+ * Sample code: GetSuppressionDetail.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void getSuppressionDetail(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.suppressions().getWithResponse("resourceUri", "recommendationId", "suppressionName1", Context.NONE);
+ }
+}
+```
+
+### Suppressions_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Suppressions List. */
+public final class SuppressionsListSamples {
+ /*
+ * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/ListSuppressions.json
+ */
+ /**
+ * Sample code: ListSuppressions.
+ *
+ * @param manager Entry point to AdvisorManager.
+ */
+ public static void listSuppressions(com.azure.resourcemanager.advisor.AdvisorManager manager) {
+ manager.suppressions().list(null, null, Context.NONE);
+ }
+}
+```
+
diff --git a/sdk/advisor/azure-resourcemanager-advisor/pom.xml b/sdk/advisor/azure-resourcemanager-advisor/pom.xml
index 800fd5cb23431..1815292a980c5 100644
--- a/sdk/advisor/azure-resourcemanager-advisor/pom.xml
+++ b/sdk/advisor/azure-resourcemanager-advisor/pom.xml
@@ -1,55 +1,55 @@
- 4.0.0
-
- com.azure
- azure-client-sdk-parent
- 1.7.0
- ../../parents/azure-client-sdk-parent
-
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
- com.azure.resourcemanager
- azure-resourcemanager-advisor
- 1.0.0-beta.2
- jar
+ com.azure.resourcemanager
+ azure-resourcemanager-advisor
+ 1.0.0-beta.2
+ jar
- Microsoft Azure SDK for Advisor Management
- This package contains Microsoft Azure SDK for Advisor Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST APIs for Azure Advisor. Package tag package-2020-01.
- https://github.com/Azure/azure-sdk-for-java
+ Microsoft Azure SDK for Advisor Management
+ This package contains Microsoft Azure SDK for Advisor Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST APIs for Azure Advisor. Package tag package-2020-01.
+ https://github.com/Azure/azure-sdk-for-java
-
-
- The MIT License (MIT)
- http://opensource.org/licenses/MIT
- repo
-
-
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
-
- https://github.com/Azure/azure-sdk-for-java
- scm:git:git@github.com:Azure/azure-sdk-for-java.git
- scm:git:git@github.com:Azure/azure-sdk-for-java.git
- HEAD
-
-
-
- microsoft
- Microsoft
-
-
-
- UTF-8
- true
-
-
-
- com.azure
- azure-core
- 1.25.0
-
-
- com.azure
- azure-core-management
- 1.5.2
-
-
+
+ https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+
+ microsoft
+ Microsoft
+
+
+
+ UTF-8
+ true
+
+
+
+ com.azure
+ azure-core
+ 1.25.0
+
+
+ com.azure
+ azure-core-management
+ 1.5.2
+
+
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 794674c3ab09c..7ba6384547c95 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
@@ -8,8 +8,8 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
-import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
@@ -17,6 +17,7 @@
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
@@ -37,6 +38,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
+import java.util.stream.Collectors;
/** Entry point to AdvisorManager. REST APIs for Azure Advisor. */
public final class AdvisorManager {
@@ -93,6 +95,7 @@ public static final class Configurable {
private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
private final List policies = new ArrayList<>();
+ private final List scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
private Duration defaultPollInterval;
@@ -132,6 +135,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) {
return this;
}
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
/**
* Sets the retry policy to the HTTP pipeline.
*
@@ -188,20 +202,33 @@ public AdvisorManager authenticate(TokenCredential credential, AzureProfile prof
userAgentBuilder.append(" (auto-generated)");
}
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
List policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies
- .add(
- new BearerTokenAuthenticationPolicy(
- credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
- policies.addAll(this.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 =
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 6ab6d0bf0d77a..68b7c59829aac 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
@@ -19,7 +19,7 @@ public interface ConfigurationsClient {
*
* @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.
+ * @return the list of Advisor configurations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
@@ -31,7 +31,7 @@ public interface ConfigurationsClient {
* @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 configurations.
+ * @return the list of Advisor configurations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(Context context);
@@ -58,7 +58,7 @@ public interface ConfigurationsClient {
* @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 configuration data structure.
+ * @return the Advisor configuration data structure along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response createInSubscriptionWithResponse(
@@ -71,7 +71,7 @@ Response createInSubscriptionWithResponse(
* @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 configurations.
+ * @return the list of Advisor configurations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable listByResourceGroup(String resourceGroup);
@@ -84,7 +84,7 @@ Response createInSubscriptionWithResponse(
* @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 configurations.
+ * @return the list of Advisor configurations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable listByResourceGroup(String resourceGroup, Context context);
@@ -114,7 +114,7 @@ ConfigDataInner createInResourceGroup(
* @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 configuration data structure.
+ * @return the Advisor configuration data structure along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response createInResourceGroupWithResponse(
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 2aba94427976a..207a500de0264 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
@@ -17,7 +17,7 @@ public interface OperationsClient {
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Advisor operations.
+ * @return the list of Advisor operations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
@@ -29,7 +29,7 @@ public interface OperationsClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the list of Advisor operations.
+ * @return the list of Advisor operations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(Context context);
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 c3768f44b2116..380cdb1c69f5a 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
@@ -33,7 +33,7 @@ public interface RecommendationMetadatasClient {
* @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 metadata entity.
+ * @return the metadata entity along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response getWithResponse(String name, Context context);
@@ -43,7 +43,7 @@ public interface RecommendationMetadatasClient {
*
* @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.
+ * @return the list of metadata entities as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
@@ -55,7 +55,7 @@ public interface RecommendationMetadatasClient {
* @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 metadata entities.
+ * @return the list of metadata entities as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(Context context);
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 64bb141df66da..1f02a47dce769 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
@@ -61,7 +61,7 @@ public interface RecommendationsClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response.
+ * @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response getGenerateStatusWithResponse(UUID operationId, Context context);
@@ -72,7 +72,7 @@ public interface RecommendationsClient {
*
* @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.
+ * @return the list of Advisor recommendations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
@@ -90,7 +90,7 @@ public interface RecommendationsClient {
* @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 recommendations.
+ * @return the list of Advisor recommendations as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(String filter, Integer top, String skipToken, Context context);
@@ -119,7 +119,7 @@ public interface RecommendationsClient {
* @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 advisor Recommendation.
+ * @return advisor Recommendation along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response getWithResponse(
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 a83f5f3b14912..66f0d84cc1d4e 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
@@ -41,7 +41,7 @@ public interface SuppressionsClient {
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with
- * the rule.
+ * the rule along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response getWithResponse(
@@ -80,7 +80,7 @@ SuppressionContractInner create(
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with
- * the rule.
+ * the rule along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response createWithResponse(
@@ -117,7 +117,7 @@ Response createWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response.
+ * @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response deleteWithResponse(String resourceUri, String recommendationId, String name, Context context);
@@ -128,7 +128,7 @@ Response createWithResponse(
*
* @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.
+ * @return the list of Advisor suppressions as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list();
@@ -143,7 +143,7 @@ Response createWithResponse(
* @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 suppressions.
+ * @return the list of Advisor suppressions as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable list(Integer top, String skipToken, Context context);
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 7c84cd0db0acf..054f30d5e9a55 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
@@ -5,7 +5,6 @@
package com.azure.resourcemanager.advisor.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.annotation.JsonFlatten;
import com.azure.core.management.ProxyResource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.advisor.models.CpuThreshold;
@@ -15,30 +14,24 @@
import java.util.List;
/** The Advisor configuration data structure. */
-@JsonFlatten
@Fluent
-public class ConfigDataInner extends ProxyResource {
+public final class ConfigDataInner extends ProxyResource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigDataInner.class);
/*
- * Exclude the resource from Advisor evaluations. Valid values: False
- * (default) or True.
+ * The Advisor configuration data structure.
*/
- @JsonProperty(value = "properties.exclude")
- private Boolean exclude;
+ @JsonProperty(value = "properties")
+ private ConfigDataProperties innerProperties;
- /*
- * Minimum percentage threshold for Advisor low CPU utilization evaluation.
- * Valid only for subscriptions. Valid values: 5 (default), 10, 15 or 20.
- */
- @JsonProperty(value = "properties.lowCpuThreshold")
- private CpuThreshold lowCpuThreshold;
-
- /*
- * Advisor digest configuration. Valid only for subscriptions
+ /**
+ * Get the innerProperties property: The Advisor configuration data structure.
+ *
+ * @return the innerProperties value.
*/
- @JsonProperty(value = "properties.digests")
- private List digests;
+ private ConfigDataProperties innerProperties() {
+ return this.innerProperties;
+ }
/**
* Get the exclude property: Exclude the resource from Advisor evaluations. Valid values: False (default) or True.
@@ -46,7 +39,7 @@ public class ConfigDataInner extends ProxyResource {
* @return the exclude value.
*/
public Boolean exclude() {
- return this.exclude;
+ return this.innerProperties() == null ? null : this.innerProperties().exclude();
}
/**
@@ -56,7 +49,10 @@ public Boolean exclude() {
* @return the ConfigDataInner object itself.
*/
public ConfigDataInner withExclude(Boolean exclude) {
- this.exclude = exclude;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ConfigDataProperties();
+ }
+ this.innerProperties().withExclude(exclude);
return this;
}
@@ -67,7 +63,7 @@ public ConfigDataInner withExclude(Boolean exclude) {
* @return the lowCpuThreshold value.
*/
public CpuThreshold lowCpuThreshold() {
- return this.lowCpuThreshold;
+ return this.innerProperties() == null ? null : this.innerProperties().lowCpuThreshold();
}
/**
@@ -78,7 +74,10 @@ public CpuThreshold lowCpuThreshold() {
* @return the ConfigDataInner object itself.
*/
public ConfigDataInner withLowCpuThreshold(CpuThreshold lowCpuThreshold) {
- this.lowCpuThreshold = lowCpuThreshold;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ConfigDataProperties();
+ }
+ this.innerProperties().withLowCpuThreshold(lowCpuThreshold);
return this;
}
@@ -88,7 +87,7 @@ public ConfigDataInner withLowCpuThreshold(CpuThreshold lowCpuThreshold) {
* @return the digests value.
*/
public List digests() {
- return this.digests;
+ return this.innerProperties() == null ? null : this.innerProperties().digests();
}
/**
@@ -98,7 +97,10 @@ public List digests() {
* @return the ConfigDataInner object itself.
*/
public ConfigDataInner withDigests(List digests) {
- this.digests = digests;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ConfigDataProperties();
+ }
+ this.innerProperties().withDigests(digests);
return this;
}
@@ -108,8 +110,8 @@ public ConfigDataInner withDigests(List digests) {
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
- if (digests() != null) {
- digests().forEach(e -> e.validate());
+ if (innerProperties() != null) {
+ innerProperties().validate();
}
}
}
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
new file mode 100644
index 0000000000000..357f9f3096494
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataProperties.java
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.advisor.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.advisor.models.CpuThreshold;
+import com.azure.resourcemanager.advisor.models.DigestConfig;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Configuration data properties. */
+@Fluent
+public final class ConfigDataProperties {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigDataProperties.class);
+
+ /*
+ * 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;
+
+ /*
+ * Advisor digest configuration. Valid only for subscriptions
+ */
+ @JsonProperty(value = "digests")
+ private List digests;
+
+ /**
+ * Get the exclude property: Exclude the resource from Advisor evaluations. Valid values: False (default) or True.
+ *
+ * @return the exclude value.
+ */
+ public Boolean exclude() {
+ return this.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.
+ */
+ public ConfigDataProperties withExclude(Boolean exclude) {
+ this.exclude = exclude;
+ return this;
+ }
+
+ /**
+ * 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() {
+ return this.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.
+ */
+ public ConfigDataProperties withLowCpuThreshold(CpuThreshold lowCpuThreshold) {
+ this.lowCpuThreshold = lowCpuThreshold;
+ return this;
+ }
+
+ /**
+ * Get the digests property: Advisor digest configuration. Valid only for subscriptions.
+ *
+ * @return the digests value.
+ */
+ public List digests() {
+ return this.digests;
+ }
+
+ /**
+ * Set the digests property: Advisor digest configuration. Valid only for subscriptions.
+ *
+ * @param digests the digests value to set.
+ * @return the ConfigDataProperties object itself.
+ */
+ public ConfigDataProperties withDigests(List digests) {
+ this.digests = digests;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (digests() != null) {
+ digests().forEach(e -> e.validate());
+ }
+ }
+}
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 d3152dea8d5cf..b0edf35c27b3d 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,7 +5,6 @@
package com.azure.resourcemanager.advisor.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.annotation.JsonFlatten;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.advisor.models.MetadataSupportedValueDetail;
import com.azure.resourcemanager.advisor.models.Scenario;
@@ -14,9 +13,8 @@
import java.util.List;
/** The metadata entity contract. */
-@JsonFlatten
@Fluent
-public class MetadataEntityInner {
+public final class MetadataEntityInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataEntityInner.class);
/*
@@ -38,28 +36,10 @@ public class MetadataEntityInner {
private String name;
/*
- * The display name.
+ * The metadata entity properties.
*/
- @JsonProperty(value = "properties.displayName")
- private String displayName;
-
- /*
- * The list of keys on which this entity depends on.
- */
- @JsonProperty(value = "properties.dependsOn")
- private List dependsOn;
-
- /*
- * The list of scenarios applicable to this metadata entity.
- */
- @JsonProperty(value = "properties.applicableScenarios")
- private List applicableScenarios;
-
- /*
- * The list of supported values.
- */
- @JsonProperty(value = "properties.supportedValues")
- private List supportedValues;
+ @JsonProperty(value = "properties")
+ private MetadataEntityProperties innerProperties;
/**
* Get the id property: The resource Id of the metadata entity.
@@ -121,13 +101,22 @@ public MetadataEntityInner withName(String name) {
return this;
}
+ /**
+ * Get the innerProperties property: The metadata entity properties.
+ *
+ * @return the innerProperties value.
+ */
+ private MetadataEntityProperties innerProperties() {
+ return this.innerProperties;
+ }
+
/**
* Get the displayName property: The display name.
*
* @return the displayName value.
*/
public String displayName() {
- return this.displayName;
+ return this.innerProperties() == null ? null : this.innerProperties().displayName();
}
/**
@@ -137,7 +126,10 @@ public String displayName() {
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withDisplayName(String displayName) {
- this.displayName = displayName;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MetadataEntityProperties();
+ }
+ this.innerProperties().withDisplayName(displayName);
return this;
}
@@ -147,7 +139,7 @@ public MetadataEntityInner withDisplayName(String displayName) {
* @return the dependsOn value.
*/
public List dependsOn() {
- return this.dependsOn;
+ return this.innerProperties() == null ? null : this.innerProperties().dependsOn();
}
/**
@@ -157,7 +149,10 @@ public List dependsOn() {
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withDependsOn(List dependsOn) {
- this.dependsOn = dependsOn;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MetadataEntityProperties();
+ }
+ this.innerProperties().withDependsOn(dependsOn);
return this;
}
@@ -167,7 +162,7 @@ public MetadataEntityInner withDependsOn(List dependsOn) {
* @return the applicableScenarios value.
*/
public List applicableScenarios() {
- return this.applicableScenarios;
+ return this.innerProperties() == null ? null : this.innerProperties().applicableScenarios();
}
/**
@@ -177,7 +172,10 @@ public List applicableScenarios() {
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withApplicableScenarios(List applicableScenarios) {
- this.applicableScenarios = applicableScenarios;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MetadataEntityProperties();
+ }
+ this.innerProperties().withApplicableScenarios(applicableScenarios);
return this;
}
@@ -187,7 +185,7 @@ public MetadataEntityInner withApplicableScenarios(List applicableScen
* @return the supportedValues value.
*/
public List supportedValues() {
- return this.supportedValues;
+ return this.innerProperties() == null ? null : this.innerProperties().supportedValues();
}
/**
@@ -197,7 +195,10 @@ public List supportedValues() {
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withSupportedValues(List supportedValues) {
- this.supportedValues = supportedValues;
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MetadataEntityProperties();
+ }
+ this.innerProperties().withSupportedValues(supportedValues);
return this;
}
@@ -207,8 +208,8 @@ public MetadataEntityInner withSupportedValues(List e.validate());
+ if (innerProperties() != null) {
+ innerProperties().validate();
}
}
}
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
new file mode 100644
index 0000000000000..fd63d02026972
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityProperties.java
@@ -0,0 +1,134 @@
+// 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.logging.ClientLogger;
+import com.azure.resourcemanager.advisor.models.MetadataSupportedValueDetail;
+import com.azure.resourcemanager.advisor.models.Scenario;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The metadata entity properties. */
+@Fluent
+public final class MetadataEntityProperties {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataEntityProperties.class);
+
+ /*
+ * 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;
+
+ /**
+ * Get the displayName property: The display name.
+ *
+ * @return the displayName value.
+ */
+ public String displayName() {
+ return this.displayName;
+ }
+
+ /**
+ * Set the displayName property: The display name.
+ *
+ * @param displayName the displayName value to set.
+ * @return the MetadataEntityProperties object itself.
+ */
+ public MetadataEntityProperties withDisplayName(String displayName) {
+ this.displayName = displayName;
+ return this;
+ }
+
+ /**
+ * Get the dependsOn property: The list of keys on which this entity depends on.
+ *
+ * @return the dependsOn value.
+ */
+ public List dependsOn() {
+ return this.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.
+ */
+ public MetadataEntityProperties withDependsOn(List dependsOn) {
+ this.dependsOn = dependsOn;
+ return this;
+ }
+
+ /**
+ * Get the applicableScenarios property: The list of scenarios applicable to this metadata entity.
+ *
+ * @return the applicableScenarios value.
+ */
+ public List applicableScenarios() {
+ return this.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.
+ */
+ public MetadataEntityProperties withApplicableScenarios(List applicableScenarios) {
+ this.applicableScenarios = applicableScenarios;
+ return this;
+ }
+
+ /**
+ * Get the supportedValues property: The list of supported values.
+ *
+ * @return the supportedValues value.
+ */
+ public List supportedValues() {
+ return this.supportedValues;
+ }
+
+ /**
+ * Set the supportedValues property: The list of supported values.
+ *
+ * @param supportedValues the supportedValues value to set.
+ * @return the MetadataEntityProperties object itself.
+ */
+ public MetadataEntityProperties withSupportedValues(List supportedValues) {
+ this.supportedValues = supportedValues;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (supportedValues() != null) {
+ supportedValues().forEach(e -> e.validate());
+ }
+ }
+}
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
new file mode 100644
index 0000000000000..56dab7a0aed4b
--- /dev/null
+++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/RecommendationProperties.java
@@ -0,0 +1,542 @@
+// 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.logging.ClientLogger;
+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.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+/** The properties of the recommendation. */
+@Fluent
+public final class RecommendationProperties {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendationProperties.class);
+
+ /*
+ * 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.
+ */
+ @JsonProperty(value = "risk")
+ 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