From f347cdae6d38a1d18904a6ea72c08d3dd179c8b7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 22 Feb 2022 05:47:25 +0000 Subject: [PATCH] CodeGen from PR 17934 in Azure/azure-rest-api-specs Merge 741c5aa12ec912b22f1b4b398c7583573d9cd5da into fe418846b4e61697860238d4a685655768de011e --- .../CHANGELOG.md | 3 +- .../azure-resourcemanager-advisor/README.md | 5 +- .../azure-resourcemanager-advisor/SAMPLE.md | 387 +++++++++++++ .../azure-resourcemanager-advisor/pom.xml | 98 ++-- .../advisor/AdvisorManager.java | 37 +- .../advisor/fluent/ConfigurationsClient.java | 12 +- .../advisor/fluent/OperationsClient.java | 4 +- .../fluent/RecommendationMetadatasClient.java | 6 +- .../advisor/fluent/RecommendationsClient.java | 8 +- .../advisor/fluent/SuppressionsClient.java | 10 +- .../fluent/models/ConfigDataInner.java | 54 +- .../fluent/models/ConfigDataProperties.java | 112 ++++ .../fluent/models/MetadataEntityInner.java | 69 +-- .../models/MetadataEntityProperties.java | 134 +++++ .../models/RecommendationProperties.java | 542 ++++++++++++++++++ .../ResourceRecommendationBaseInner.java | 265 ++++----- .../models/SuppressionContractInner.java | 46 +- .../fluent/models/SuppressionProperties.java | 92 +++ .../ConfigurationsClientImpl.java | 54 +- .../implementation/OperationsClientImpl.java | 16 +- .../RecommendationMetadatasClientImpl.java | 24 +- .../RecommendationsClientImpl.java | 44 +- .../SuppressionsClientImpl.java | 48 +- .../implementation/SuppressionsImpl.java | 2 +- .../advisor/models/Configurations.java | 10 +- .../advisor/models/Operations.java | 4 +- .../models/RecommendationMetadatas.java | 6 +- .../advisor/models/Recommendations.java | 8 +- .../advisor/models/ResourceMetadata.java | 2 + .../advisor/models/Suppressions.java | 14 +- ...gurationsCreateInResourceGroupSamples.java | 51 ++ ...igurationsCreateInSubscriptionSamples.java | 54 ++ ...figurationsListByResourceGroupSamples.java | 22 + .../generated/ConfigurationsListSamples.java | 22 + .../RecommendationMetadataGetSamples.java | 22 + .../RecommendationMetadataListSamples.java | 22 + .../RecommendationsGenerateSamples.java | 22 + ...commendationsGetGenerateStatusSamples.java | 23 + .../generated/RecommendationsGetSamples.java | 22 + .../generated/RecommendationsListSamples.java | 22 + .../generated/SuppressionsCreateSamples.java | 25 + .../generated/SuppressionsDeleteSamples.java | 22 + .../generated/SuppressionsGetSamples.java | 22 + .../generated/SuppressionsListSamples.java | 22 + 44 files changed, 2069 insertions(+), 420 deletions(-) create mode 100644 sdk/advisor/azure-resourcemanager-advisor/SAMPLE.md create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ConfigDataProperties.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/MetadataEntityProperties.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/RecommendationProperties.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/SuppressionProperties.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsCreateInResourceGroupSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsCreateInSubscriptionSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsListByResourceGroupSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsListSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationMetadataGetSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationMetadataListSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGenerateSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGetGenerateStatusSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGetSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsListSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsCreateSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsDeleteSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsGetSamples.java create mode 100644 sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsListSamples.java 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> actions; + + /* + * The automated way to apply recommendation. + */ + @JsonProperty(value = "remediation") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map remediation; + + /* + * The recommendation metadata properties exposed to customer to provide + * additional information. + */ + @JsonProperty(value = "exposedMetadataProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map exposedMetadataProperties; + + /** + * 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 RecommendationProperties object itself. + */ + public RecommendationProperties 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 RecommendationProperties object itself. + */ + public RecommendationProperties 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 RecommendationProperties object itself. + */ + public RecommendationProperties withImpactedField(String impactedField) { + this.impactedField = impactedField; + return this; + } + + /** + * Get the impactedValue property: The resource identified by Advisor. + * + * @return the impactedValue value. + */ + public String impactedValue() { + return this.impactedValue; + } + + /** + * Set the impactedValue property: The resource identified by Advisor. + * + * @param impactedValue the impactedValue value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withImpactedValue(String impactedValue) { + this.impactedValue = impactedValue; + 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 RecommendationProperties object itself. + */ + public RecommendationProperties withLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get the metadata property: The recommendation metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The recommendation metadata. + * + * @param metadata the metadata value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the recommendationTypeId property: The recommendation-type GUID. + * + * @return the recommendationTypeId value. + */ + public String recommendationTypeId() { + return this.recommendationTypeId; + } + + /** + * Set the recommendationTypeId property: The recommendation-type GUID. + * + * @param recommendationTypeId the recommendationTypeId value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withRecommendationTypeId(String recommendationTypeId) { + this.recommendationTypeId = recommendationTypeId; + return this; + } + + /** + * Get the risk property: The potential risk of not implementing the recommendation. + * + * @return the risk value. + */ + public Risk risk() { + return this.risk; + } + + /** + * Set the risk property: The potential risk of not implementing the recommendation. + * + * @param risk the risk value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withRisk(Risk risk) { + this.risk = risk; + 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 RecommendationProperties object itself. + */ + public RecommendationProperties withShortDescription(ShortDescription shortDescription) { + this.shortDescription = shortDescription; + return this; + } + + /** + * Get the suppressionIds property: The list of snoozed and dismissed rules for the recommendation. + * + * @return the suppressionIds value. + */ + public List suppressionIds() { + return this.suppressionIds; + } + + /** + * Set the suppressionIds property: The list of snoozed and dismissed rules for the recommendation. + * + * @param suppressionIds the suppressionIds value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withSuppressionIds(List suppressionIds) { + this.suppressionIds = suppressionIds; + return this; + } + + /** + * Get the extendedProperties property: Extended properties. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Extended properties. + * + * @param extendedProperties the extendedProperties value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withExtendedProperties(Map extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the resourceMetadata property: Metadata of resource that was assessed. + * + * @return the resourceMetadata value. + */ + public ResourceMetadata resourceMetadata() { + return this.resourceMetadata; + } + + /** + * Set the resourceMetadata property: Metadata of resource that was assessed. + * + * @param resourceMetadata the resourceMetadata value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withResourceMetadata(ResourceMetadata resourceMetadata) { + this.resourceMetadata = resourceMetadata; + return this; + } + + /** + * Get the description property: The detailed description of recommendation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The detailed description of recommendation. + * + * @param description the description value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the label property: The label of recommendation. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: The label of recommendation. + * + * @param label the label value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the learnMoreLink property: The link to learn more about recommendation and generation logic. + * + * @return the learnMoreLink value. + */ + public String learnMoreLink() { + return this.learnMoreLink; + } + + /** + * Set the learnMoreLink property: The link to learn more about recommendation and generation logic. + * + * @param learnMoreLink the learnMoreLink value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withLearnMoreLink(String learnMoreLink) { + this.learnMoreLink = learnMoreLink; + return this; + } + + /** + * Get the potentialBenefits property: The potential benefit of implementing recommendation. + * + * @return the potentialBenefits value. + */ + public String potentialBenefits() { + return this.potentialBenefits; + } + + /** + * Set the potentialBenefits property: The potential benefit of implementing recommendation. + * + * @param potentialBenefits the potentialBenefits value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withPotentialBenefits(String potentialBenefits) { + this.potentialBenefits = potentialBenefits; + return this; + } + + /** + * Get the actions property: The list of recommended actions to implement recommendation. + * + * @return the actions value. + */ + public List> actions() { + return this.actions; + } + + /** + * Set the actions property: The list of recommended actions to implement recommendation. + * + * @param actions the actions value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withActions(List> actions) { + this.actions = actions; + return this; + } + + /** + * Get the remediation property: The automated way to apply recommendation. + * + * @return the remediation value. + */ + public Map remediation() { + return this.remediation; + } + + /** + * Set the remediation property: The automated way to apply recommendation. + * + * @param remediation the remediation value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withRemediation(Map remediation) { + this.remediation = remediation; + return this; + } + + /** + * Get the exposedMetadataProperties property: The recommendation metadata properties exposed to customer to provide + * additional information. + * + * @return the exposedMetadataProperties value. + */ + public Map exposedMetadataProperties() { + return this.exposedMetadataProperties; + } + + /** + * Set the exposedMetadataProperties property: The recommendation metadata properties exposed to customer to provide + * additional information. + * + * @param exposedMetadataProperties the exposedMetadataProperties value to set. + * @return the RecommendationProperties object itself. + */ + public RecommendationProperties withExposedMetadataProperties(Map exposedMetadataProperties) { + this.exposedMetadataProperties = exposedMetadataProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (shortDescription() != null) { + shortDescription().validate(); + } + if (resourceMetadata() != null) { + resourceMetadata().validate(); + } + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ResourceRecommendationBaseInner.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ResourceRecommendationBaseInner.java index 086a366593544..f2e33c0f2b0eb 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ResourceRecommendationBaseInner.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/ResourceRecommendationBaseInner.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.Category; @@ -21,126 +20,24 @@ import java.util.UUID; /** Advisor Recommendation. */ -@JsonFlatten @Fluent -public class ResourceRecommendationBaseInner extends ProxyResource { +public final class ResourceRecommendationBaseInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceRecommendationBaseInner.class); /* - * The category of the recommendation. + * The properties of the recommendation. */ - @JsonProperty(value = "properties.category") - private Category category; + @JsonProperty(value = "properties") + private RecommendationProperties innerProperties; - /* - * The business impact of the recommendation. - */ - @JsonProperty(value = "properties.impact") - private Impact impact; - - /* - * The resource type identified by Advisor. - */ - @JsonProperty(value = "properties.impactedField") - private String impactedField; - - /* - * The resource identified by Advisor. - */ - @JsonProperty(value = "properties.impactedValue") - private String impactedValue; - - /* - * The most recent time that Advisor checked the validity of the - * recommendation. - */ - @JsonProperty(value = "properties.lastUpdated") - private OffsetDateTime lastUpdated; - - /* - * The recommendation metadata. - */ - @JsonProperty(value = "properties.metadata") - private Map metadata; - - /* - * The recommendation-type GUID. - */ - @JsonProperty(value = "properties.recommendationTypeId") - private String recommendationTypeId; - - /* - * The potential risk of not implementing the recommendation. - */ - @JsonProperty(value = "properties.risk") - private Risk risk; - - /* - * A summary of the recommendation. - */ - @JsonProperty(value = "properties.shortDescription") - private ShortDescription shortDescription; - - /* - * The list of snoozed and dismissed rules for the recommendation. - */ - @JsonProperty(value = "properties.suppressionIds") - private List suppressionIds; - - /* - * Extended properties - */ - @JsonProperty(value = "properties.extendedProperties") - private Map extendedProperties; - - /* - * Metadata of resource that was assessed - */ - @JsonProperty(value = "properties.resourceMetadata") - private ResourceMetadata resourceMetadata; - - /* - * The detailed description of recommendation. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The label of recommendation. - */ - @JsonProperty(value = "properties.label") - private String label; - - /* - * The link to learn more about recommendation and generation logic. - */ - @JsonProperty(value = "properties.learnMoreLink") - private String learnMoreLink; - - /* - * The potential benefit of implementing recommendation. - */ - @JsonProperty(value = "properties.potentialBenefits") - private String potentialBenefits; - - /* - * The list of recommended actions to implement recommendation. - */ - @JsonProperty(value = "properties.actions") - private List> actions; - - /* - * The automated way to apply recommendation. - */ - @JsonProperty(value = "properties.remediation") - private Map remediation; - - /* - * The recommendation metadata properties exposed to customer to provide - * additional information. + /** + * Get the innerProperties property: The properties of the recommendation. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.exposedMetadataProperties") - private Map exposedMetadataProperties; + private RecommendationProperties innerProperties() { + return this.innerProperties; + } /** * Get the category property: The category of the recommendation. @@ -148,7 +45,7 @@ public class ResourceRecommendationBaseInner extends ProxyResource { * @return the category value. */ public Category category() { - return this.category; + return this.innerProperties() == null ? null : this.innerProperties().category(); } /** @@ -158,7 +55,10 @@ public Category category() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withCategory(Category category) { - this.category = category; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withCategory(category); return this; } @@ -168,7 +68,7 @@ public ResourceRecommendationBaseInner withCategory(Category category) { * @return the impact value. */ public Impact impact() { - return this.impact; + return this.innerProperties() == null ? null : this.innerProperties().impact(); } /** @@ -178,7 +78,10 @@ public Impact impact() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withImpact(Impact impact) { - this.impact = impact; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withImpact(impact); return this; } @@ -188,7 +91,7 @@ public ResourceRecommendationBaseInner withImpact(Impact impact) { * @return the impactedField value. */ public String impactedField() { - return this.impactedField; + return this.innerProperties() == null ? null : this.innerProperties().impactedField(); } /** @@ -198,7 +101,10 @@ public String impactedField() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withImpactedField(String impactedField) { - this.impactedField = impactedField; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withImpactedField(impactedField); return this; } @@ -208,7 +114,7 @@ public ResourceRecommendationBaseInner withImpactedField(String impactedField) { * @return the impactedValue value. */ public String impactedValue() { - return this.impactedValue; + return this.innerProperties() == null ? null : this.innerProperties().impactedValue(); } /** @@ -218,7 +124,10 @@ public String impactedValue() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withImpactedValue(String impactedValue) { - this.impactedValue = impactedValue; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withImpactedValue(impactedValue); return this; } @@ -228,7 +137,7 @@ public ResourceRecommendationBaseInner withImpactedValue(String impactedValue) { * @return the lastUpdated value. */ public OffsetDateTime lastUpdated() { - return this.lastUpdated; + return this.innerProperties() == null ? null : this.innerProperties().lastUpdated(); } /** @@ -238,7 +147,10 @@ public OffsetDateTime lastUpdated() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withLastUpdated(OffsetDateTime lastUpdated) { - this.lastUpdated = lastUpdated; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withLastUpdated(lastUpdated); return this; } @@ -248,7 +160,7 @@ public ResourceRecommendationBaseInner withLastUpdated(OffsetDateTime lastUpdate * @return the metadata value. */ public Map metadata() { - return this.metadata; + return this.innerProperties() == null ? null : this.innerProperties().metadata(); } /** @@ -258,7 +170,10 @@ public Map metadata() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withMetadata(Map metadata) { - this.metadata = metadata; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withMetadata(metadata); return this; } @@ -268,7 +183,7 @@ public ResourceRecommendationBaseInner withMetadata(Map metadata * @return the recommendationTypeId value. */ public String recommendationTypeId() { - return this.recommendationTypeId; + return this.innerProperties() == null ? null : this.innerProperties().recommendationTypeId(); } /** @@ -278,7 +193,10 @@ public String recommendationTypeId() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withRecommendationTypeId(String recommendationTypeId) { - this.recommendationTypeId = recommendationTypeId; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withRecommendationTypeId(recommendationTypeId); return this; } @@ -288,7 +206,7 @@ public ResourceRecommendationBaseInner withRecommendationTypeId(String recommend * @return the risk value. */ public Risk risk() { - return this.risk; + return this.innerProperties() == null ? null : this.innerProperties().risk(); } /** @@ -298,7 +216,10 @@ public Risk risk() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withRisk(Risk risk) { - this.risk = risk; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withRisk(risk); return this; } @@ -308,7 +229,7 @@ public ResourceRecommendationBaseInner withRisk(Risk risk) { * @return the shortDescription value. */ public ShortDescription shortDescription() { - return this.shortDescription; + return this.innerProperties() == null ? null : this.innerProperties().shortDescription(); } /** @@ -318,7 +239,10 @@ public ShortDescription shortDescription() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withShortDescription(ShortDescription shortDescription) { - this.shortDescription = shortDescription; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withShortDescription(shortDescription); return this; } @@ -328,7 +252,7 @@ public ResourceRecommendationBaseInner withShortDescription(ShortDescription sho * @return the suppressionIds value. */ public List suppressionIds() { - return this.suppressionIds; + return this.innerProperties() == null ? null : this.innerProperties().suppressionIds(); } /** @@ -338,7 +262,10 @@ public List suppressionIds() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withSuppressionIds(List suppressionIds) { - this.suppressionIds = suppressionIds; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withSuppressionIds(suppressionIds); return this; } @@ -348,7 +275,7 @@ public ResourceRecommendationBaseInner withSuppressionIds(List suppression * @return the extendedProperties value. */ public Map extendedProperties() { - return this.extendedProperties; + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); } /** @@ -358,7 +285,10 @@ public Map extendedProperties() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withExtendedProperties(Map extendedProperties) { - this.extendedProperties = extendedProperties; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withExtendedProperties(extendedProperties); return this; } @@ -368,7 +298,7 @@ public ResourceRecommendationBaseInner withExtendedProperties(Map> actions() { - return this.actions; + return this.innerProperties() == null ? null : this.innerProperties().actions(); } /** @@ -478,7 +423,10 @@ public List> actions() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withActions(List> actions) { - this.actions = actions; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withActions(actions); return this; } @@ -488,7 +436,7 @@ public ResourceRecommendationBaseInner withActions(List> act * @return the remediation value. */ public Map remediation() { - return this.remediation; + return this.innerProperties() == null ? null : this.innerProperties().remediation(); } /** @@ -498,7 +446,10 @@ public Map remediation() { * @return the ResourceRecommendationBaseInner object itself. */ public ResourceRecommendationBaseInner withRemediation(Map remediation) { - this.remediation = remediation; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withRemediation(remediation); return this; } @@ -509,7 +460,7 @@ public ResourceRecommendationBaseInner withRemediation(Map remed * @return the exposedMetadataProperties value. */ public Map exposedMetadataProperties() { - return this.exposedMetadataProperties; + return this.innerProperties() == null ? null : this.innerProperties().exposedMetadataProperties(); } /** @@ -521,7 +472,10 @@ public Map exposedMetadataProperties() { */ public ResourceRecommendationBaseInner withExposedMetadataProperties( Map exposedMetadataProperties) { - this.exposedMetadataProperties = exposedMetadataProperties; + if (this.innerProperties() == null) { + this.innerProperties = new RecommendationProperties(); + } + this.innerProperties().withExposedMetadataProperties(exposedMetadataProperties); return this; } @@ -531,11 +485,8 @@ public ResourceRecommendationBaseInner withExposedMetadataProperties( * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (shortDescription() != null) { - shortDescription().validate(); - } - if (resourceMetadata() != null) { - resourceMetadata().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/SuppressionContractInner.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/SuppressionContractInner.java index 5c3af5862bffa..ef413ed3c73f3 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/SuppressionContractInner.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/SuppressionContractInner.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.fasterxml.jackson.annotation.JsonIgnore; @@ -13,28 +12,24 @@ import java.time.OffsetDateTime; /** The details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with the rule. */ -@JsonFlatten @Fluent -public class SuppressionContractInner extends ProxyResource { +public final class SuppressionContractInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SuppressionContractInner.class); /* - * The GUID of the suppression. + * The properties of the suppression. */ - @JsonProperty(value = "properties.suppressionId") - private String suppressionId; + @JsonProperty(value = "properties") + private SuppressionProperties innerProperties; - /* - * The duration for which the suppression is valid. - */ - @JsonProperty(value = "properties.ttl") - private String ttl; - - /* - * Gets or sets the expiration time stamp. + /** + * Get the innerProperties property: The properties of the suppression. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.expirationTimeStamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expirationTimestamp; + private SuppressionProperties innerProperties() { + return this.innerProperties; + } /** * Get the suppressionId property: The GUID of the suppression. @@ -42,7 +37,7 @@ public class SuppressionContractInner extends ProxyResource { * @return the suppressionId value. */ public String suppressionId() { - return this.suppressionId; + return this.innerProperties() == null ? null : this.innerProperties().suppressionId(); } /** @@ -52,7 +47,10 @@ public String suppressionId() { * @return the SuppressionContractInner object itself. */ public SuppressionContractInner withSuppressionId(String suppressionId) { - this.suppressionId = suppressionId; + if (this.innerProperties() == null) { + this.innerProperties = new SuppressionProperties(); + } + this.innerProperties().withSuppressionId(suppressionId); return this; } @@ -62,7 +60,7 @@ public SuppressionContractInner withSuppressionId(String suppressionId) { * @return the ttl value. */ public String ttl() { - return this.ttl; + return this.innerProperties() == null ? null : this.innerProperties().ttl(); } /** @@ -72,7 +70,10 @@ public String ttl() { * @return the SuppressionContractInner object itself. */ public SuppressionContractInner withTtl(String ttl) { - this.ttl = ttl; + if (this.innerProperties() == null) { + this.innerProperties = new SuppressionProperties(); + } + this.innerProperties().withTtl(ttl); return this; } @@ -82,7 +83,7 @@ public SuppressionContractInner withTtl(String ttl) { * @return the expirationTimestamp value. */ public OffsetDateTime expirationTimestamp() { - return this.expirationTimestamp; + return this.innerProperties() == null ? null : this.innerProperties().expirationTimestamp(); } /** @@ -91,5 +92,8 @@ public OffsetDateTime expirationTimestamp() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/SuppressionProperties.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/SuppressionProperties.java new file mode 100644 index 0000000000000..49bb74b067931 --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/fluent/models/SuppressionProperties.java @@ -0,0 +1,92 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of the suppression. */ +@Fluent +public final class SuppressionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SuppressionProperties.class); + + /* + * The GUID of the suppression. + */ + @JsonProperty(value = "suppressionId") + private String suppressionId; + + /* + * The duration for which the suppression is valid. + */ + @JsonProperty(value = "ttl") + private String ttl; + + /* + * Gets or sets the expiration time stamp. + */ + @JsonProperty(value = "expirationTimeStamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime expirationTimestamp; + + /** + * Get the suppressionId property: The GUID of the suppression. + * + * @return the suppressionId value. + */ + public String suppressionId() { + return this.suppressionId; + } + + /** + * Set the suppressionId property: The GUID of the suppression. + * + * @param suppressionId the suppressionId value to set. + * @return the SuppressionProperties object itself. + */ + public SuppressionProperties withSuppressionId(String suppressionId) { + this.suppressionId = suppressionId; + return this; + } + + /** + * Get the ttl property: The duration for which the suppression is valid. + * + * @return the ttl value. + */ + public String ttl() { + return this.ttl; + } + + /** + * Set the ttl property: The duration for which the suppression is valid. + * + * @param ttl the ttl value to set. + * @return the SuppressionProperties object itself. + */ + public SuppressionProperties withTtl(String ttl) { + this.ttl = ttl; + return this; + } + + /** + * Get the expirationTimestamp property: Gets or sets the expiration time stamp. + * + * @return the expirationTimestamp value. + */ + public OffsetDateTime expirationTimestamp() { + return this.expirationTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/ConfigurationsClientImpl.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/ConfigurationsClientImpl.java index e60ffbb812b0f..fcca140b9d9f7 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/ConfigurationsClientImpl.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/ConfigurationsClientImpl.java @@ -131,7 +131,8 @@ Mono> listBySubscriptionNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -177,7 +178,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -218,7 +220,7 @@ private Mono> listSinglePageAsync(Context context * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -233,7 +235,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -246,7 +248,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -260,7 +262,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -275,7 +277,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advisor configuration data structure. + * @return the Advisor configuration data structure along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createInSubscriptionWithResponseAsync( @@ -326,7 +329,8 @@ private Mono> createInSubscriptionWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advisor configuration data structure. + * @return the Advisor configuration data structure along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createInSubscriptionWithResponseAsync( @@ -373,7 +377,7 @@ private Mono> createInSubscriptionWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advisor configuration data structure. + * @return the Advisor configuration data structure on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createInSubscriptionAsync( @@ -413,7 +417,7 @@ public ConfigDataInner createInSubscription(ConfigurationName configurationName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advisor configuration data structure. + * @return the Advisor configuration data structure along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createInSubscriptionWithResponse( @@ -428,7 +432,8 @@ public Response createInSubscriptionWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroup) { @@ -474,7 +479,8 @@ private Mono> listByResourceGroupSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -517,7 +523,7 @@ private Mono> listByResourceGroupSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroup) { @@ -532,7 +538,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroup, Context context) { @@ -546,7 +552,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroup) { @@ -561,7 +567,7 @@ public PagedIterable listByResourceGroup(String resourceGroup) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroup, Context context) { @@ -577,7 +583,8 @@ public PagedIterable listByResourceGroup(String resourceGroup, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advisor configuration data structure. + * @return the Advisor configuration data structure along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createInResourceGroupWithResponseAsync( @@ -633,7 +640,8 @@ private Mono> createInResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advisor configuration data structure. + * @return the Advisor configuration data structure along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createInResourceGroupWithResponseAsync( @@ -685,7 +693,7 @@ private Mono> createInResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advisor configuration data structure. + * @return the Advisor configuration data structure on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createInResourceGroupAsync( @@ -728,7 +736,7 @@ public ConfigDataInner createInResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advisor configuration data structure. + * @return the Advisor configuration data structure along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createInResourceGroupWithResponse( @@ -744,7 +752,8 @@ public Response createInResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -781,7 +790,8 @@ private Mono> listBySubscriptionNextSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor configurations. + * @return the list of Advisor configurations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync( diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/OperationsClientImpl.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/OperationsClientImpl.java index 2adb2375bdf21..fa1a8d1320c22 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/OperationsClientImpl.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/OperationsClientImpl.java @@ -85,7 +85,7 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor operations. + * @return the list of Advisor operations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +118,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor operations. + * @return the list of Advisor operations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +148,7 @@ private Mono> listSinglePageAsync(Context co * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor operations. + * @return the list of Advisor operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +162,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor operations. + * @return the list of Advisor operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +175,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor operations. + * @return the list of Advisor operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +189,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor operations. + * @return the list of Advisor operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +203,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor operations. + * @return the list of Advisor operations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +239,7 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor operations. + * @return the list of Advisor operations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/RecommendationMetadatasClientImpl.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/RecommendationMetadatasClientImpl.java index 2bceb5ca9366d..e258b0139c22f 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/RecommendationMetadatasClientImpl.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/RecommendationMetadatasClientImpl.java @@ -99,7 +99,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata entity. + * @return the metadata entity along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String name) { @@ -127,7 +127,7 @@ private Mono> getWithResponseAsync(String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata entity. + * @return the metadata entity along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String name, Context context) { @@ -152,7 +152,7 @@ private Mono> getWithResponseAsync(String name, Co * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata entity. + * @return the metadata entity on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String name) { @@ -189,7 +189,7 @@ public MetadataEntityInner get(String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata entity. + * @return the metadata entity along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String name, Context context) { @@ -201,7 +201,7 @@ public Response getWithResponse(String name, Context contex * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -234,7 +234,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -264,7 +264,7 @@ private Mono> listSinglePageAsync(Context con * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -278,7 +278,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -291,7 +291,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -305,7 +305,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -319,7 +319,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -355,7 +355,7 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of metadata entities. + * @return the list of metadata entities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/RecommendationsClientImpl.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/RecommendationsClientImpl.java index 05a2b266dcd96..5c3c626dc9923 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/RecommendationsClientImpl.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/RecommendationsClientImpl.java @@ -128,7 +128,7 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono generateWithResponseAsync() { @@ -166,7 +166,7 @@ private Mono generateWithResponseAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono generateWithResponseAsync(Context context) { @@ -199,7 +199,7 @@ private Mono generateWithResponseAsync(Context * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono generateAsync() { @@ -242,7 +242,7 @@ public RecommendationsGenerateResponse generateWithResponse(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getGenerateStatusWithResponseAsync(UUID operationId) { @@ -286,7 +286,7 @@ private Mono> getGenerateStatusWithResponseAsync(UUID operationId * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getGenerateStatusWithResponseAsync(UUID operationId, Context context) { @@ -326,7 +326,7 @@ private Mono> getGenerateStatusWithResponseAsync(UUID operationId * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getGenerateStatusAsync(UUID operationId) { @@ -358,7 +358,7 @@ public void getGenerateStatus(UUID operationId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getGenerateStatusWithResponse(UUID operationId, Context context) { @@ -377,7 +377,8 @@ public Response getGenerateStatusWithResponse(UUID operationId, Context co * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor recommendations. + * @return the list of Advisor recommendations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -433,7 +434,8 @@ private Mono> listSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor recommendations. + * @return the list of Advisor recommendations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -485,7 +487,7 @@ private Mono> listSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor recommendations. + * @return the list of Advisor recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, Integer top, String skipToken) { @@ -499,7 +501,7 @@ private PagedFlux listAsync(String filter, Inte * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor recommendations. + * @return the list of Advisor recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -523,7 +525,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor recommendations. + * @return the list of Advisor recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -539,7 +541,7 @@ private PagedFlux listAsync( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor recommendations. + * @return the list of Advisor recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -562,7 +564,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor recommendations. + * @return the list of Advisor recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -579,7 +581,7 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return advisor Recommendation. + * @return advisor Recommendation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -622,7 +624,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return advisor Recommendation. + * @return advisor Recommendation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -656,7 +658,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return advisor Recommendation. + * @return advisor Recommendation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceUri, String recommendationId) { @@ -697,7 +699,7 @@ public ResourceRecommendationBaseInner get(String resourceUri, String recommenda * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return advisor Recommendation. + * @return advisor Recommendation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -712,7 +714,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor recommendations. + * @return the list of Advisor recommendations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -748,7 +751,8 @@ private Mono> listNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor recommendations. + * @return the list of Advisor recommendations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/SuppressionsClientImpl.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/SuppressionsClientImpl.java index d1b8fce38d23d..b7f9814227dc9 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/SuppressionsClientImpl.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/SuppressionsClientImpl.java @@ -77,7 +77,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put("/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}") - @ExpectedResponses({200, 404}) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> create( @HostParam("$host") String endpoint, @@ -137,7 +137,7 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with - * the rule. + * the rule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -186,7 +186,7 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with - * the rule. + * the rule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -231,7 +231,7 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with - * the rule. + * the rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceUri, String recommendationId, String name) { @@ -276,7 +276,7 @@ public SuppressionContractInner get(String resourceUri, String recommendationId, * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the 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) public Response getWithResponse( @@ -297,7 +297,7 @@ public Response getWithResponse( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with - * the rule. + * the rule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -355,7 +355,7 @@ private Mono> createWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with - * the rule. + * the rule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -413,7 +413,7 @@ private Mono> createWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with - * the rule. + * the rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -464,7 +464,7 @@ public SuppressionContractInner create( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the 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) public Response createWithResponse( @@ -487,7 +487,7 @@ public Response createWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceUri, String recommendationId, String name) { @@ -535,7 +535,7 @@ private Mono> deleteWithResponseAsync(String resourceUri, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -580,7 +580,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceUri, String recommendationId, String name) { @@ -617,7 +617,7 @@ public void delete(String resourceUri, String recommendationId, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -634,7 +634,8 @@ public Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor suppressions. + * @return the list of Advisor suppressions along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top, String skipToken) { @@ -685,7 +686,8 @@ private Mono> listSinglePageAsync(Intege * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor suppressions. + * @return the list of Advisor suppressions along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -733,7 +735,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor suppressions. + * @return the list of Advisor suppressions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top, String skipToken) { @@ -747,7 +749,7 @@ private PagedFlux listAsync(Integer top, String skipTo * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor suppressions. + * @return the list of Advisor suppressions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -767,7 +769,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor suppressions. + * @return the list of Advisor suppressions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top, String skipToken, Context context) { @@ -781,7 +783,7 @@ private PagedFlux listAsync(Integer top, String skipTo * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor suppressions. + * @return the list of Advisor suppressions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -800,7 +802,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor suppressions. + * @return the list of Advisor suppressions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Integer top, String skipToken, Context context) { @@ -814,7 +816,8 @@ public PagedIterable list(Integer top, String skipToke * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor suppressions. + * @return the list of Advisor suppressions along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -850,7 +853,8 @@ private Mono> listNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Advisor suppressions. + * @return the list of Advisor suppressions along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/SuppressionsImpl.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/SuppressionsImpl.java index 283c7fb4390c3..fd95c67543f50 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/SuppressionsImpl.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/SuppressionsImpl.java @@ -191,7 +191,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'suppressions'.", id))); } - this.deleteWithResponse(resourceUri, recommendationId, name, Context.NONE).getValue(); + this.deleteWithResponse(resourceUri, recommendationId, name, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Configurations.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Configurations.java index a5286a9fea8e4..7a12c082a1485 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Configurations.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Configurations.java @@ -16,7 +16,7 @@ public interface Configurations { * * @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}. */ PagedIterable list(); @@ -27,7 +27,7 @@ public interface Configurations { * @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}. */ PagedIterable list(Context context); @@ -52,7 +52,7 @@ public interface Configurations { * @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}. */ Response createInSubscriptionWithResponse( ConfigurationName configurationName, ConfigDataInner configContract, Context context); @@ -64,7 +64,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}. */ PagedIterable listByResourceGroup(String resourceGroup); @@ -76,7 +76,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}. */ PagedIterable listByResourceGroup(String resourceGroup, Context context); diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Operations.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Operations.java index 4b4efb5e1a862..e0ee34e42e6a7 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Operations.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Operations.java @@ -14,7 +14,7 @@ public interface 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. + * @return the list of Advisor operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @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}. */ PagedIterable list(Context context); } diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/RecommendationMetadatas.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/RecommendationMetadatas.java index d23c28c2a057f..fa717534bc33c 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/RecommendationMetadatas.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/RecommendationMetadatas.java @@ -29,7 +29,7 @@ public interface RecommendationMetadatas { * @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}. */ Response getWithResponse(String name, Context context); @@ -38,7 +38,7 @@ public interface RecommendationMetadatas { * * @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}. */ PagedIterable list(); @@ -49,7 +49,7 @@ public interface RecommendationMetadatas { * @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}. */ PagedIterable list(Context context); } diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Recommendations.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Recommendations.java index 06b3c33000f2f..76c5879ae0e0a 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Recommendations.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Recommendations.java @@ -54,7 +54,7 @@ public interface Recommendations { * @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}. */ Response getGenerateStatusWithResponse(UUID operationId, Context context); @@ -64,7 +64,7 @@ public interface Recommendations { * * @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}. */ PagedIterable list(); @@ -81,7 +81,7 @@ public interface Recommendations { * @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}. */ PagedIterable list(String filter, Integer top, String skipToken, Context context); @@ -108,7 +108,7 @@ public interface Recommendations { * @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}. */ Response getWithResponse(String resourceUri, String recommendationId, Context context); } diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/ResourceMetadata.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/ResourceMetadata.java index 85d9d75b5e110..53176292497eb 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/ResourceMetadata.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/ResourceMetadata.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -31,6 +32,7 @@ public final class ResourceMetadata { * The action to view resource. */ @JsonProperty(value = "action") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map action; /* diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Suppressions.java b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Suppressions.java index eda1c637fde5c..7d6bdbc8e8758 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Suppressions.java +++ b/sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/models/Suppressions.java @@ -37,7 +37,7 @@ public interface Suppressions { * @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}. */ Response getWithResponse( String resourceUri, String recommendationId, String name, Context context); @@ -68,7 +68,7 @@ Response getWithResponse( * @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}. */ Response deleteWithResponse(String resourceUri, String recommendationId, String name, Context context); @@ -78,7 +78,7 @@ Response getWithResponse( * * @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}. */ PagedIterable list(); @@ -92,7 +92,7 @@ Response getWithResponse( * @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}. */ PagedIterable list(Integer top, String skipToken, Context context); @@ -104,7 +104,7 @@ Response getWithResponse( * @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}. */ SuppressionContract getById(String id); @@ -117,7 +117,7 @@ Response getWithResponse( * @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}. */ Response getByIdWithResponse(String id, Context context); @@ -141,7 +141,7 @@ Response getWithResponse( * @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}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsCreateInResourceGroupSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsCreateInResourceGroupSamples.java new file mode 100644 index 0000000000000..b546b9b94783b --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsCreateInResourceGroupSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.advisor.generated; + +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(); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsCreateInSubscriptionSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsCreateInSubscriptionSamples.java new file mode 100644 index 0000000000000..c80891684f7ee --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsCreateInSubscriptionSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.advisor.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsListByResourceGroupSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..16a18eaa02f7a --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsListSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsListSamples.java new file mode 100644 index 0000000000000..a52ea1d18c1b5 --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/ConfigurationsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationMetadataGetSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationMetadataGetSamples.java new file mode 100644 index 0000000000000..ac64d17525a73 --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationMetadataGetSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationMetadataListSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationMetadataListSamples.java new file mode 100644 index 0000000000000..91624f7134020 --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationMetadataListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGenerateSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGenerateSamples.java new file mode 100644 index 0000000000000..027d2adae3e2c --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGenerateSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGetGenerateStatusSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGetGenerateStatusSamples.java new file mode 100644 index 0000000000000..79f3a587f93cb --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGetGenerateStatusSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGetSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGetSamples.java new file mode 100644 index 0000000000000..38a67bb7f2af0 --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsGetSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsListSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsListSamples.java new file mode 100644 index 0000000000000..d6067cd83a32c --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/RecommendationsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsCreateSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsCreateSamples.java new file mode 100644 index 0000000000000..2d09338340732 --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsCreateSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +/** 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(); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsDeleteSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsDeleteSamples.java new file mode 100644 index 0000000000000..00ed87e55f0b5 --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsGetSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsGetSamples.java new file mode 100644 index 0000000000000..66178329beff6 --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsGetSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +} diff --git a/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsListSamples.java b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsListSamples.java new file mode 100644 index 0000000000000..459b99a7784b1 --- /dev/null +++ b/sdk/advisor/azure-resourcemanager-advisor/src/samples/java/com/azure/resourcemanager/advisor/generated/SuppressionsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +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); + } +}