From bfd042782ef67b0f548072b074db6af9a1f80f29 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 22 Jan 2020 01:46:48 +0000 Subject: [PATCH] Generated from a68f0b4be03e6118b3e89e214366538ae00c457e reference common type ErrorResponse --- sdk/mariadb/mgmt-v2018_06_01/pom.xml | 6 +- .../mariadb/v2018_06_01/Advisor.java | 42 + .../mariadb/v2018_06_01/Advisors.java | 40 + .../v2018_06_01/AzureEntityResource.java | 34 + .../mariadb/v2018_06_01/Configuration.java | 2 +- .../mariadb/v2018_06_01/Configurations.java | 4 +- .../mariadb/v2018_06_01/Database.java | 2 +- .../mariadb/v2018_06_01/Databases.java | 6 +- .../v2018_06_01/ErrorAdditionalInfo.java | 47 + .../mariadb/v2018_06_01/ErrorResponse.java | 93 ++ .../mariadb/v2018_06_01/FirewallRule.java | 2 +- .../mariadb/v2018_06_01/FirewallRules.java | 6 +- .../LocationBasedPerformanceTiers.java | 5 +- ...ommendedActionSessionsOperationStatus.java | 29 + ...BasedRecommendedActionSessionsResults.java | 29 + .../mariadb/v2018_06_01/LogFiles.java | 2 +- .../PrivateEndpointConnection.java | 151 +++ .../PrivateEndpointConnections.java | 53 + .../v2018_06_01/PrivateEndpointProperty.java | 43 + .../v2018_06_01/PrivateLinkResource.java | 42 + .../PrivateLinkResourceProperties.java | 48 + .../v2018_06_01/PrivateLinkResources.java | 40 + ...ateLinkServiceConnectionStateProperty.java | 84 ++ .../mariadb/v2018_06_01/QueryStatistic.java | 89 ++ .../mariadb/v2018_06_01/QueryText.java | 47 + .../mariadb/v2018_06_01/QueryTexts.java | 41 + .../v2018_06_01/RecommendationAction.java | 79 ++ ...ommendedActionSessionsOperationStatus.java | 36 + .../v2018_06_01/RecommendedActions.java | 42 + .../mariadb/v2018_06_01/Replicas.java | 2 +- .../ServerPropertiesForCreate.java | 2 +- .../ServerPropertiesForDefaultCreate.java | 2 +- .../ServerPropertiesForGeoRestore.java | 2 +- .../ServerPropertiesForReplica.java | 2 +- .../ServerPropertiesForRestore.java | 2 +- .../ServerSecurityAlertPolicies.java | 2 +- .../ServerSecurityAlertPolicy.java | 2 +- .../mariadb/v2018_06_01/Servers.java | 2 +- .../mariadb/v2018_06_01/TagsObject.java | 44 + .../v2018_06_01/TopQueryStatistics.java | 41 + .../v2018_06_01/TopQueryStatisticsInput.java | 176 +++ .../v2018_06_01/VirtualNetworkRule.java | 2 +- .../v2018_06_01/VirtualNetworkRules.java | 6 +- .../mariadb/v2018_06_01/WaitStatistic.java | 83 ++ .../mariadb/v2018_06_01/WaitStatistics.java | 41 + .../v2018_06_01/WaitStatisticsInput.java | 98 ++ .../implementation/AdvisorImpl.java | 63 + .../implementation/AdvisorInner.java | 44 + .../implementation/AdvisorsImpl.java | 69 + .../implementation/AdvisorsInner.java | 401 ++++++ .../implementation/ConfigurationsImpl.java | 10 +- .../implementation/ConfigurationsInner.java | 32 +- .../implementation/DatabasesImpl.java | 10 +- .../implementation/DatabasesInner.java | 48 +- .../implementation/FirewallRulesImpl.java | 10 +- .../implementation/FirewallRulesInner.java | 48 +- .../LocationBasedPerformanceTiersImpl.java | 6 +- ...ndedActionSessionsOperationStatusImpl.java | 42 + ...dedActionSessionsOperationStatusInner.java | 146 +++ ...dRecommendedActionSessionsResultsImpl.java | 49 + ...RecommendedActionSessionsResultsInner.java | 305 +++++ .../implementation/LogFilesInner.java | 8 +- .../MariaDBManagementClientImpl.java | 376 +++++- .../implementation/MariaDBManager.java | 108 ++ .../PrivateEndpointConnectionImpl.java | 123 ++ .../PrivateEndpointConnectionInner.java | 89 ++ .../PrivateEndpointConnectionsImpl.java | 85 ++ .../PrivateEndpointConnectionsInner.java | 1153 +++++++++++++++++ .../PrivateLinkResourceImpl.java | 64 + .../PrivateLinkResourceInner.java | 34 + .../PrivateLinkResourcesImpl.java | 69 + .../PrivateLinkResourcesInner.java | 401 ++++++ .../implementation/QueryStatisticImpl.java | 110 ++ .../implementation/QueryStatisticInner.java | 282 ++++ .../implementation/QueryTextImpl.java | 68 + .../implementation/QueryTextInner.java | 72 + .../implementation/QueryTextsImpl.java | 69 + .../implementation/QueryTextsInner.java | 413 ++++++ .../RecommendationActionImpl.java | 102 ++ .../RecommendationActionInner.java | 230 ++++ ...ndedActionSessionsOperationStatusImpl.java | 42 + ...dedActionSessionsOperationStatusInner.java | 96 ++ .../RecommendedActionsImpl.java | 69 + .../RecommendedActionsInner.java | 546 ++++++++ .../implementation/ReplicasInner.java | 8 +- .../ServerSecurityAlertPoliciesImpl.java | 10 +- .../ServerSecurityAlertPoliciesInner.java | 24 +- .../implementation/ServersInner.java | 80 +- .../TopQueryStatisticsImpl.java | 69 + .../TopQueryStatisticsInner.java | 413 ++++++ .../VirtualNetworkRulesImpl.java | 10 +- .../VirtualNetworkRulesInner.java | 50 +- .../implementation/WaitStatisticImpl.java | 104 ++ .../implementation/WaitStatisticInner.java | 255 ++++ .../implementation/WaitStatisticsImpl.java | 69 + .../implementation/WaitStatisticsInner.java | 413 ++++++ 96 files changed, 8839 insertions(+), 211 deletions(-) create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Advisor.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Advisors.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/AzureEntityResource.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ErrorAdditionalInfo.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ErrorResponse.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedRecommendedActionSessionsOperationStatus.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedRecommendedActionSessionsResults.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointConnection.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointConnections.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointProperty.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResource.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResourceProperties.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResources.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkServiceConnectionStateProperty.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryStatistic.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryText.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryTexts.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendationAction.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendedActionSessionsOperationStatus.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendedActions.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TagsObject.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TopQueryStatistics.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TopQueryStatisticsInput.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/WaitStatistic.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/WaitStatistics.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/WaitStatisticsInput.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorsImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorsInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsResultsInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionsInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourceInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourcesInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryStatisticImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryStatisticInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextsImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextsInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendationActionImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendationActionInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionSessionsOperationStatusImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionSessionsOperationStatusInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionsImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionsInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/TopQueryStatisticsImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/TopQueryStatisticsInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticInner.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticsImpl.java create mode 100644 sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticsInner.java diff --git a/sdk/mariadb/mgmt-v2018_06_01/pom.xml b/sdk/mariadb/mgmt-v2018_06_01/pom.xml index 740ca60c95ff..bdd75e9fd37c 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/pom.xml +++ b/sdk/mariadb/mgmt-v2018_06_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.2.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-mariadb - 1.0.0-beta-1 + 1.0.0-beta jar Microsoft Azure SDK for MariaDB Management This package contains Microsoft MariaDB Management SDK. @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Advisor.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Advisor.java new file mode 100644 index 000000000000..d69cb7a1b039 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Advisor.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.AdvisorInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.MariaDBManager; + +/** + * Type representing Advisor. + */ +public interface Advisor extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + Object properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Advisors.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Advisors.java new file mode 100644 index 000000000000..49b6865bfdc4 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Advisors.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.AdvisorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Advisors. + */ +public interface Advisors extends HasInner { + /** + * Get a recommendation action advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String advisorName); + + /** + * List recommendation action advisors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(final String resourceGroupName, final String serverName); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/AzureEntityResource.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/AzureEntityResource.java new file mode 100644 index 000000000000..6ce81fd6ddd9 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configuration.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configuration.java index b4ae224811e1..5a2c736ee9bb 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configuration.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configuration.java @@ -89,7 +89,7 @@ interface Blank extends WithServer { interface WithServer { /** * Specifies resourceGroupName, serverName. - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param serverName The name of the server * @return the next definition stage */ diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configurations.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configurations.java index 4467a872d5d2..d31ade11bd17 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configurations.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configurations.java @@ -20,7 +20,7 @@ public interface Configurations extends SupportsCreating details; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRule.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRule.java index 37417631f90b..ae33fc6f463a 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRule.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRule.java @@ -69,7 +69,7 @@ interface Blank extends WithServer { interface WithServer { /** * Specifies resourceGroupName, serverName. - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param serverName The name of the server * @return the next definition stage */ diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRules.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRules.java index 96126962df35..15fa1ae33b2c 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRules.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRules.java @@ -21,7 +21,7 @@ public interface FirewallRules extends SupportsCreating { /** * List all the performance tiers at specified location in a given subscription. * diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedRecommendedActionSessionsOperationStatus.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedRecommendedActionSessionsOperationStatus.java new file mode 100644 index 000000000000..78730a9826ee --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedRecommendedActionSessionsOperationStatus.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.LocationBasedRecommendedActionSessionsOperationStatusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LocationBasedRecommendedActionSessionsOperationStatus. + */ +public interface LocationBasedRecommendedActionSessionsOperationStatus extends HasInner { + /** + * Recommendation action session operation status. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String locationName, String operationId); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedRecommendedActionSessionsResults.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedRecommendedActionSessionsResults.java new file mode 100644 index 000000000000..2ac6ae3515ed --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedRecommendedActionSessionsResults.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.LocationBasedRecommendedActionSessionsResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LocationBasedRecommendedActionSessionsResults. + */ +public interface LocationBasedRecommendedActionSessionsResults extends HasInner { + /** + * Recommendation action session operation result. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String locationName, final String operationId); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFiles.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFiles.java index 346784cc5b88..8c97546611b8 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFiles.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFiles.java @@ -19,7 +19,7 @@ public interface LogFiles extends HasInner { /** * List all the log files in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointConnection.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointConnection.java new file mode 100644 index 000000000000..53b94a9bca71 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointConnection.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.PrivateEndpointConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.MariaDBManager; + +/** + * Type representing PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateEndpoint value. + */ + PrivateEndpointProperty privateEndpoint(); + + /** + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateEndpointConnection definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the privateendpointconnection definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param serverName The name of the server + * @return the next definition stage + */ + WithCreate withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint Private endpoint which the connection belongs to + * @return the next definition stage + */ + WithCreate withPrivateEndpoint(PrivateEndpointProperty privateEndpoint); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState Connection state of the private endpoint connection + * @return the next definition stage + */ + WithCreate withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + } + } + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint Private endpoint which the connection belongs to + * @return the next update stage + */ + Update withPrivateEndpoint(PrivateEndpointProperty privateEndpoint); + } + + /** + * The stage of the privateendpointconnection update allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState Connection state of the private endpoint connection + * @return the next update stage + */ + Update withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState); + } + + } +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointConnections.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointConnections.java new file mode 100644 index 000000000000..af4975590aef --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends SupportsCreating, HasInner { + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName); + + /** + * Gets all private endpoint connections on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(final String resourceGroupName, final String serverName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointProperty.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointProperty.java new file mode 100644 index 000000000000..7a5b5bc81b79 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateEndpointProperty.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PrivateEndpointProperty model. + */ +public class PrivateEndpointProperty { + /** + * Resource id of the private endpoint. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get resource id of the private endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource id of the private endpoint. + * + * @param id the id value to set + * @return the PrivateEndpointProperty object itself. + */ + public PrivateEndpointProperty withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResource.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResource.java new file mode 100644 index 000000000000..0a5c5c4889e7 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResource.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.PrivateLinkResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.MariaDBManager; + +/** + * Type representing PrivateLinkResource. + */ +public interface PrivateLinkResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + PrivateLinkResourceProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResourceProperties.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..68a446218a4f --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResourceProperties.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of a private link resource. + */ +public class PrivateLinkResourceProperties { + /** + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /** + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /** + * Get the private link resource group id. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the private link resource required member names. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResources.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResources.java new file mode 100644 index 000000000000..d339457b29cb --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkResources.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.PrivateLinkResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateLinkResources. + */ +public interface PrivateLinkResources extends HasInner { + /** + * Gets a private link resource for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String groupName); + + /** + * Gets the private link resources for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(final String resourceGroupName, final String serverName); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkServiceConnectionStateProperty.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkServiceConnectionStateProperty.java new file mode 100644 index 000000000000..040a0a108694 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PrivateLinkServiceConnectionStateProperty.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PrivateLinkServiceConnectionStateProperty model. + */ +public class PrivateLinkServiceConnectionStateProperty { + /** + * The private link service connection status. + */ + @JsonProperty(value = "status", required = true) + private String status; + + /** + * The private link service connection description. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /** + * The actions required for private link service connection. + */ + @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) + private String actionsRequired; + + /** + * Get the private link service connection status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the private link service connection status. + * + * @param status the status value to set + * @return the PrivateLinkServiceConnectionStateProperty object itself. + */ + public PrivateLinkServiceConnectionStateProperty withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the private link service connection description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the private link service connection description. + * + * @param description the description value to set + * @return the PrivateLinkServiceConnectionStateProperty object itself. + */ + public PrivateLinkServiceConnectionStateProperty withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actions required for private link service connection. + * + * @return the actionsRequired value + */ + public String actionsRequired() { + return this.actionsRequired; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryStatistic.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryStatistic.java new file mode 100644 index 000000000000..26d1f415a726 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryStatistic.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.QueryStatisticInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.MariaDBManager; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing QueryStatistic. + */ +public interface QueryStatistic extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the aggregationFunction value. + */ + String aggregationFunction(); + + /** + * @return the databaseNames value. + */ + List databaseNames(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the metricDisplayName value. + */ + String metricDisplayName(); + + /** + * @return the metricName value. + */ + String metricName(); + + /** + * @return the metricValue value. + */ + Double metricValue(); + + /** + * @return the metricValueUnit value. + */ + String metricValueUnit(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the queryExecutionCount value. + */ + Long queryExecutionCount(); + + /** + * @return the queryId value. + */ + String queryId(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryText.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryText.java new file mode 100644 index 000000000000..d33fed28652b --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryText.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.QueryTextInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.MariaDBManager; + +/** + * Type representing QueryText. + */ +public interface QueryText extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the queryId value. + */ + String queryId(); + + /** + * @return the queryText value. + */ + String queryText(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryTexts.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryTexts.java new file mode 100644 index 000000000000..9cf438c9cc2d --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/QueryTexts.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.QueryTextsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing QueryTexts. + */ +public interface QueryTexts extends HasInner { + /** + * Retrieve the Query-Store query texts for the queryId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryId The Query-Store query identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String queryId); + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryIds The query identifiers + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(final String resourceGroupName, final String serverName, final List queryIds); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendationAction.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendationAction.java new file mode 100644 index 000000000000..4818d3f35896 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendationAction.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.RecommendationActionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.MariaDBManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing RecommendationAction. + */ +public interface RecommendationAction extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the actionId value. + */ + Integer actionId(); + + /** + * @return the advisorName value. + */ + String advisorName(); + + /** + * @return the createdTime value. + */ + DateTime createdTime(); + + /** + * @return the details value. + */ + Map details(); + + /** + * @return the expirationTime value. + */ + DateTime expirationTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the reason value. + */ + String reason(); + + /** + * @return the recommendationType value. + */ + String recommendationType(); + + /** + * @return the sessionId value. + */ + String sessionId(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendedActionSessionsOperationStatus.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendedActionSessionsOperationStatus.java new file mode 100644 index 000000000000..1eaa07415c94 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendedActionSessionsOperationStatus.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.MariaDBManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.RecommendedActionSessionsOperationStatusInner; +import org.joda.time.DateTime; + +/** + * Type representing RecommendedActionSessionsOperationStatus. + */ +public interface RecommendedActionSessionsOperationStatus extends HasInner, HasManager { + /** + * @return the name value. + */ + String name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + String status(); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendedActions.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendedActions.java new file mode 100644 index 000000000000..6ee33d79afe7 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/RecommendedActions.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.RecommendedActionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RecommendedActions. + */ +public interface RecommendedActions extends HasInner { + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param recommendedActionName The recommended action name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String advisorName, String recommendedActionName); + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(final String resourceGroupName, final String serverName, final String advisorName); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Replicas.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Replicas.java index b40a82aefbab..098662ebc1db 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Replicas.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Replicas.java @@ -19,7 +19,7 @@ public interface Replicas extends HasInner { /** * List all the replicas for a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForCreate.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForCreate.java index ac0b6a154a77..91f4612029a3 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForCreate.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForCreate.java @@ -16,7 +16,7 @@ /** * The properties used to create a new server. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode", defaultImpl = ServerPropertiesForCreate.class) @JsonTypeName("ServerPropertiesForCreate") @JsonSubTypes({ @JsonSubTypes.Type(name = "Default", value = ServerPropertiesForDefaultCreate.class), diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForDefaultCreate.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForDefaultCreate.java index 06c98e671474..1e7a56aa14f8 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForDefaultCreate.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForDefaultCreate.java @@ -15,7 +15,7 @@ /** * The properties used to create a new server. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode", defaultImpl = ServerPropertiesForDefaultCreate.class) @JsonTypeName("Default") public class ServerPropertiesForDefaultCreate extends ServerPropertiesForCreate { /** diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForGeoRestore.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForGeoRestore.java index 841db628f501..40389070b768 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForGeoRestore.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForGeoRestore.java @@ -16,7 +16,7 @@ * The properties used to create a new server by restoring to a different * region from a geo replicated backup. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode", defaultImpl = ServerPropertiesForGeoRestore.class) @JsonTypeName("GeoRestore") public class ServerPropertiesForGeoRestore extends ServerPropertiesForCreate { /** diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForReplica.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForReplica.java index 2cc3741ea975..64109362dca3 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForReplica.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForReplica.java @@ -15,7 +15,7 @@ /** * The properties to create a new replica. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode", defaultImpl = ServerPropertiesForReplica.class) @JsonTypeName("Replica") public class ServerPropertiesForReplica extends ServerPropertiesForCreate { /** diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForRestore.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForRestore.java index 6235e5bc2dba..a8e958e5d3c9 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForRestore.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForRestore.java @@ -16,7 +16,7 @@ /** * The properties used to create a new server by restoring from a backup. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode", defaultImpl = ServerPropertiesForRestore.class) @JsonTypeName("PointInTimeRestore") public class ServerPropertiesForRestore extends ServerPropertiesForCreate { /** diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicies.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicies.java index 80527a8cd225..6fd393896086 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicies.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicies.java @@ -20,7 +20,7 @@ public interface ServerSecurityAlertPolicies extends SupportsCreating /** * Restarts a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TagsObject.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TagsObject.java new file mode 100644 index 000000000000..3f457142cead --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TagsObject.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Tags object for patch operations. + */ +public class TagsObject { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TopQueryStatistics.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TopQueryStatistics.java new file mode 100644 index 000000000000..94140ce1de1b --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TopQueryStatistics.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.TopQueryStatisticsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing TopQueryStatistics. + */ +public interface TopQueryStatistics extends HasInner { + /** + * Retrieve the query statistic for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryStatisticId The Query Statistic identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String queryStatisticId); + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving top query statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(final String resourceGroupName, final String serverName, final TopQueryStatisticsInput parameters); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TopQueryStatisticsInput.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TopQueryStatisticsInput.java new file mode 100644 index 000000000000..8d4b1b0fc22b --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/TopQueryStatisticsInput.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Input to get top query statistics. + */ +@JsonFlatten +public class TopQueryStatisticsInput { + /** + * Max number of top queries to return. + */ + @JsonProperty(value = "properties.numberOfTopQueries", required = true) + private int numberOfTopQueries; + + /** + * Aggregation function name. + */ + @JsonProperty(value = "properties.aggregationFunction", required = true) + private String aggregationFunction; + + /** + * Observed metric name. + */ + @JsonProperty(value = "properties.observedMetric", required = true) + private String observedMetric; + + /** + * Observation start time. + */ + @JsonProperty(value = "properties.observationStartTime", required = true) + private DateTime observationStartTime; + + /** + * Observation end time. + */ + @JsonProperty(value = "properties.observationEndTime", required = true) + private DateTime observationEndTime; + + /** + * Aggregation interval type in ISO 8601 format. + */ + @JsonProperty(value = "properties.aggregationWindow", required = true) + private String aggregationWindow; + + /** + * Get max number of top queries to return. + * + * @return the numberOfTopQueries value + */ + public int numberOfTopQueries() { + return this.numberOfTopQueries; + } + + /** + * Set max number of top queries to return. + * + * @param numberOfTopQueries the numberOfTopQueries value to set + * @return the TopQueryStatisticsInput object itself. + */ + public TopQueryStatisticsInput withNumberOfTopQueries(int numberOfTopQueries) { + this.numberOfTopQueries = numberOfTopQueries; + return this; + } + + /** + * Get aggregation function name. + * + * @return the aggregationFunction value + */ + public String aggregationFunction() { + return this.aggregationFunction; + } + + /** + * Set aggregation function name. + * + * @param aggregationFunction the aggregationFunction value to set + * @return the TopQueryStatisticsInput object itself. + */ + public TopQueryStatisticsInput withAggregationFunction(String aggregationFunction) { + this.aggregationFunction = aggregationFunction; + return this; + } + + /** + * Get observed metric name. + * + * @return the observedMetric value + */ + public String observedMetric() { + return this.observedMetric; + } + + /** + * Set observed metric name. + * + * @param observedMetric the observedMetric value to set + * @return the TopQueryStatisticsInput object itself. + */ + public TopQueryStatisticsInput withObservedMetric(String observedMetric) { + this.observedMetric = observedMetric; + return this; + } + + /** + * Get observation start time. + * + * @return the observationStartTime value + */ + public DateTime observationStartTime() { + return this.observationStartTime; + } + + /** + * Set observation start time. + * + * @param observationStartTime the observationStartTime value to set + * @return the TopQueryStatisticsInput object itself. + */ + public TopQueryStatisticsInput withObservationStartTime(DateTime observationStartTime) { + this.observationStartTime = observationStartTime; + return this; + } + + /** + * Get observation end time. + * + * @return the observationEndTime value + */ + public DateTime observationEndTime() { + return this.observationEndTime; + } + + /** + * Set observation end time. + * + * @param observationEndTime the observationEndTime value to set + * @return the TopQueryStatisticsInput object itself. + */ + public TopQueryStatisticsInput withObservationEndTime(DateTime observationEndTime) { + this.observationEndTime = observationEndTime; + return this; + } + + /** + * Get aggregation interval type in ISO 8601 format. + * + * @return the aggregationWindow value + */ + public String aggregationWindow() { + return this.aggregationWindow; + } + + /** + * Set aggregation interval type in ISO 8601 format. + * + * @param aggregationWindow the aggregationWindow value to set + * @return the TopQueryStatisticsInput object itself. + */ + public TopQueryStatisticsInput withAggregationWindow(String aggregationWindow) { + this.aggregationWindow = aggregationWindow; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRule.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRule.java index 55216ecbd7a3..1ca74a61a806 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRule.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRule.java @@ -74,7 +74,7 @@ interface Blank extends WithServer { interface WithServer { /** * Specifies resourceGroupName, serverName. - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal + * @param resourceGroupName The name of the resource group. The name is case insensitive * @param serverName The name of the server * @return the next definition stage */ diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRules.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRules.java index b189fc33fa8b..d61087b3c43d 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRules.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRules.java @@ -21,7 +21,7 @@ public interface VirtualNetworkRules extends SupportsCreating, Indexable, Refreshable, HasManager { + /** + * @return the count value. + */ + Long count(); + + /** + * @return the databaseName value. + */ + String databaseName(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the eventName value. + */ + String eventName(); + + /** + * @return the eventTypeName value. + */ + String eventTypeName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the queryId value. + */ + Long queryId(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the totalTimeInMs value. + */ + Double totalTimeInMs(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the userId value. + */ + Long userId(); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/WaitStatistics.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/WaitStatistics.java new file mode 100644 index 000000000000..98ab520f0073 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/WaitStatistics.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.WaitStatisticsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing WaitStatistics. + */ +public interface WaitStatistics extends HasInner { + /** + * Retrieve wait statistics for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param waitStatisticsId The Wait Statistic identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String waitStatisticsId); + + /** + * Retrieve wait statistics for specified aggregation window. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving wait statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(final String resourceGroupName, final String serverName, final WaitStatisticsInput parameters); + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/WaitStatisticsInput.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/WaitStatisticsInput.java new file mode 100644 index 000000000000..260b6a3dc0de --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/WaitStatisticsInput.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Input to get wait statistics. + */ +@JsonFlatten +public class WaitStatisticsInput { + /** + * Observation start time. + */ + @JsonProperty(value = "properties.observationStartTime", required = true) + private DateTime observationStartTime; + + /** + * Observation end time. + */ + @JsonProperty(value = "properties.observationEndTime", required = true) + private DateTime observationEndTime; + + /** + * Aggregation interval type in ISO 8601 format. + */ + @JsonProperty(value = "properties.aggregationWindow", required = true) + private String aggregationWindow; + + /** + * Get observation start time. + * + * @return the observationStartTime value + */ + public DateTime observationStartTime() { + return this.observationStartTime; + } + + /** + * Set observation start time. + * + * @param observationStartTime the observationStartTime value to set + * @return the WaitStatisticsInput object itself. + */ + public WaitStatisticsInput withObservationStartTime(DateTime observationStartTime) { + this.observationStartTime = observationStartTime; + return this; + } + + /** + * Get observation end time. + * + * @return the observationEndTime value + */ + public DateTime observationEndTime() { + return this.observationEndTime; + } + + /** + * Set observation end time. + * + * @param observationEndTime the observationEndTime value to set + * @return the WaitStatisticsInput object itself. + */ + public WaitStatisticsInput withObservationEndTime(DateTime observationEndTime) { + this.observationEndTime = observationEndTime; + return this; + } + + /** + * Get aggregation interval type in ISO 8601 format. + * + * @return the aggregationWindow value + */ + public String aggregationWindow() { + return this.aggregationWindow; + } + + /** + * Set aggregation interval type in ISO 8601 format. + * + * @param aggregationWindow the aggregationWindow value to set + * @return the WaitStatisticsInput object itself. + */ + public WaitStatisticsInput withAggregationWindow(String aggregationWindow) { + this.aggregationWindow = aggregationWindow; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorImpl.java new file mode 100644 index 000000000000..edec0d3b2834 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.Advisor; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class AdvisorImpl extends IndexableRefreshableWrapperImpl implements Advisor { + private final MariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String advisorName; + + AdvisorImpl(AdvisorInner inner, MariaDBManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.advisorName = IdParsingUtils.getValueFromIdByName(inner.id(), "advisors"); + } + + @Override + public MariaDBManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + AdvisorsInner client = this.manager().inner().advisors(); + return client.getAsync(this.resourceGroupName, this.serverName, this.advisorName); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorInner.java new file mode 100644 index 000000000000..492e3fe37374 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a recommendation action advisor. + */ +public class AdvisorInner extends ProxyResource { + /** + * The properties of a recommendation action advisor. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the properties of a recommendation action advisor. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties of a recommendation action advisor. + * + * @param properties the properties value to set + * @return the AdvisorInner object itself. + */ + public AdvisorInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorsImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorsImpl.java new file mode 100644 index 000000000000..425a48ed71f1 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorsImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.Advisors; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01.Advisor; + +class AdvisorsImpl extends WrapperImpl implements Advisors { + private final MariaDBManager manager; + + AdvisorsImpl(MariaDBManager manager) { + super(manager.inner().advisors()); + this.manager = manager; + } + + public MariaDBManager manager() { + return this.manager; + } + + private AdvisorImpl wrapModel(AdvisorInner inner) { + return new AdvisorImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName) { + AdvisorsInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Advisor call(AdvisorInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String advisorName) { + AdvisorsInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, advisorName) + .flatMap(new Func1>() { + @Override + public Observable call(AdvisorInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Advisor)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorsInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorsInner.java new file mode 100644 index 000000000000..93d2efd8015e --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/AdvisorsInner.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Advisors. + */ +public class AdvisorsInner { + /** The Retrofit service to perform REST calls. */ + private AdvisorsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of AdvisorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AdvisorsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(AdvisorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Advisors to be + * used by Retrofit to perform actually REST calls. + */ + interface AdvisorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.Advisors get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("advisorName") String advisorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.Advisors listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors") + Observable> listByServer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.Advisors listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a recommendation action advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AdvisorInner object if successful. + */ + public AdvisorInner get(String resourceGroupName, String serverName, String advisorName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, advisorName).toBlocking().single().body(); + } + + /** + * Get a recommendation action advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String advisorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, advisorName), serviceCallback); + } + + /** + * Get a recommendation action advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdvisorInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String advisorName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, advisorName).map(new Func1, AdvisorInner>() { + @Override + public AdvisorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a recommendation action advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AdvisorInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String advisorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (advisorName == null) { + throw new IllegalArgumentException("Parameter advisorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, advisorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List recommendation action advisors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AdvisorInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List recommendation action advisors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerAsync(final String resourceGroupName, final String serverName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List recommendation action advisors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AdvisorInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List recommendation action advisors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AdvisorInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName) { + return listByServerSinglePageAsync(resourceGroupName, serverName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List recommendation action advisors. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AdvisorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List recommendation action advisors. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AdvisorInner> object if successful. + */ + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List recommendation action advisors. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List recommendation action advisors. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AdvisorInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List recommendation action advisors. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AdvisorInner> object + */ + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List recommendation action advisors. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AdvisorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsImpl.java index 5f908d30377c..a23cbbac9f8b 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsImpl.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsImpl.java @@ -63,10 +63,14 @@ public Configuration call(ConfigurationInner inner) { public Observable getAsync(String resourceGroupName, String serverName, String configurationName) { ConfigurationsInner client = this.inner(); return client.getAsync(resourceGroupName, serverName, configurationName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public Configuration call(ConfigurationInner inner) { - return wrapModel(inner); + public Observable call(ConfigurationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Configuration)wrapModel(inner)); + } } }); } diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsInner.java index 8596165868dd..2c09a7a36d2d 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsInner.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsInner.java @@ -76,7 +76,7 @@ interface ConfigurationsService { /** * Updates a configuration of a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @param parameters The required parameters for updating a server configuration. @@ -92,7 +92,7 @@ public ConfigurationInner createOrUpdate(String resourceGroupName, String server /** * Updates a configuration of a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @param parameters The required parameters for updating a server configuration. @@ -107,7 +107,7 @@ public ServiceFuture createOrUpdateAsync(String resourceGrou /** * Updates a configuration of a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @param parameters The required parameters for updating a server configuration. @@ -126,7 +126,7 @@ public ConfigurationInner call(ServiceResponse response) { /** * Updates a configuration of a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @param parameters The required parameters for updating a server configuration. @@ -160,7 +160,7 @@ public Observable> createOrUpdateWithService /** * Updates a configuration of a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @param parameters The required parameters for updating a server configuration. @@ -176,7 +176,7 @@ public ConfigurationInner beginCreateOrUpdate(String resourceGroupName, String s /** * Updates a configuration of a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @param parameters The required parameters for updating a server configuration. @@ -191,7 +191,7 @@ public ServiceFuture beginCreateOrUpdateAsync(String resourc /** * Updates a configuration of a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @param parameters The required parameters for updating a server configuration. @@ -210,7 +210,7 @@ public ConfigurationInner call(ServiceResponse response) { /** * Updates a configuration of a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @param parameters The required parameters for updating a server configuration. @@ -262,7 +262,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response /** * Gets information about a configuration of server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -277,7 +277,7 @@ public ConfigurationInner get(String resourceGroupName, String serverName, Strin /** * Gets information about a configuration of server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -291,7 +291,7 @@ public ServiceFuture getAsync(String resourceGroupName, Stri /** * Gets information about a configuration of server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -309,7 +309,7 @@ public ConfigurationInner call(ServiceResponse response) { /** * Gets information about a configuration of server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -355,7 +355,7 @@ private ServiceResponse getDelegate(Response r /** * List all the configurations in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -369,7 +369,7 @@ public List listByServer(String resourceGroupName, String se /** * List all the configurations in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -382,7 +382,7 @@ public ServiceFuture> listByServerAsync(String resource /** * List all the configurations in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ConfigurationInner> object @@ -399,7 +399,7 @@ public List call(ServiceResponse> r /** * List all the configurations in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ConfigurationInner> object diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesImpl.java index 8127e77e7e37..60e25117c900 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesImpl.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesImpl.java @@ -64,10 +64,14 @@ public Database call(DatabaseInner inner) { public Observable getAsync(String resourceGroupName, String serverName, String databaseName) { DatabasesInner client = this.inner(); return client.getAsync(resourceGroupName, serverName, databaseName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public Database call(DatabaseInner inner) { - return wrapModel(inner); + public Observable call(DatabaseInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Database)wrapModel(inner)); + } } }); } diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesInner.java index ea418c9d0024..343f4dafc5e7 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesInner.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesInner.java @@ -85,7 +85,7 @@ interface DatabasesService { /** * Creates a new database or updates an existing database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param parameters The required parameters for creating or updating a database. @@ -101,7 +101,7 @@ public DatabaseInner createOrUpdate(String resourceGroupName, String serverName, /** * Creates a new database or updates an existing database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param parameters The required parameters for creating or updating a database. @@ -116,7 +116,7 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupName /** * Creates a new database or updates an existing database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param parameters The required parameters for creating or updating a database. @@ -135,7 +135,7 @@ public DatabaseInner call(ServiceResponse response) { /** * Creates a new database or updates an existing database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param parameters The required parameters for creating or updating a database. @@ -169,7 +169,7 @@ public Observable> createOrUpdateWithServiceRespo /** * Creates a new database or updates an existing database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param parameters The required parameters for creating or updating a database. @@ -185,7 +185,7 @@ public DatabaseInner beginCreateOrUpdate(String resourceGroupName, String server /** * Creates a new database or updates an existing database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param parameters The required parameters for creating or updating a database. @@ -200,7 +200,7 @@ public ServiceFuture beginCreateOrUpdateAsync(String resourceGrou /** * Creates a new database or updates an existing database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param parameters The required parameters for creating or updating a database. @@ -219,7 +219,7 @@ public DatabaseInner call(ServiceResponse response) { /** * Creates a new database or updates an existing database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param parameters The required parameters for creating or updating a database. @@ -272,7 +272,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response deleteAsync(String resourceGroupName, String serverNa /** * Deletes a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -318,7 +318,7 @@ public Void call(ServiceResponse response) { /** * Deletes a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -347,7 +347,7 @@ public Observable> deleteWithServiceResponseAsync(String r /** * Deletes a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -361,7 +361,7 @@ public void beginDelete(String resourceGroupName, String serverName, String data /** * Deletes a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -375,7 +375,7 @@ public ServiceFuture beginDeleteAsync(String resourceGroupName, String ser /** * Deletes a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -393,7 +393,7 @@ public Void call(ServiceResponse response) { /** * Deletes a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -441,7 +441,7 @@ private ServiceResponse beginDeleteDelegate(Response respons /** * Gets information about a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -456,7 +456,7 @@ public DatabaseInner get(String resourceGroupName, String serverName, String dat /** * Gets information about a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -470,7 +470,7 @@ public ServiceFuture getAsync(String resourceGroupName, String se /** * Gets information about a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -488,7 +488,7 @@ public DatabaseInner call(ServiceResponse response) { /** * Gets information about a database. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param databaseName The name of the database. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -534,7 +534,7 @@ private ServiceResponse getDelegate(Response respon /** * List all the databases in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -548,7 +548,7 @@ public List listByServer(String resourceGroupName, String serverN /** * List all the databases in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -561,7 +561,7 @@ public ServiceFuture> listByServerAsync(String resourceGroup /** * List all the databases in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<DatabaseInner> object @@ -578,7 +578,7 @@ public List call(ServiceResponse> response) { /** * List all the databases in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<DatabaseInner> object diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesImpl.java index e7eff8d9b5ac..69d301af4490 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesImpl.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesImpl.java @@ -64,10 +64,14 @@ public FirewallRule call(FirewallRuleInner inner) { public Observable getAsync(String resourceGroupName, String serverName, String firewallRuleName) { FirewallRulesInner client = this.inner(); return client.getAsync(resourceGroupName, serverName, firewallRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public FirewallRule call(FirewallRuleInner inner) { - return wrapModel(inner); + public Observable call(FirewallRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((FirewallRule)wrapModel(inner)); + } } }); } diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesInner.java index 4f271ecf547c..49fefbbe28b9 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesInner.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesInner.java @@ -85,7 +85,7 @@ interface FirewallRulesService { /** * Creates a new firewall rule or updates an existing firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param parameters The required parameters for creating or updating a firewall rule. @@ -101,7 +101,7 @@ public FirewallRuleInner createOrUpdate(String resourceGroupName, String serverN /** * Creates a new firewall rule or updates an existing firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param parameters The required parameters for creating or updating a firewall rule. @@ -116,7 +116,7 @@ public ServiceFuture createOrUpdateAsync(String resourceGroup /** * Creates a new firewall rule or updates an existing firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param parameters The required parameters for creating or updating a firewall rule. @@ -135,7 +135,7 @@ public FirewallRuleInner call(ServiceResponse response) { /** * Creates a new firewall rule or updates an existing firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param parameters The required parameters for creating or updating a firewall rule. @@ -169,7 +169,7 @@ public Observable> createOrUpdateWithServiceR /** * Creates a new firewall rule or updates an existing firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param parameters The required parameters for creating or updating a firewall rule. @@ -185,7 +185,7 @@ public FirewallRuleInner beginCreateOrUpdate(String resourceGroupName, String se /** * Creates a new firewall rule or updates an existing firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param parameters The required parameters for creating or updating a firewall rule. @@ -200,7 +200,7 @@ public ServiceFuture beginCreateOrUpdateAsync(String resource /** * Creates a new firewall rule or updates an existing firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param parameters The required parameters for creating or updating a firewall rule. @@ -219,7 +219,7 @@ public FirewallRuleInner call(ServiceResponse response) { /** * Creates a new firewall rule or updates an existing firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param parameters The required parameters for creating or updating a firewall rule. @@ -272,7 +272,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response< /** * Deletes a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -286,7 +286,7 @@ public void delete(String resourceGroupName, String serverName, String firewallR /** * Deletes a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -300,7 +300,7 @@ public ServiceFuture deleteAsync(String resourceGroupName, String serverNa /** * Deletes a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -318,7 +318,7 @@ public Void call(ServiceResponse response) { /** * Deletes a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -347,7 +347,7 @@ public Observable> deleteWithServiceResponseAsync(String r /** * Deletes a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -361,7 +361,7 @@ public void beginDelete(String resourceGroupName, String serverName, String fire /** * Deletes a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -375,7 +375,7 @@ public ServiceFuture beginDeleteAsync(String resourceGroupName, String ser /** * Deletes a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -393,7 +393,7 @@ public Void call(ServiceResponse response) { /** * Deletes a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -441,7 +441,7 @@ private ServiceResponse beginDeleteDelegate(Response respons /** * Gets information about a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -456,7 +456,7 @@ public FirewallRuleInner get(String resourceGroupName, String serverName, String /** * Gets information about a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -470,7 +470,7 @@ public ServiceFuture getAsync(String resourceGroupName, Strin /** * Gets information about a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -488,7 +488,7 @@ public FirewallRuleInner call(ServiceResponse response) { /** * Gets information about a server firewall rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param firewallRuleName The name of the server firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -534,7 +534,7 @@ private ServiceResponse getDelegate(Response re /** * List all the firewall rules in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -548,7 +548,7 @@ public List listByServer(String resourceGroupName, String ser /** * List all the firewall rules in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -561,7 +561,7 @@ public ServiceFuture> listByServerAsync(String resourceG /** * List all the firewall rules in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<FirewallRuleInner> object @@ -578,7 +578,7 @@ public List call(ServiceResponse> res /** * List all the firewall rules in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<FirewallRuleInner> object diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersImpl.java index 5aa1cd49cbdd..07bfdb1c86aa 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersImpl.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersImpl.java @@ -4,7 +4,7 @@ * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * abc + * */ package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; @@ -28,7 +28,7 @@ public MariaDBManager manager() { return this.manager; } - private PerformanceTierPropertiesImpl wrapPerformanceTierPropertiesModel(PerformanceTierPropertiesInner inner) { + private PerformanceTierPropertiesImpl wrapModel(PerformanceTierPropertiesInner inner) { return new PerformanceTierPropertiesImpl(inner, manager()); } @@ -45,7 +45,7 @@ public Observable call(List() { @Override public PerformanceTierProperties call(PerformanceTierPropertiesInner inner) { - return wrapPerformanceTierPropertiesModel(inner); + return wrapModel(inner); } }); } diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java new file mode 100644 index 000000000000..90ab4598a473 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedRecommendedActionSessionsOperationStatus; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.RecommendedActionSessionsOperationStatus; + +class LocationBasedRecommendedActionSessionsOperationStatusImpl extends WrapperImpl implements LocationBasedRecommendedActionSessionsOperationStatus { + private final MariaDBManager manager; + + LocationBasedRecommendedActionSessionsOperationStatusImpl(MariaDBManager manager) { + super(manager.inner().locationBasedRecommendedActionSessionsOperationStatus()); + this.manager = manager; + } + + public MariaDBManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String locationName, String operationId) { + LocationBasedRecommendedActionSessionsOperationStatusInner client = this.inner(); + return client.getAsync(locationName, operationId) + .map(new Func1() { + @Override + public RecommendedActionSessionsOperationStatus call(RecommendedActionSessionsOperationStatusInner inner) { + return new RecommendedActionSessionsOperationStatusImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusInner.java new file mode 100644 index 000000000000..76296762fe6c --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusInner.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LocationBasedRecommendedActionSessionsOperationStatus. + */ +public class LocationBasedRecommendedActionSessionsOperationStatusInner { + /** The Retrofit service to perform REST calls. */ + private LocationBasedRecommendedActionSessionsOperationStatusService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of LocationBasedRecommendedActionSessionsOperationStatusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationBasedRecommendedActionSessionsOperationStatusInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(LocationBasedRecommendedActionSessionsOperationStatusService.class); + this.client = client; + } + + /** + * The interface defining all the services for LocationBasedRecommendedActionSessionsOperationStatus to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationBasedRecommendedActionSessionsOperationStatusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedRecommendedActionSessionsOperationStatus get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/locations/{locationName}/recommendedActionSessionsAzureAsyncOperation/{operationId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Recommendation action session operation status. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecommendedActionSessionsOperationStatusInner object if successful. + */ + public RecommendedActionSessionsOperationStatusInner get(String locationName, String operationId) { + return getWithServiceResponseAsync(locationName, operationId).toBlocking().single().body(); + } + + /** + * Recommendation action session operation status. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String locationName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(locationName, operationId), serviceCallback); + } + + /** + * Recommendation action session operation status. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecommendedActionSessionsOperationStatusInner object + */ + public Observable getAsync(String locationName, String operationId) { + return getWithServiceResponseAsync(locationName, operationId).map(new Func1, RecommendedActionSessionsOperationStatusInner>() { + @Override + public RecommendedActionSessionsOperationStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Recommendation action session operation status. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecommendedActionSessionsOperationStatusInner object + */ + public Observable> getWithServiceResponseAsync(String locationName, String operationId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), locationName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java new file mode 100644 index 000000000000..62a7eee57a1e --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedRecommendedActionSessionsResults; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01.RecommendationAction; + +class LocationBasedRecommendedActionSessionsResultsImpl extends WrapperImpl implements LocationBasedRecommendedActionSessionsResults { + private final MariaDBManager manager; + + LocationBasedRecommendedActionSessionsResultsImpl(MariaDBManager manager) { + super(manager.inner().locationBasedRecommendedActionSessionsResults()); + this.manager = manager; + } + + public MariaDBManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String locationName, final String operationId) { + LocationBasedRecommendedActionSessionsResultsInner client = this.inner(); + return client.listAsync(locationName, operationId) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RecommendationAction call(RecommendationActionInner inner) { + return new RecommendationActionImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsResultsInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsResultsInner.java new file mode 100644 index 000000000000..43427c08bae7 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedRecommendedActionSessionsResultsInner.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LocationBasedRecommendedActionSessionsResults. + */ +public class LocationBasedRecommendedActionSessionsResultsInner { + /** The Retrofit service to perform REST calls. */ + private LocationBasedRecommendedActionSessionsResultsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of LocationBasedRecommendedActionSessionsResultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationBasedRecommendedActionSessionsResultsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(LocationBasedRecommendedActionSessionsResultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LocationBasedRecommendedActionSessionsResults to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationBasedRecommendedActionSessionsResultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedRecommendedActionSessionsResults list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/locations/{locationName}/recommendedActionSessionsOperationResults/{operationId}") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedRecommendedActionSessionsResults listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Recommendation action session operation result. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecommendationActionInner> object if successful. + */ + public PagedList list(final String locationName, final String operationId) { + ServiceResponse> response = listSinglePageAsync(locationName, operationId).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Recommendation action session operation result. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String locationName, final String operationId, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(locationName, operationId), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Recommendation action session operation result. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable> listAsync(final String locationName, final String operationId) { + return listWithServiceResponseAsync(locationName, operationId) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Recommendation action session operation result. + * + * @param locationName The name of the location. + * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String locationName, final String operationId) { + return listSinglePageAsync(locationName, operationId) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Recommendation action session operation result. + * + ServiceResponse> * @param locationName The name of the location. + ServiceResponse> * @param operationId The operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationActionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String locationName, final String operationId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), locationName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .register(201, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Recommendation action session operation result. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecommendationActionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Recommendation action session operation result. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Recommendation action session operation result. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Recommendation action session operation result. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Recommendation action session operation result. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationActionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .register(201, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesInner.java index c64ff696226d..142c0057c391 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesInner.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesInner.java @@ -61,7 +61,7 @@ interface LogFilesService { /** * List all the log files in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -75,7 +75,7 @@ public List listByServer(String resourceGroupName, String serverNa /** * List all the log files in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -88,7 +88,7 @@ public ServiceFuture> listByServerAsync(String resourceGroupN /** * List all the log files in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<LogFileInner> object @@ -105,7 +105,7 @@ public List call(ServiceResponse> response) { /** * List all the log files in a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<LogFileInner> object diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManagementClientImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManagementClientImpl.java index 7a3947c473ab..690e06d6ccc5 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManagementClientImpl.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManagementClientImpl.java @@ -8,15 +8,32 @@ package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; +import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.CloudException; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; /** * Initializes a new instance of the MariaDBManagementClientImpl class. */ public class MariaDBManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private MariaDBManagementClientService service; /** the {@link AzureClient} used for long running operations. */ private AzureClient azureClient; @@ -28,11 +45,23 @@ public AzureClient getAzureClient() { return this.azureClient; } - /** The subscription ID that identifies an Azure subscription. */ + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The ID of the target subscription. */ private String subscriptionId; /** - * Gets The subscription ID that identifies an Azure subscription. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -41,7 +70,7 @@ public String subscriptionId() { } /** - * Sets The subscription ID that identifies an Azure subscription. + * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. * @return the service client itself @@ -51,18 +80,6 @@ public MariaDBManagementClientImpl withSubscriptionId(String subscriptionId) { return this; } - /** The API version to use for the request. */ - private String apiVersion; - - /** - * Gets The API version to use for the request. - * - * @return the apiVersion value. - */ - public String apiVersion() { - return this.apiVersion; - } - /** The preferred language for the response. */ private String acceptLanguage; @@ -275,6 +292,123 @@ public OperationsInner operations() { return this.operations; } + /** + * The QueryTextsInner object to access its operations. + */ + private QueryTextsInner queryTexts; + + /** + * Gets the QueryTextsInner object to access its operations. + * @return the QueryTextsInner object. + */ + public QueryTextsInner queryTexts() { + return this.queryTexts; + } + + /** + * The TopQueryStatisticsInner object to access its operations. + */ + private TopQueryStatisticsInner topQueryStatistics; + + /** + * Gets the TopQueryStatisticsInner object to access its operations. + * @return the TopQueryStatisticsInner object. + */ + public TopQueryStatisticsInner topQueryStatistics() { + return this.topQueryStatistics; + } + + /** + * The WaitStatisticsInner object to access its operations. + */ + private WaitStatisticsInner waitStatistics; + + /** + * Gets the WaitStatisticsInner object to access its operations. + * @return the WaitStatisticsInner object. + */ + public WaitStatisticsInner waitStatistics() { + return this.waitStatistics; + } + + /** + * The AdvisorsInner object to access its operations. + */ + private AdvisorsInner advisors; + + /** + * Gets the AdvisorsInner object to access its operations. + * @return the AdvisorsInner object. + */ + public AdvisorsInner advisors() { + return this.advisors; + } + + /** + * The RecommendedActionsInner object to access its operations. + */ + private RecommendedActionsInner recommendedActions; + + /** + * Gets the RecommendedActionsInner object to access its operations. + * @return the RecommendedActionsInner object. + */ + public RecommendedActionsInner recommendedActions() { + return this.recommendedActions; + } + + /** + * The LocationBasedRecommendedActionSessionsOperationStatusInner object to access its operations. + */ + private LocationBasedRecommendedActionSessionsOperationStatusInner locationBasedRecommendedActionSessionsOperationStatus; + + /** + * Gets the LocationBasedRecommendedActionSessionsOperationStatusInner object to access its operations. + * @return the LocationBasedRecommendedActionSessionsOperationStatusInner object. + */ + public LocationBasedRecommendedActionSessionsOperationStatusInner locationBasedRecommendedActionSessionsOperationStatus() { + return this.locationBasedRecommendedActionSessionsOperationStatus; + } + + /** + * The LocationBasedRecommendedActionSessionsResultsInner object to access its operations. + */ + private LocationBasedRecommendedActionSessionsResultsInner locationBasedRecommendedActionSessionsResults; + + /** + * Gets the LocationBasedRecommendedActionSessionsResultsInner object to access its operations. + * @return the LocationBasedRecommendedActionSessionsResultsInner object. + */ + public LocationBasedRecommendedActionSessionsResultsInner locationBasedRecommendedActionSessionsResults() { + return this.locationBasedRecommendedActionSessionsResults; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesInner object to access its operations. + */ + private PrivateLinkResourcesInner privateLinkResources; + + /** + * Gets the PrivateLinkResourcesInner object to access its operations. + * @return the PrivateLinkResourcesInner object. + */ + public PrivateLinkResourcesInner privateLinkResources() { + return this.privateLinkResources; + } + /** * Initializes an instance of MariaDBManagementClient client. * @@ -321,7 +455,17 @@ protected void initialize() { this.checkNameAvailabilitys = new CheckNameAvailabilitysInner(restClient().retrofit(), this); this.serverSecurityAlertPolicies = new ServerSecurityAlertPoliciesInner(restClient().retrofit(), this); this.operations = new OperationsInner(restClient().retrofit(), this); + this.queryTexts = new QueryTextsInner(restClient().retrofit(), this); + this.topQueryStatistics = new TopQueryStatisticsInner(restClient().retrofit(), this); + this.waitStatistics = new WaitStatisticsInner(restClient().retrofit(), this); + this.advisors = new AdvisorsInner(restClient().retrofit(), this); + this.recommendedActions = new RecommendedActionsInner(restClient().retrofit(), this); + this.locationBasedRecommendedActionSessionsOperationStatus = new LocationBasedRecommendedActionSessionsOperationStatusInner(restClient().retrofit(), this); + this.locationBasedRecommendedActionSessionsResults = new LocationBasedRecommendedActionSessionsResultsInner(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); + initializeService(); } /** @@ -333,4 +477,206 @@ protected void initialize() { public String userAgent() { return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "MariaDBManagementClient", "2018-06-01"); } + + private void initializeService() { + service = restClient().retrofit().create(MariaDBManagementClientService.class); + } + + /** + * The interface defining all the services for MariaDBManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface MariaDBManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.MariaDBManagementClient createRecommendedActionSession" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}/createRecommendedActionSession") + Observable> createRecommendedActionSession(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("advisorName") String advisorName, @Query("api-version") String apiVersion, @Query("databaseName") String databaseName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.MariaDBManagementClient beginCreateRecommendedActionSession" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}/createRecommendedActionSession") + Observable> beginCreateRecommendedActionSession(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("advisorName") String advisorName, @Query("api-version") String apiVersion, @Query("databaseName") String databaseName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create recommendation action session for the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createRecommendedActionSession(String resourceGroupName, String serverName, String advisorName, String databaseName) { + createRecommendedActionSessionWithServiceResponseAsync(resourceGroupName, serverName, advisorName, databaseName).toBlocking().last().body(); + } + + /** + * Create recommendation action session for the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param databaseName The name of the database. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createRecommendedActionSessionAsync(String resourceGroupName, String serverName, String advisorName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createRecommendedActionSessionWithServiceResponseAsync(resourceGroupName, serverName, advisorName, databaseName), serviceCallback); + } + + /** + * Create recommendation action session for the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createRecommendedActionSessionAsync(String resourceGroupName, String serverName, String advisorName, String databaseName) { + return createRecommendedActionSessionWithServiceResponseAsync(resourceGroupName, serverName, advisorName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create recommendation action session for the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createRecommendedActionSessionWithServiceResponseAsync(String resourceGroupName, String serverName, String advisorName, String databaseName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (advisorName == null) { + throw new IllegalArgumentException("Parameter advisorName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + Observable> observable = service.createRecommendedActionSession(this.subscriptionId(), resourceGroupName, serverName, advisorName, this.apiVersion(), databaseName, this.acceptLanguage(), this.userAgent()); + return getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create recommendation action session for the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginCreateRecommendedActionSession(String resourceGroupName, String serverName, String advisorName, String databaseName) { + beginCreateRecommendedActionSessionWithServiceResponseAsync(resourceGroupName, serverName, advisorName, databaseName).toBlocking().single().body(); + } + + /** + * Create recommendation action session for the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param databaseName The name of the database. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateRecommendedActionSessionAsync(String resourceGroupName, String serverName, String advisorName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateRecommendedActionSessionWithServiceResponseAsync(resourceGroupName, serverName, advisorName, databaseName), serviceCallback); + } + + /** + * Create recommendation action session for the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginCreateRecommendedActionSessionAsync(String resourceGroupName, String serverName, String advisorName, String databaseName) { + return beginCreateRecommendedActionSessionWithServiceResponseAsync(resourceGroupName, serverName, advisorName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create recommendation action session for the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginCreateRecommendedActionSessionWithServiceResponseAsync(String resourceGroupName, String serverName, String advisorName, String databaseName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (advisorName == null) { + throw new IllegalArgumentException("Parameter advisorName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + return service.beginCreateRecommendedActionSession(this.subscriptionId(), resourceGroupName, serverName, advisorName, this.apiVersion(), databaseName, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateRecommendedActionSessionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateRecommendedActionSessionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManager.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManager.java index 2be2873c7cee..5c9b0f46af79 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManager.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManager.java @@ -27,6 +27,15 @@ import com.microsoft.azure.management.mariadb.v2018_06_01.CheckNameAvailabilitys; import com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicies; import com.microsoft.azure.management.mariadb.v2018_06_01.Operations; +import com.microsoft.azure.management.mariadb.v2018_06_01.QueryTexts; +import com.microsoft.azure.management.mariadb.v2018_06_01.TopQueryStatistics; +import com.microsoft.azure.management.mariadb.v2018_06_01.WaitStatistics; +import com.microsoft.azure.management.mariadb.v2018_06_01.Advisors; +import com.microsoft.azure.management.mariadb.v2018_06_01.RecommendedActions; +import com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedRecommendedActionSessionsOperationStatus; +import com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedRecommendedActionSessionsResults; +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections; +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkResources; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -45,6 +54,15 @@ public final class MariaDBManager extends ManagerCore implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private final MariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String privateEndpointConnectionName; + + PrivateEndpointConnectionImpl(String name, MariaDBManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, MariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + } + + @Override + public MariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.resourceGroupName, this.serverName, this.privateEndpointConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpointProperty privateEndpoint() { + return this.inner().privateEndpoint(); + } + + @Override + public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { + return this.inner().privateLinkServiceConnectionState(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpointProperty privateEndpoint) { + this.inner().withPrivateEndpoint(privateEndpoint); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { + this.inner().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..f25988017e3a --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionInner.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointProperty; +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkServiceConnectionStateProperty; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A private endpoint connection. + */ +@JsonFlatten +public class PrivateEndpointConnectionInner extends ProxyResource { + /** + * Private endpoint which the connection belongs to. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpointProperty privateEndpoint; + + /** + * Connection state of the private endpoint connection. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState; + + /** + * State of the private endpoint connection. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get private endpoint which the connection belongs to. + * + * @return the privateEndpoint value + */ + public PrivateEndpointProperty privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set private endpoint which the connection belongs to. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpointProperty privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get connection state of the private endpoint connection. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set connection state of the private endpoint connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get state of the private endpoint connection. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionsImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..200125ec0d96 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final MariaDBManager manager; + + PrivateEndpointConnectionsImpl(MariaDBManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public MariaDBManager manager() { + return this.manager; + } + + @Override + public PrivateEndpointConnectionImpl define(String name) { + return wrapModel(name); + } + + private PrivateEndpointConnectionImpl wrapModel(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + + private PrivateEndpointConnectionImpl wrapModel(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, privateEndpointConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateEndpointConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateEndpointConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serverName, privateEndpointConnectionName).toCompletable(); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionsInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 000000000000..b1356d2d169a --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,1153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mariadb.v2018_06_01.TagsObject; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Body PrivateEndpointConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Body PrivateEndpointConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections updateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> updateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections beginUpdateTags" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> beginUpdateTags(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateEndpointConnections") + Observable> listByServer(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateEndpointConnections listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param parameters the PrivateEndpointConnectionInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String serverName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param parameters the PrivateEndpointConnectionInner value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters), serviceCallback); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param parameters the PrivateEndpointConnectionInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param parameters the PrivateEndpointConnectionInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param parameters the PrivateEndpointConnectionInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginCreateOrUpdate(String resourceGroupName, String serverName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param parameters the PrivateEndpointConnectionInner value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters), serviceCallback); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param parameters the PrivateEndpointConnectionInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param parameters the PrivateEndpointConnectionInner value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner updateTags(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return updateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner updateTags(String resourceGroupName, String serverName, String privateEndpointConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, tags).toBlocking().last().body(); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateTagsAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, tags), serviceCallback); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTagsAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, Map tags) { + return updateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, tags).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginUpdateTags(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginUpdateTags(String resourceGroupName, String serverName, String privateEndpointConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, tags).toBlocking().single().body(); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param tags Resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateTagsAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, tags), serviceCallback); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable beginUpdateTagsAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, Map tags) { + return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, tags).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates tags on private endpoint connection. + * Updates private endpoint connection with the specified tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param privateEndpointConnectionName the String value + * @param tags Resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTagsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTagsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all private endpoint connections on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all private endpoint connections on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerAsync(final String resourceGroupName, final String serverName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all private endpoint connections on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all private endpoint connections on a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName) { + return listByServerSinglePageAsync(resourceGroupName, serverName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all private endpoint connections on a server. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all private endpoint connections on a server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> object if successful. + */ + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all private endpoint connections on a server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all private endpoint connections on a server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all private endpoint connections on a server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionInner> object + */ + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all private endpoint connections on a server. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourceImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..b67c8fc2bc6f --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkResourceProperties; + +class PrivateLinkResourceImpl extends IndexableRefreshableWrapperImpl implements PrivateLinkResource { + private final MariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String groupName; + + PrivateLinkResourceImpl(PrivateLinkResourceInner inner, MariaDBManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.groupName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateLinkResources"); + } + + @Override + public MariaDBManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + PrivateLinkResourcesInner client = this.manager().inner().privateLinkResources(); + return client.getAsync(this.resourceGroupName, this.serverName, this.groupName); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateLinkResourceProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourceInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..5cdd444b45bf --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourceInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * A private link resource. + */ +public class PrivateLinkResourceInner extends ProxyResource { + /** + * The private link resource group id. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private PrivateLinkResourceProperties properties; + + /** + * Get the private link resource group id. + * + * @return the properties value + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourcesImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..094c91d7ed04 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkResources; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkResource; + +class PrivateLinkResourcesImpl extends WrapperImpl implements PrivateLinkResources { + private final MariaDBManager manager; + + PrivateLinkResourcesImpl(MariaDBManager manager) { + super(manager.inner().privateLinkResources()); + this.manager = manager; + } + + public MariaDBManager manager() { + return this.manager; + } + + private PrivateLinkResourceImpl wrapModel(PrivateLinkResourceInner inner) { + return new PrivateLinkResourceImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName) { + PrivateLinkResourcesInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateLinkResource call(PrivateLinkResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String groupName) { + PrivateLinkResourcesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, groupName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateLinkResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateLinkResource)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourcesInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 000000000000..9ff1433e1a0c --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateLinkResources. + */ +public class PrivateLinkResourcesInner { + /** The Retrofit service to perform REST calls. */ + private PrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateLinkResourcesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(PrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkResources listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateLinkResources") + Observable> listByServer(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkResources get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/privateLinkResources/{groupName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("groupName") String groupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.PrivateLinkResources listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the private link resources for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateLinkResourceInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the private link resources for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerAsync(final String resourceGroupName, final String serverName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the private link resources for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the private link resources for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName) { + return listByServerSinglePageAsync(resourceGroupName, serverName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the private link resources for MariaDB server. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a private link resource for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateLinkResourceInner object if successful. + */ + public PrivateLinkResourceInner get(String resourceGroupName, String serverName, String groupName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, groupName).toBlocking().single().body(); + } + + /** + * Gets a private link resource for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String groupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, groupName), serviceCallback); + } + + /** + * Gets a private link resource for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String groupName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, groupName).map(new Func1, PrivateLinkResourceInner>() { + @Override + public PrivateLinkResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a private link resource for MariaDB server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String groupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (groupName == null) { + throw new IllegalArgumentException("Parameter groupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, serverName, groupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the private link resources for MariaDB server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateLinkResourceInner> object if successful. + */ + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the private link resources for MariaDB server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the private link resources for MariaDB server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the private link resources for MariaDB server. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateLinkResourceInner> object + */ + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the private link resources for MariaDB server. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryStatisticImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryStatisticImpl.java new file mode 100644 index 000000000000..31c7b3ffd30c --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryStatisticImpl.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.QueryStatistic; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import org.joda.time.DateTime; + +class QueryStatisticImpl extends IndexableRefreshableWrapperImpl implements QueryStatistic { + private final MariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String queryStatisticId; + + QueryStatisticImpl(QueryStatisticInner inner, MariaDBManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.queryStatisticId = IdParsingUtils.getValueFromIdByName(inner.id(), "topQueryStatistics"); + } + + @Override + public MariaDBManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + TopQueryStatisticsInner client = this.manager().inner().topQueryStatistics(); + return client.getAsync(this.resourceGroupName, this.serverName, this.queryStatisticId); + } + + + + @Override + public String aggregationFunction() { + return this.inner().aggregationFunction(); + } + + @Override + public List databaseNames() { + return this.inner().databaseNames(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String metricDisplayName() { + return this.inner().metricDisplayName(); + } + + @Override + public String metricName() { + return this.inner().metricName(); + } + + @Override + public Double metricValue() { + return this.inner().metricValue(); + } + + @Override + public String metricValueUnit() { + return this.inner().metricValueUnit(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long queryExecutionCount() { + return this.inner().queryExecutionCount(); + } + + @Override + public String queryId() { + return this.inner().queryId(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryStatisticInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryStatisticInner.java new file mode 100644 index 000000000000..8c3e9dc8ef43 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryStatisticInner.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a Query Statistic. + */ +@JsonFlatten +public class QueryStatisticInner extends ProxyResource { + /** + * Database query identifier. + */ + @JsonProperty(value = "properties.queryId") + private String queryId; + + /** + * Observation start time. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * Observation end time. + */ + @JsonProperty(value = "properties.endTime") + private DateTime endTime; + + /** + * Aggregation function name. + */ + @JsonProperty(value = "properties.aggregationFunction") + private String aggregationFunction; + + /** + * The list of database names. + */ + @JsonProperty(value = "properties.databaseNames") + private List databaseNames; + + /** + * Number of query executions in this time interval. + */ + @JsonProperty(value = "properties.queryExecutionCount") + private Long queryExecutionCount; + + /** + * Metric name. + */ + @JsonProperty(value = "properties.metricName") + private String metricName; + + /** + * Metric display name. + */ + @JsonProperty(value = "properties.metricDisplayName") + private String metricDisplayName; + + /** + * Metric value. + */ + @JsonProperty(value = "properties.metricValue") + private Double metricValue; + + /** + * Metric value unit. + */ + @JsonProperty(value = "properties.metricValueUnit") + private String metricValueUnit; + + /** + * Get database query identifier. + * + * @return the queryId value + */ + public String queryId() { + return this.queryId; + } + + /** + * Set database query identifier. + * + * @param queryId the queryId value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withQueryId(String queryId) { + this.queryId = queryId; + return this; + } + + /** + * Get observation start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set observation start time. + * + * @param startTime the startTime value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get observation end time. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set observation end time. + * + * @param endTime the endTime value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get aggregation function name. + * + * @return the aggregationFunction value + */ + public String aggregationFunction() { + return this.aggregationFunction; + } + + /** + * Set aggregation function name. + * + * @param aggregationFunction the aggregationFunction value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withAggregationFunction(String aggregationFunction) { + this.aggregationFunction = aggregationFunction; + return this; + } + + /** + * Get the list of database names. + * + * @return the databaseNames value + */ + public List databaseNames() { + return this.databaseNames; + } + + /** + * Set the list of database names. + * + * @param databaseNames the databaseNames value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withDatabaseNames(List databaseNames) { + this.databaseNames = databaseNames; + return this; + } + + /** + * Get number of query executions in this time interval. + * + * @return the queryExecutionCount value + */ + public Long queryExecutionCount() { + return this.queryExecutionCount; + } + + /** + * Set number of query executions in this time interval. + * + * @param queryExecutionCount the queryExecutionCount value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withQueryExecutionCount(Long queryExecutionCount) { + this.queryExecutionCount = queryExecutionCount; + return this; + } + + /** + * Get metric name. + * + * @return the metricName value + */ + public String metricName() { + return this.metricName; + } + + /** + * Set metric name. + * + * @param metricName the metricName value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get metric display name. + * + * @return the metricDisplayName value + */ + public String metricDisplayName() { + return this.metricDisplayName; + } + + /** + * Set metric display name. + * + * @param metricDisplayName the metricDisplayName value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withMetricDisplayName(String metricDisplayName) { + this.metricDisplayName = metricDisplayName; + return this; + } + + /** + * Get metric value. + * + * @return the metricValue value + */ + public Double metricValue() { + return this.metricValue; + } + + /** + * Set metric value. + * + * @param metricValue the metricValue value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withMetricValue(Double metricValue) { + this.metricValue = metricValue; + return this; + } + + /** + * Get metric value unit. + * + * @return the metricValueUnit value + */ + public String metricValueUnit() { + return this.metricValueUnit; + } + + /** + * Set metric value unit. + * + * @param metricValueUnit the metricValueUnit value to set + * @return the QueryStatisticInner object itself. + */ + public QueryStatisticInner withMetricValueUnit(String metricValueUnit) { + this.metricValueUnit = metricValueUnit; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextImpl.java new file mode 100644 index 000000000000..dc71b5deed10 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.QueryText; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class QueryTextImpl extends IndexableRefreshableWrapperImpl implements QueryText { + private final MariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String queryId; + + QueryTextImpl(QueryTextInner inner, MariaDBManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.queryId = IdParsingUtils.getValueFromIdByName(inner.id(), "queryTexts"); + } + + @Override + public MariaDBManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + QueryTextsInner client = this.manager().inner().queryTexts(); + return client.getAsync(this.resourceGroupName, this.serverName, this.queryId); + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String queryId() { + return this.inner().queryId(); + } + + @Override + public String queryText() { + return this.inner().queryText(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextInner.java new file mode 100644 index 000000000000..1abaacf70c98 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a Query Text. + */ +@JsonFlatten +public class QueryTextInner extends ProxyResource { + /** + * Query identifier unique to the server. + */ + @JsonProperty(value = "properties.queryId") + private String queryId; + + /** + * Query text. + */ + @JsonProperty(value = "properties.queryText") + private String queryText; + + /** + * Get query identifier unique to the server. + * + * @return the queryId value + */ + public String queryId() { + return this.queryId; + } + + /** + * Set query identifier unique to the server. + * + * @param queryId the queryId value to set + * @return the QueryTextInner object itself. + */ + public QueryTextInner withQueryId(String queryId) { + this.queryId = queryId; + return this; + } + + /** + * Get query text. + * + * @return the queryText value + */ + public String queryText() { + return this.queryText; + } + + /** + * Set query text. + * + * @param queryText the queryText value to set + * @return the QueryTextInner object itself. + */ + public QueryTextInner withQueryText(String queryText) { + this.queryText = queryText; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextsImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextsImpl.java new file mode 100644 index 000000000000..ab0fff3ac811 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextsImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.QueryTexts; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01.QueryText; + +class QueryTextsImpl extends WrapperImpl implements QueryTexts { + private final MariaDBManager manager; + + QueryTextsImpl(MariaDBManager manager) { + super(manager.inner().queryTexts()); + this.manager = manager; + } + + public MariaDBManager manager() { + return this.manager; + } + + private QueryTextImpl wrapModel(QueryTextInner inner) { + return new QueryTextImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName, final List queryIds) { + QueryTextsInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName, queryIds) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public QueryText call(QueryTextInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String queryId) { + QueryTextsInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, queryId) + .flatMap(new Func1>() { + @Override + public Observable call(QueryTextInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((QueryText)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextsInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextsInner.java new file mode 100644 index 000000000000..d940de360e40 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/QueryTextsInner.java @@ -0,0 +1,413 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in QueryTexts. + */ +public class QueryTextsInner { + /** The Retrofit service to perform REST calls. */ + private QueryTextsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of QueryTextsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QueryTextsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(QueryTextsService.class); + this.client = client; + } + + /** + * The interface defining all the services for QueryTexts to be + * used by Retrofit to perform actually REST calls. + */ + interface QueryTextsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.QueryTexts get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/queryTexts/{queryId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("queryId") String queryId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.QueryTexts listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/queryTexts") + Observable> listByServer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Query("queryIds") String queryIds, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.QueryTexts listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieve the Query-Store query texts for the queryId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryId The Query-Store query identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueryTextInner object if successful. + */ + public QueryTextInner get(String resourceGroupName, String serverName, String queryId) { + return getWithServiceResponseAsync(resourceGroupName, serverName, queryId).toBlocking().single().body(); + } + + /** + * Retrieve the Query-Store query texts for the queryId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryId The Query-Store query identifier. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String queryId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, queryId), serviceCallback); + } + + /** + * Retrieve the Query-Store query texts for the queryId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryId The Query-Store query identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryTextInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String queryId) { + return getWithServiceResponseAsync(resourceGroupName, serverName, queryId).map(new Func1, QueryTextInner>() { + @Override + public QueryTextInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve the Query-Store query texts for the queryId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryId The Query-Store query identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryTextInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String queryId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (queryId == null) { + throw new IllegalArgumentException("Parameter queryId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, queryId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryIds The query identifiers + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QueryTextInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName, final List queryIds) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName, queryIds).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryIds The query identifiers + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerAsync(final String resourceGroupName, final String serverName, final List queryIds, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName, queryIds), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryIds The query identifiers + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryTextInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName, final List queryIds) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName, queryIds) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryIds The query identifiers + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryTextInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName, final List queryIds) { + return listByServerSinglePageAsync(resourceGroupName, serverName, queryIds) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param serverName The name of the server. + ServiceResponse> * @param queryIds The query identifiers + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QueryTextInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName, final List queryIds) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (queryIds == null) { + throw new IllegalArgumentException("Parameter queryIds is required and cannot be null."); + } + Validator.validate(queryIds); + String queryIdsConverted = this.client.serializerAdapter().serializeList(queryIds, CollectionFormat.MULTI); + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), queryIdsConverted, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QueryTextInner> object if successful. + */ + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryTextInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryTextInner> object + */ + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve the Query-Store query texts for specified queryIds. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QueryTextInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendationActionImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendationActionImpl.java new file mode 100644 index 000000000000..f606d8f29e8b --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendationActionImpl.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.RecommendationAction; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.Map; + +class RecommendationActionImpl extends IndexableRefreshableWrapperImpl implements RecommendationAction { + private final MariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String advisorName; + private String recommendedActionName; + + RecommendationActionImpl(RecommendationActionInner inner, MariaDBManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.advisorName = IdParsingUtils.getValueFromIdByName(inner.id(), "advisors"); + this.recommendedActionName = IdParsingUtils.getValueFromIdByName(inner.id(), "recommendedActions"); + } + + @Override + public MariaDBManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + RecommendedActionsInner client = this.manager().inner().recommendedActions(); + return client.getAsync(this.resourceGroupName, this.serverName, this.advisorName, this.recommendedActionName); + } + + + + @Override + public Integer actionId() { + return this.inner().actionId(); + } + + @Override + public String advisorName() { + return this.inner().advisorName(); + } + + @Override + public DateTime createdTime() { + return this.inner().createdTime(); + } + + @Override + public Map details() { + return this.inner().details(); + } + + @Override + public DateTime expirationTime() { + return this.inner().expirationTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + + @Override + public String recommendationType() { + return this.inner().recommendationType(); + } + + @Override + public String sessionId() { + return this.inner().sessionId(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendationActionInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendationActionInner.java new file mode 100644 index 000000000000..1bab5a3d6a71 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendationActionInner.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a Recommendation Action. + */ +@JsonFlatten +public class RecommendationActionInner extends ProxyResource { + /** + * Advisor name. + */ + @JsonProperty(value = "properties.advisorName") + private String advisorName; + + /** + * Recommendation action session identifier. + */ + @JsonProperty(value = "properties.sessionId") + private String sessionId; + + /** + * Recommendation action identifier. + */ + @JsonProperty(value = "properties.actionId") + private Integer actionId; + + /** + * Recommendation action creation time. + */ + @JsonProperty(value = "properties.createdTime") + private DateTime createdTime; + + /** + * Recommendation action expiration time. + */ + @JsonProperty(value = "properties.expirationTime") + private DateTime expirationTime; + + /** + * Recommendation action reason. + */ + @JsonProperty(value = "properties.reason") + private String reason; + + /** + * Recommendation action type. + */ + @JsonProperty(value = "properties.recommendationType") + private String recommendationType; + + /** + * Recommendation action details. + */ + @JsonProperty(value = "properties.details") + private Map details; + + /** + * Get advisor name. + * + * @return the advisorName value + */ + public String advisorName() { + return this.advisorName; + } + + /** + * Set advisor name. + * + * @param advisorName the advisorName value to set + * @return the RecommendationActionInner object itself. + */ + public RecommendationActionInner withAdvisorName(String advisorName) { + this.advisorName = advisorName; + return this; + } + + /** + * Get recommendation action session identifier. + * + * @return the sessionId value + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Set recommendation action session identifier. + * + * @param sessionId the sessionId value to set + * @return the RecommendationActionInner object itself. + */ + public RecommendationActionInner withSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Get recommendation action identifier. + * + * @return the actionId value + */ + public Integer actionId() { + return this.actionId; + } + + /** + * Set recommendation action identifier. + * + * @param actionId the actionId value to set + * @return the RecommendationActionInner object itself. + */ + public RecommendationActionInner withActionId(Integer actionId) { + this.actionId = actionId; + return this; + } + + /** + * Get recommendation action creation time. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Set recommendation action creation time. + * + * @param createdTime the createdTime value to set + * @return the RecommendationActionInner object itself. + */ + public RecommendationActionInner withCreatedTime(DateTime createdTime) { + this.createdTime = createdTime; + return this; + } + + /** + * Get recommendation action expiration time. + * + * @return the expirationTime value + */ + public DateTime expirationTime() { + return this.expirationTime; + } + + /** + * Set recommendation action expiration time. + * + * @param expirationTime the expirationTime value to set + * @return the RecommendationActionInner object itself. + */ + public RecommendationActionInner withExpirationTime(DateTime expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + /** + * Get recommendation action reason. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set recommendation action reason. + * + * @param reason the reason value to set + * @return the RecommendationActionInner object itself. + */ + public RecommendationActionInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get recommendation action type. + * + * @return the recommendationType value + */ + public String recommendationType() { + return this.recommendationType; + } + + /** + * Set recommendation action type. + * + * @param recommendationType the recommendationType value to set + * @return the RecommendationActionInner object itself. + */ + public RecommendationActionInner withRecommendationType(String recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * Get recommendation action details. + * + * @return the details value + */ + public Map details() { + return this.details; + } + + /** + * Set recommendation action details. + * + * @param details the details value to set + * @return the RecommendationActionInner object itself. + */ + public RecommendationActionInner withDetails(Map details) { + this.details = details; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionSessionsOperationStatusImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionSessionsOperationStatusImpl.java new file mode 100644 index 000000000000..7ce64aaa4c8b --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionSessionsOperationStatusImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.RecommendedActionSessionsOperationStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; + +class RecommendedActionSessionsOperationStatusImpl extends WrapperImpl implements RecommendedActionSessionsOperationStatus { + private final MariaDBManager manager; + RecommendedActionSessionsOperationStatusImpl(RecommendedActionSessionsOperationStatusInner inner, MariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MariaDBManager manager() { + return this.manager; + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public String status() { + return this.inner().status(); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionSessionsOperationStatusInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionSessionsOperationStatusInner.java new file mode 100644 index 000000000000..bfce48887c22 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionSessionsOperationStatusInner.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Recommendation action session operation status. + */ +public class RecommendedActionSessionsOperationStatusInner { + /** + * Operation identifier. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Operation start time. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * Operation status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Get operation identifier. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation identifier. + * + * @param name the name value to set + * @return the RecommendedActionSessionsOperationStatusInner object itself. + */ + public RecommendedActionSessionsOperationStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get operation start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set operation start time. + * + * @param startTime the startTime value to set + * @return the RecommendedActionSessionsOperationStatusInner object itself. + */ + public RecommendedActionSessionsOperationStatusInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get operation status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set operation status. + * + * @param status the status value to set + * @return the RecommendedActionSessionsOperationStatusInner object itself. + */ + public RecommendedActionSessionsOperationStatusInner withStatus(String status) { + this.status = status; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionsImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionsImpl.java new file mode 100644 index 000000000000..7f90ecb93829 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionsImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.RecommendedActions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01.RecommendationAction; + +class RecommendedActionsImpl extends WrapperImpl implements RecommendedActions { + private final MariaDBManager manager; + + RecommendedActionsImpl(MariaDBManager manager) { + super(manager.inner().recommendedActions()); + this.manager = manager; + } + + public MariaDBManager manager() { + return this.manager; + } + + private RecommendationActionImpl wrapModel(RecommendationActionInner inner) { + return new RecommendationActionImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName, final String advisorName) { + RecommendedActionsInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName, advisorName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RecommendationAction call(RecommendationActionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String advisorName, String recommendedActionName) { + RecommendedActionsInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, advisorName, recommendedActionName) + .flatMap(new Func1>() { + @Override + public Observable call(RecommendationActionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((RecommendationAction)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionsInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionsInner.java new file mode 100644 index 000000000000..4608194a23a8 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/RecommendedActionsInner.java @@ -0,0 +1,546 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RecommendedActions. + */ +public class RecommendedActionsInner { + /** The Retrofit service to perform REST calls. */ + private RecommendedActionsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of RecommendedActionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RecommendedActionsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(RecommendedActionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RecommendedActions to be + * used by Retrofit to perform actually REST calls. + */ + interface RecommendedActionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.RecommendedActions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("advisorName") String advisorName, @Path("recommendedActionName") String recommendedActionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.RecommendedActions listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/advisors/{advisorName}/recommendedActions") + Observable> listByServer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("advisorName") String advisorName, @Query("api-version") String apiVersion, @Query("sessionId") String sessionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.RecommendedActions listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param recommendedActionName The recommended action name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RecommendationActionInner object if successful. + */ + public RecommendationActionInner get(String resourceGroupName, String serverName, String advisorName, String recommendedActionName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, advisorName, recommendedActionName).toBlocking().single().body(); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param recommendedActionName The recommended action name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String advisorName, String recommendedActionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, advisorName, recommendedActionName), serviceCallback); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param recommendedActionName The recommended action name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecommendationActionInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String advisorName, String recommendedActionName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, advisorName, recommendedActionName).map(new Func1, RecommendationActionInner>() { + @Override + public RecommendationActionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param recommendedActionName The recommended action name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecommendationActionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String advisorName, String recommendedActionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (advisorName == null) { + throw new IllegalArgumentException("Parameter advisorName is required and cannot be null."); + } + if (recommendedActionName == null) { + throw new IllegalArgumentException("Parameter recommendedActionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, advisorName, recommendedActionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecommendationActionInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName, final String advisorName) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName, advisorName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerAsync(final String resourceGroupName, final String serverName, final String advisorName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName, advisorName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName, final String advisorName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName, advisorName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String advisorName) { + return listByServerSinglePageAsync(resourceGroupName, serverName, advisorName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationActionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName, final String advisorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (advisorName == null) { + throw new IllegalArgumentException("Parameter advisorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String sessionId = null; + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, advisorName, this.client.apiVersion(), sessionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param sessionId The recommendation action session identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecommendationActionInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName, final String advisorName, final String sessionId) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName, advisorName, sessionId).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param sessionId The recommendation action session identifier. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerAsync(final String resourceGroupName, final String serverName, final String advisorName, final String sessionId, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName, advisorName, sessionId), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param sessionId The recommendation action session identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName, final String advisorName, final String sessionId) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName, advisorName, sessionId) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param advisorName The advisor name for recommendation action. + * @param sessionId The recommendation action session identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String advisorName, final String sessionId) { + return listByServerSinglePageAsync(resourceGroupName, serverName, advisorName, sessionId) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve recommended actions from the advisor. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param serverName The name of the server. + ServiceResponse> * @param advisorName The advisor name for recommendation action. + ServiceResponse> * @param sessionId The recommendation action session identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationActionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName, final String advisorName, final String sessionId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (advisorName == null) { + throw new IllegalArgumentException("Parameter advisorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, advisorName, this.client.apiVersion(), sessionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RecommendationActionInner> object if successful. + */ + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve recommended actions from the advisor. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationActionInner> object + */ + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve recommended actions from the advisor. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationActionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasInner.java index ac99ba00bf78..b3f1e8f12a81 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasInner.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasInner.java @@ -61,7 +61,7 @@ interface ReplicasService { /** * List all the replicas for a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -75,7 +75,7 @@ public List listByServer(String resourceGroupName, String serverNam /** * List all the replicas for a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -88,7 +88,7 @@ public ServiceFuture> listByServerAsync(String resourceGroupNa /** * List all the replicas for a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ServerInner> object @@ -105,7 +105,7 @@ public List call(ServiceResponse> response) { /** * List all the replicas for a given server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<ServerInner> object diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesImpl.java index bfe040904dcc..fcc967ac9384 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesImpl.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesImpl.java @@ -44,10 +44,14 @@ private ServerSecurityAlertPolicyImpl wrapModel(String name) { public Observable getAsync(String resourceGroupName, String serverName) { ServerSecurityAlertPoliciesInner client = this.inner(); return client.getAsync(resourceGroupName, serverName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public ServerSecurityAlertPolicy call(ServerSecurityAlertPolicyInner inner) { - return wrapModel(inner); + public Observable call(ServerSecurityAlertPolicyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ServerSecurityAlertPolicy)wrapModel(inner)); + } } }); } diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesInner.java index 47a72d75a0ca..0a4c8a430b55 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesInner.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesInner.java @@ -71,7 +71,7 @@ interface ServerSecurityAlertPoliciesService { /** * Get a server's security alert policy. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -85,7 +85,7 @@ public ServerSecurityAlertPolicyInner get(String resourceGroupName, String serve /** * Get a server's security alert policy. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -98,7 +98,7 @@ public ServiceFuture getAsync(String resourceGro /** * Get a server's security alert policy. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ServerSecurityAlertPolicyInner object @@ -115,7 +115,7 @@ public ServerSecurityAlertPolicyInner call(ServiceResponse getDelegate(Response createOrUpdateAsync(String /** * Creates or updates a threat detection policy. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The server security alert policy. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -205,7 +205,7 @@ public ServerSecurityAlertPolicyInner call(ServiceResponse> createOrUpdat /** * Creates or updates a threat detection policy. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The server security alert policy. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -251,7 +251,7 @@ public ServerSecurityAlertPolicyInner beginCreateOrUpdate(String resourceGroupNa /** * Creates or updates a threat detection policy. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The server security alert policy. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -265,7 +265,7 @@ public ServiceFuture beginCreateOrUpdateAsync(St /** * Creates or updates a threat detection policy. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The server security alert policy. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -283,7 +283,7 @@ public ServerSecurityAlertPolicyInner call(ServiceResponse createAsync(String resourceGroupName, String s /** * Creates a new server or updates an existing server. The update action will overwrite the existing server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for creating or updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -161,7 +161,7 @@ public ServerInner call(ServiceResponse response) { /** * Creates a new server or updates an existing server. The update action will overwrite the existing server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for creating or updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -191,7 +191,7 @@ public Observable> createWithServiceResponseAsync(S /** * Creates a new server or updates an existing server. The update action will overwrite the existing server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for creating or updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -206,7 +206,7 @@ public ServerInner beginCreate(String resourceGroupName, String serverName, Serv /** * Creates a new server or updates an existing server. The update action will overwrite the existing server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for creating or updating a server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -220,7 +220,7 @@ public ServiceFuture beginCreateAsync(String resourceGroupName, Str /** * Creates a new server or updates an existing server. The update action will overwrite the existing server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for creating or updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -238,7 +238,7 @@ public ServerInner call(ServiceResponse response) { /** * Creates a new server or updates an existing server. The update action will overwrite the existing server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for creating or updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -287,7 +287,7 @@ private ServiceResponse beginCreateDelegate(Response /** * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -302,7 +302,7 @@ public ServerInner update(String resourceGroupName, String serverName, ServerUpd /** * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for updating a server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -316,7 +316,7 @@ public ServiceFuture updateAsync(String resourceGroupName, String s /** * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -334,7 +334,7 @@ public ServerInner call(ServiceResponse response) { /** * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -364,7 +364,7 @@ public Observable> updateWithServiceResponseAsync(S /** * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -379,7 +379,7 @@ public ServerInner beginUpdate(String resourceGroupName, String serverName, Serv /** * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for updating a server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -393,7 +393,7 @@ public ServiceFuture beginUpdateAsync(String resourceGroupName, Str /** * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -411,7 +411,7 @@ public ServerInner call(ServiceResponse response) { /** * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param parameters The required parameters for updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -459,7 +459,7 @@ private ServiceResponse beginUpdateDelegate(Response /** * Deletes a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -472,7 +472,7 @@ public void delete(String resourceGroupName, String serverName) { /** * Deletes a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -485,7 +485,7 @@ public ServiceFuture deleteAsync(String resourceGroupName, String serverNa /** * Deletes a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -502,7 +502,7 @@ public Void call(ServiceResponse response) { /** * Deletes a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -527,7 +527,7 @@ public Observable> deleteWithServiceResponseAsync(String r /** * Deletes a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -540,7 +540,7 @@ public void beginDelete(String resourceGroupName, String serverName) { /** * Deletes a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -553,7 +553,7 @@ public ServiceFuture beginDeleteAsync(String resourceGroupName, String ser /** * Deletes a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -570,7 +570,7 @@ public Void call(ServiceResponse response) { /** * Deletes a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -614,7 +614,7 @@ private ServiceResponse beginDeleteDelegate(Response respons /** * Gets information about a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -628,7 +628,7 @@ public ServerInner getByResourceGroup(String resourceGroupName, String serverNam /** * Gets information about a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -641,7 +641,7 @@ public ServiceFuture getByResourceGroupAsync(String resourceGroupNa /** * Gets information about a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ServerInner object @@ -658,7 +658,7 @@ public ServerInner call(ServiceResponse response) { /** * Gets information about a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ServerInner object @@ -700,7 +700,7 @@ private ServiceResponse getByResourceGroupDelegate(Response object if successful. */ public PagedList listByResourceGroup(String resourceGroupName) { @@ -718,7 +718,7 @@ public Page nextPage(String nextPageLink) { /** * List all the servers in a given resource group. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceFuture} object */ @@ -729,7 +729,7 @@ public ServiceFuture> listByResourceGroupAsync(String resource /** * List all the servers in a given resource group. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the observable to the List<ServerInner> object */ public Observable> listByResourceGroupAsync(String resourceGroupName) { @@ -746,7 +746,7 @@ public Page call(ServiceResponse> response) { /** * List all the servers in a given resource group. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the observable to the List<ServerInner> object */ public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { @@ -869,7 +869,7 @@ private ServiceResponse> listDelegate(Response restartAsync(String resourceGroupName, String serverN /** * Restarts a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -912,7 +912,7 @@ public Void call(ServiceResponse response) { /** * Restarts a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -937,7 +937,7 @@ public Observable> restartWithServiceResponseAsync(String /** * Restarts a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -950,7 +950,7 @@ public void beginRestart(String resourceGroupName, String serverName) { /** * Restarts a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -963,7 +963,7 @@ public ServiceFuture beginRestartAsync(String resourceGroupName, String se /** * Restarts a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. @@ -980,7 +980,7 @@ public Void call(ServiceResponse response) { /** * Restarts a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/TopQueryStatisticsImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/TopQueryStatisticsImpl.java new file mode 100644 index 000000000000..860050dd60ba --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/TopQueryStatisticsImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.TopQueryStatistics; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01.QueryStatistic; + +class TopQueryStatisticsImpl extends WrapperImpl implements TopQueryStatistics { + private final MariaDBManager manager; + + TopQueryStatisticsImpl(MariaDBManager manager) { + super(manager.inner().topQueryStatistics()); + this.manager = manager; + } + + public MariaDBManager manager() { + return this.manager; + } + + private QueryStatisticImpl wrapModel(QueryStatisticInner inner) { + return new QueryStatisticImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName, final TopQueryStatisticsInput parameters) { + TopQueryStatisticsInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName, parameters) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public QueryStatistic call(QueryStatisticInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String queryStatisticId) { + TopQueryStatisticsInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, queryStatisticId) + .flatMap(new Func1>() { + @Override + public Observable call(QueryStatisticInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((QueryStatistic)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/TopQueryStatisticsInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/TopQueryStatisticsInner.java new file mode 100644 index 000000000000..26bd9d198652 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/TopQueryStatisticsInner.java @@ -0,0 +1,413 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mariadb.v2018_06_01.TopQueryStatisticsInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in TopQueryStatistics. + */ +public class TopQueryStatisticsInner { + /** The Retrofit service to perform REST calls. */ + private TopQueryStatisticsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of TopQueryStatisticsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TopQueryStatisticsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(TopQueryStatisticsService.class); + this.client = client; + } + + /** + * The interface defining all the services for TopQueryStatistics to be + * used by Retrofit to perform actually REST calls. + */ + interface TopQueryStatisticsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.TopQueryStatistics get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/topQueryStatistics/{queryStatisticId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("queryStatisticId") String queryStatisticId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.TopQueryStatistics listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/topQueryStatistics") + Observable> listByServer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Body TopQueryStatisticsInput parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.TopQueryStatistics listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieve the query statistic for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryStatisticId The Query Statistic identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueryStatisticInner object if successful. + */ + public QueryStatisticInner get(String resourceGroupName, String serverName, String queryStatisticId) { + return getWithServiceResponseAsync(resourceGroupName, serverName, queryStatisticId).toBlocking().single().body(); + } + + /** + * Retrieve the query statistic for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryStatisticId The Query Statistic identifier. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String queryStatisticId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, queryStatisticId), serviceCallback); + } + + /** + * Retrieve the query statistic for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryStatisticId The Query Statistic identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryStatisticInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String queryStatisticId) { + return getWithServiceResponseAsync(resourceGroupName, serverName, queryStatisticId).map(new Func1, QueryStatisticInner>() { + @Override + public QueryStatisticInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve the query statistic for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param queryStatisticId The Query Statistic identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueryStatisticInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String queryStatisticId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (queryStatisticId == null) { + throw new IllegalArgumentException("Parameter queryStatisticId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, queryStatisticId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving top query statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QueryStatisticInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName, final TopQueryStatisticsInput parameters) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName, parameters).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving top query statistics. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerAsync(final String resourceGroupName, final String serverName, final TopQueryStatisticsInput parameters, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName, parameters), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving top query statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryStatisticInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName, final TopQueryStatisticsInput parameters) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName, parameters) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving top query statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryStatisticInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName, final TopQueryStatisticsInput parameters) { + return listByServerSinglePageAsync(resourceGroupName, serverName, parameters) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param serverName The name of the server. + ServiceResponse> * @param parameters The required parameters for retrieving top query statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QueryStatisticInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName, final TopQueryStatisticsInput parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<QueryStatisticInner> object if successful. + */ + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryStatisticInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<QueryStatisticInner> object + */ + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve the Query-Store top queries for specified metric and aggregation. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<QueryStatisticInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesImpl.java index c5aab5c6677e..cde1f000bf1b 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesImpl.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesImpl.java @@ -64,10 +64,14 @@ public VirtualNetworkRule call(VirtualNetworkRuleInner inner) { public Observable getAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { VirtualNetworkRulesInner client = this.inner(); return client.getAsync(resourceGroupName, serverName, virtualNetworkRuleName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public VirtualNetworkRule call(VirtualNetworkRuleInner inner) { - return wrapModel(inner); + public Observable call(VirtualNetworkRuleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((VirtualNetworkRule)wrapModel(inner)); + } } }); } diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesInner.java index a922a1542107..e00479692bf5 100644 --- a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesInner.java +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesInner.java @@ -94,7 +94,7 @@ interface VirtualNetworkRulesService { /** * Gets a virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -109,7 +109,7 @@ public VirtualNetworkRuleInner get(String resourceGroupName, String serverName, /** * Gets a virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -123,7 +123,7 @@ public ServiceFuture getAsync(String resourceGroupName, /** * Gets a virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -141,7 +141,7 @@ public VirtualNetworkRuleInner call(ServiceResponse res /** * Gets a virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -187,7 +187,7 @@ private ServiceResponse getDelegate(Response createOrUpdateAsync(String resourc /** * Creates or updates an existing virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @param parameters The requested virtual Network Rule Resource state. @@ -237,7 +237,7 @@ public VirtualNetworkRuleInner call(ServiceResponse res /** * Creates or updates an existing virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @param parameters The requested virtual Network Rule Resource state. @@ -271,7 +271,7 @@ public Observable> createOrUpdateWithSe /** * Creates or updates an existing virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @param parameters The requested virtual Network Rule Resource state. @@ -287,7 +287,7 @@ public VirtualNetworkRuleInner beginCreateOrUpdate(String resourceGroupName, Str /** * Creates or updates an existing virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @param parameters The requested virtual Network Rule Resource state. @@ -302,7 +302,7 @@ public ServiceFuture beginCreateOrUpdateAsync(String re /** * Creates or updates an existing virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @param parameters The requested virtual Network Rule Resource state. @@ -321,7 +321,7 @@ public VirtualNetworkRuleInner call(ServiceResponse res /** * Creates or updates an existing virtual network rule. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @param parameters The requested virtual Network Rule Resource state. @@ -374,7 +374,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Res /** * Deletes the virtual network rule with the given name. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -388,7 +388,7 @@ public void delete(String resourceGroupName, String serverName, String virtualNe /** * Deletes the virtual network rule with the given name. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -402,7 +402,7 @@ public ServiceFuture deleteAsync(String resourceGroupName, String serverNa /** * Deletes the virtual network rule with the given name. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -420,7 +420,7 @@ public Void call(ServiceResponse response) { /** * Deletes the virtual network rule with the given name. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -449,7 +449,7 @@ public Observable> deleteWithServiceResponseAsync(String r /** * Deletes the virtual network rule with the given name. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -463,7 +463,7 @@ public void beginDelete(String resourceGroupName, String serverName, String virt /** * Deletes the virtual network rule with the given name. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -477,7 +477,7 @@ public ServiceFuture beginDeleteAsync(String resourceGroupName, String ser /** * Deletes the virtual network rule with the given name. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -495,7 +495,7 @@ public Void call(ServiceResponse response) { /** * Deletes the virtual network rule with the given name. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param virtualNetworkRuleName The name of the virtual network rule. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -543,7 +543,7 @@ private ServiceResponse beginDeleteDelegate(Response respons /** * Gets a list of virtual network rules in a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -563,7 +563,7 @@ public Page nextPage(String nextPageLink) { /** * Gets a list of virtual network rules in a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -584,7 +584,7 @@ public Observable>> call(String ne /** * Gets a list of virtual network rules in a server. * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<VirtualNetworkRuleInner> object @@ -602,7 +602,7 @@ public Page call(ServiceResponse>> call(ServiceRe /** * Gets a list of virtual network rules in a server. * - ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. ServiceResponse> * @param serverName The name of the server. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticImpl.java new file mode 100644 index 000000000000..128f69e9f97d --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.WaitStatistic; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class WaitStatisticImpl extends IndexableRefreshableWrapperImpl implements WaitStatistic { + private final MariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String waitStatisticsId; + + WaitStatisticImpl(WaitStatisticInner inner, MariaDBManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.waitStatisticsId = IdParsingUtils.getValueFromIdByName(inner.id(), "waitStatistics"); + } + + @Override + public MariaDBManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + WaitStatisticsInner client = this.manager().inner().waitStatistics(); + return client.getAsync(this.resourceGroupName, this.serverName, this.waitStatisticsId); + } + + + + @Override + public Long count() { + return this.inner().count(); + } + + @Override + public String databaseName() { + return this.inner().databaseName(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public String eventName() { + return this.inner().eventName(); + } + + @Override + public String eventTypeName() { + return this.inner().eventTypeName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long queryId() { + return this.inner().queryId(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public Double totalTimeInMs() { + return this.inner().totalTimeInMs(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Long userId() { + return this.inner().userId(); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticInner.java new file mode 100644 index 000000000000..ae0a6f16644a --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticInner.java @@ -0,0 +1,255 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a Wait Statistic. + */ +@JsonFlatten +public class WaitStatisticInner extends ProxyResource { + /** + * Observation start time. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * Observation end time. + */ + @JsonProperty(value = "properties.endTime") + private DateTime endTime; + + /** + * Wait event name. + */ + @JsonProperty(value = "properties.eventName") + private String eventName; + + /** + * Wait event type name. + */ + @JsonProperty(value = "properties.eventTypeName") + private String eventTypeName; + + /** + * Database query identifier. + */ + @JsonProperty(value = "properties.queryId") + private Long queryId; + + /** + * Database Name. + */ + @JsonProperty(value = "properties.databaseName") + private String databaseName; + + /** + * Database user identifier. + */ + @JsonProperty(value = "properties.userId") + private Long userId; + + /** + * Wait event count observed in this time interval. + */ + @JsonProperty(value = "properties.count") + private Long count; + + /** + * Total time of wait in milliseconds in this time interval. + */ + @JsonProperty(value = "properties.totalTimeInMs") + private Double totalTimeInMs; + + /** + * Get observation start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set observation start time. + * + * @param startTime the startTime value to set + * @return the WaitStatisticInner object itself. + */ + public WaitStatisticInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get observation end time. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set observation end time. + * + * @param endTime the endTime value to set + * @return the WaitStatisticInner object itself. + */ + public WaitStatisticInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get wait event name. + * + * @return the eventName value + */ + public String eventName() { + return this.eventName; + } + + /** + * Set wait event name. + * + * @param eventName the eventName value to set + * @return the WaitStatisticInner object itself. + */ + public WaitStatisticInner withEventName(String eventName) { + this.eventName = eventName; + return this; + } + + /** + * Get wait event type name. + * + * @return the eventTypeName value + */ + public String eventTypeName() { + return this.eventTypeName; + } + + /** + * Set wait event type name. + * + * @param eventTypeName the eventTypeName value to set + * @return the WaitStatisticInner object itself. + */ + public WaitStatisticInner withEventTypeName(String eventTypeName) { + this.eventTypeName = eventTypeName; + return this; + } + + /** + * Get database query identifier. + * + * @return the queryId value + */ + public Long queryId() { + return this.queryId; + } + + /** + * Set database query identifier. + * + * @param queryId the queryId value to set + * @return the WaitStatisticInner object itself. + */ + public WaitStatisticInner withQueryId(Long queryId) { + this.queryId = queryId; + return this; + } + + /** + * Get database Name. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set database Name. + * + * @param databaseName the databaseName value to set + * @return the WaitStatisticInner object itself. + */ + public WaitStatisticInner withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get database user identifier. + * + * @return the userId value + */ + public Long userId() { + return this.userId; + } + + /** + * Set database user identifier. + * + * @param userId the userId value to set + * @return the WaitStatisticInner object itself. + */ + public WaitStatisticInner withUserId(Long userId) { + this.userId = userId; + return this; + } + + /** + * Get wait event count observed in this time interval. + * + * @return the count value + */ + public Long count() { + return this.count; + } + + /** + * Set wait event count observed in this time interval. + * + * @param count the count value to set + * @return the WaitStatisticInner object itself. + */ + public WaitStatisticInner withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get total time of wait in milliseconds in this time interval. + * + * @return the totalTimeInMs value + */ + public Double totalTimeInMs() { + return this.totalTimeInMs; + } + + /** + * Set total time of wait in milliseconds in this time interval. + * + * @param totalTimeInMs the totalTimeInMs value to set + * @return the WaitStatisticInner object itself. + */ + public WaitStatisticInner withTotalTimeInMs(Double totalTimeInMs) { + this.totalTimeInMs = totalTimeInMs; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticsImpl.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticsImpl.java new file mode 100644 index 000000000000..ec007925ee84 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticsImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.WaitStatistics; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01.WaitStatistic; + +class WaitStatisticsImpl extends WrapperImpl implements WaitStatistics { + private final MariaDBManager manager; + + WaitStatisticsImpl(MariaDBManager manager) { + super(manager.inner().waitStatistics()); + this.manager = manager; + } + + public MariaDBManager manager() { + return this.manager; + } + + private WaitStatisticImpl wrapModel(WaitStatisticInner inner) { + return new WaitStatisticImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName, final WaitStatisticsInput parameters) { + WaitStatisticsInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName, parameters) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WaitStatistic call(WaitStatisticInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String waitStatisticsId) { + WaitStatisticsInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, waitStatisticsId) + .flatMap(new Func1>() { + @Override + public Observable call(WaitStatisticInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((WaitStatistic)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticsInner.java b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticsInner.java new file mode 100644 index 000000000000..0e905674e367 --- /dev/null +++ b/sdk/mariadb/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/WaitStatisticsInner.java @@ -0,0 +1,413 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mariadb.v2018_06_01.WaitStatisticsInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in WaitStatistics. + */ +public class WaitStatisticsInner { + /** The Retrofit service to perform REST calls. */ + private WaitStatisticsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of WaitStatisticsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WaitStatisticsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(WaitStatisticsService.class); + this.client = client; + } + + /** + * The interface defining all the services for WaitStatistics to be + * used by Retrofit to perform actually REST calls. + */ + interface WaitStatisticsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.WaitStatistics get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/waitStatistics/{waitStatisticsId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("waitStatisticsId") String waitStatisticsId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.WaitStatistics listByServer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/waitStatistics") + Observable> listByServer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Body WaitStatisticsInput parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.WaitStatistics listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieve wait statistics for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param waitStatisticsId The Wait Statistic identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WaitStatisticInner object if successful. + */ + public WaitStatisticInner get(String resourceGroupName, String serverName, String waitStatisticsId) { + return getWithServiceResponseAsync(resourceGroupName, serverName, waitStatisticsId).toBlocking().single().body(); + } + + /** + * Retrieve wait statistics for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param waitStatisticsId The Wait Statistic identifier. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String waitStatisticsId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, waitStatisticsId), serviceCallback); + } + + /** + * Retrieve wait statistics for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param waitStatisticsId The Wait Statistic identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WaitStatisticInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String waitStatisticsId) { + return getWithServiceResponseAsync(resourceGroupName, serverName, waitStatisticsId).map(new Func1, WaitStatisticInner>() { + @Override + public WaitStatisticInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve wait statistics for specified identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param waitStatisticsId The Wait Statistic identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WaitStatisticInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String waitStatisticsId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (waitStatisticsId == null) { + throw new IllegalArgumentException("Parameter waitStatisticsId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, waitStatisticsId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving wait statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WaitStatisticInner> object if successful. + */ + public PagedList listByServer(final String resourceGroupName, final String serverName, final WaitStatisticsInput parameters) { + ServiceResponse> response = listByServerSinglePageAsync(resourceGroupName, serverName, parameters).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving wait statistics. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerAsync(final String resourceGroupName, final String serverName, final WaitStatisticsInput parameters, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerSinglePageAsync(resourceGroupName, serverName, parameters), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving wait statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WaitStatisticInner> object + */ + public Observable> listByServerAsync(final String resourceGroupName, final String serverName, final WaitStatisticsInput parameters) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName, parameters) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for retrieving wait statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WaitStatisticInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(final String resourceGroupName, final String serverName, final WaitStatisticsInput parameters) { + return listByServerSinglePageAsync(resourceGroupName, serverName, parameters) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param serverName The name of the server. + ServiceResponse> * @param parameters The required parameters for retrieving wait statistics. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WaitStatisticInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName, final WaitStatisticsInput parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WaitStatisticInner> object if successful. + */ + public PagedList listByServerNext(final String nextPageLink) { + ServiceResponse> response = listByServerNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByServerNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServerNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WaitStatisticInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WaitStatisticInner> object + */ + public Observable>> listByServerNextWithServiceResponseAsync(final String nextPageLink) { + return listByServerNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByServerNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Retrieve wait statistics for specified aggregation window. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WaitStatisticInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByServerNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +}