From 484e899d5b91c8c6d377675dec8347a6f9a769ee Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 1 Dec 2020 22:49:02 +0000 Subject: [PATCH] CodeGen from PR 11884 in Azure/azure-rest-api-specs Merge 4e1ad5e990f406600dc87c6afab063414548f6a0 into eea7c0141c0b7ad9f66f8ba06560b549c6b3b014 --- sdk/mariadb/mgmt-v2020_01_01/pom.xml | 4 +- .../mariadb/v2020_01_01/Advisor.java | 42 + .../mariadb/v2020_01_01/Advisors.java | 40 + .../v2020_01_01/AzureEntityResource.java | 3 +- .../mariadb/v2020_01_01/ErrorResponse.java | 5 +- .../LocationBasedPerformanceTiers.java | 5 +- ...ommendedActionSessionsOperationStatus.java | 29 + ...BasedRecommendedActionSessionsResults.java | 29 + .../PrivateEndpointConnection.java | 151 +++ .../PrivateEndpointConnections.java | 53 + .../v2020_01_01/PrivateLinkResource.java | 42 + .../PrivateLinkResourceProperties.java | 48 + .../v2020_01_01/PrivateLinkResources.java | 40 + ...ateLinkServiceConnectionStateProperty.java | 84 ++ ...erformanceInsightResetDataResultState.java | 41 + .../mariadb/v2020_01_01/QueryStatistic.java | 89 ++ .../mariadb/v2020_01_01/QueryText.java | 47 + .../mariadb/v2020_01_01/QueryTexts.java | 41 + .../v2020_01_01/RecommendationAction.java | 79 ++ ...ommendedActionSessionsOperationStatus.java | 36 + .../v2020_01_01/RecommendedActions.java | 42 + .../management/mariadb/v2020_01_01/Sku.java | 2 +- .../mariadb/v2020_01_01/TagsObject.java | 44 + .../v2020_01_01/TopQueryStatistics.java | 41 + .../v2020_01_01/TopQueryStatisticsInput.java | 176 +++ .../mariadb/v2020_01_01/WaitStatistic.java | 83 ++ .../mariadb/v2020_01_01/WaitStatistics.java | 41 + .../v2020_01_01/WaitStatisticsInput.java | 98 ++ .../implementation/AdvisorImpl.java | 63 + .../implementation/AdvisorInner.java | 44 + .../implementation/AdvisorsImpl.java | 69 + .../implementation/AdvisorsInner.java | 397 ++++++ .../CheckNameAvailabilitysInner.java | 2 +- .../implementation/ConfigurationsInner.java | 8 +- .../implementation/DatabasesInner.java | 12 +- .../implementation/FirewallRulesInner.java | 12 +- .../LocationBasedPerformanceTiersImpl.java | 6 +- .../LocationBasedPerformanceTiersInner.java | 2 +- ...ndedActionSessionsOperationStatusImpl.java | 42 + ...dedActionSessionsOperationStatusInner.java | 144 +++ ...dRecommendedActionSessionsResultsImpl.java | 49 + ...RecommendedActionSessionsResultsInner.java | 303 +++++ .../implementation/LogFilesInner.java | 2 +- .../MariaDBManagementClientImpl.java | 430 +++++++ .../implementation/MariaDBManager.java | 108 ++ .../implementation/OperationsInner.java | 2 +- .../PrivateEndpointConnectionImpl.java | 123 ++ .../PrivateEndpointConnectionInner.java | 89 ++ .../PrivateEndpointConnectionsImpl.java | 85 ++ .../PrivateEndpointConnectionsInner.java | 1133 +++++++++++++++++ .../PrivateLinkResourceImpl.java | 64 + .../PrivateLinkResourceInner.java | 34 + .../PrivateLinkResourcesImpl.java | 69 + .../PrivateLinkResourcesInner.java | 397 ++++++ ...erformanceInsightResetDataResultInner.java | 71 ++ .../implementation/QueryStatisticImpl.java | 110 ++ .../implementation/QueryStatisticInner.java | 282 ++++ .../implementation/QueryTextImpl.java | 68 + .../implementation/QueryTextInner.java | 72 ++ .../implementation/QueryTextsImpl.java | 69 + .../implementation/QueryTextsInner.java | 409 ++++++ .../RecommendationActionImpl.java | 102 ++ .../RecommendationActionInner.java | 230 ++++ ...ndedActionSessionsOperationStatusImpl.java | 42 + ...dedActionSessionsOperationStatusInner.java | 96 ++ .../RecommendedActionsImpl.java | 69 + .../RecommendedActionsInner.java | 540 ++++++++ .../implementation/ReplicasInner.java | 2 +- .../implementation/ServersInner.java | 22 +- .../TopQueryStatisticsImpl.java | 69 + .../TopQueryStatisticsInner.java | 409 ++++++ .../VirtualNetworkRulesInner.java | 12 +- .../implementation/WaitStatisticImpl.java | 104 ++ .../implementation/WaitStatisticInner.java | 255 ++++ .../implementation/WaitStatisticsImpl.java | 69 + .../implementation/WaitStatisticsInner.java | 409 ++++++ 76 files changed, 8587 insertions(+), 48 deletions(-) create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Advisor.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Advisors.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedRecommendedActionSessionsOperationStatus.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedRecommendedActionSessionsResults.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateEndpointConnection.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateEndpointConnections.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkResource.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkResourceProperties.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkResources.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkServiceConnectionStateProperty.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryPerformanceInsightResetDataResultState.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryStatistic.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryText.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryTexts.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/RecommendationAction.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/RecommendedActionSessionsOperationStatus.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/RecommendedActions.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/TagsObject.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/TopQueryStatistics.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/TopQueryStatisticsInput.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatistic.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatistics.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatisticsInput.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorsImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorsInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsResultsInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionsInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourceInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourcesInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryPerformanceInsightResetDataResultInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryStatisticImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryStatisticInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextsImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextsInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendationActionImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendationActionInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionSessionsOperationStatusImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionSessionsOperationStatusInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionsImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionsInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/TopQueryStatisticsImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/TopQueryStatisticsInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticInner.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticsImpl.java create mode 100644 sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticsInner.java diff --git a/sdk/mariadb/mgmt-v2020_01_01/pom.xml b/sdk/mariadb/mgmt-v2020_01_01/pom.xml index 06aff1458709..e3891d2a1a83 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/pom.xml +++ b/sdk/mariadb/mgmt-v2020_01_01/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.3.2 - ../../parents/azure-arm-parent/pom.xml + 1.1.0 + ../../../pom.management.xml azure-mgmt-mariadb 1.0.0-beta diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Advisor.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Advisor.java new file mode 100644 index 000000000000..2dcac25ed39d --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Advisors.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Advisors.java new file mode 100644 index 000000000000..ce09c0b24bde --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/AzureEntityResource.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/AzureEntityResource.java index e21dea3095a9..71668e46997a 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/AzureEntityResource.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/AzureEntityResource.java @@ -12,7 +12,8 @@ import com.microsoft.azure.ProxyResource; /** - * The resource model definition for a Azure Resource Manager resource with an + * Entity Resource. + * The resource model definition for an Azure Resource Manager resource with an * etag. */ public class AzureEntityResource extends ProxyResource { diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/ErrorResponse.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/ErrorResponse.java index e7d7e145646c..cdf207b49c5d 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/ErrorResponse.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/ErrorResponse.java @@ -12,7 +12,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The resource management error response. + * Error Response. + * Common error response for all Azure Resource Manager APIs to return error + * details for failed operations. (This also follows the OData error response + * format.). */ public class ErrorResponse { /** diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedPerformanceTiers.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedPerformanceTiers.java index 54a00c72f877..baf6a60e4203 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedPerformanceTiers.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedPerformanceTiers.java @@ -9,12 +9,13 @@ package com.microsoft.azure.management.mariadb.v2020_01_01; import rx.Observable; -import com.microsoft.azure.management.mariadb.v2020_01_01.PerformanceTierProperties; +import com.microsoft.azure.management.mariadb.v2020_01_01.implementation.LocationBasedPerformanceTiersInner; +import com.microsoft.azure.arm.model.HasInner; /** * Type representing LocationBasedPerformanceTiers. */ -public interface LocationBasedPerformanceTiers { +public interface LocationBasedPerformanceTiers extends HasInner { /** * List all the performance tiers at specified location in a given subscription. * diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedRecommendedActionSessionsOperationStatus.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedRecommendedActionSessionsOperationStatus.java new file mode 100644 index 000000000000..ac64609284a4 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedRecommendedActionSessionsResults.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/LocationBasedRecommendedActionSessionsResults.java new file mode 100644 index 000000000000..28381a1206af --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateEndpointConnection.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateEndpointConnection.java new file mode 100644 index 000000000000..674946b652fa --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateEndpointConnections.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateEndpointConnections.java new file mode 100644 index 000000000000..aae8450307b2 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkResource.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkResource.java new file mode 100644 index 000000000000..335fb8e3be63 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkResourceProperties.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..2cf64d256812 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkResources.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkResources.java new file mode 100644 index 000000000000..ac0a5681eef3 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkServiceConnectionStateProperty.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/PrivateLinkServiceConnectionStateProperty.java new file mode 100644 index 000000000000..d01ac0525496 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryPerformanceInsightResetDataResultState.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryPerformanceInsightResetDataResultState.java new file mode 100644 index 000000000000..346df7776259 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryPerformanceInsightResetDataResultState.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.v2020_01_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for QueryPerformanceInsightResetDataResultState. + */ +public final class QueryPerformanceInsightResetDataResultState extends ExpandableStringEnum { + /** Static value Succeeded for QueryPerformanceInsightResetDataResultState. */ + public static final QueryPerformanceInsightResetDataResultState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for QueryPerformanceInsightResetDataResultState. */ + public static final QueryPerformanceInsightResetDataResultState FAILED = fromString("Failed"); + + /** + * Creates or finds a QueryPerformanceInsightResetDataResultState from its string representation. + * @param name a name to look for + * @return the corresponding QueryPerformanceInsightResetDataResultState + */ + @JsonCreator + public static QueryPerformanceInsightResetDataResultState fromString(String name) { + return fromString(name, QueryPerformanceInsightResetDataResultState.class); + } + + /** + * @return known QueryPerformanceInsightResetDataResultState values + */ + public static Collection values() { + return values(QueryPerformanceInsightResetDataResultState.class); + } +} diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryStatistic.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryStatistic.java new file mode 100644 index 000000000000..3532331b630a --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryText.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryText.java new file mode 100644 index 000000000000..c7efe0ea8dfc --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryTexts.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/QueryTexts.java new file mode 100644 index 000000000000..9453e868db1c --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/RecommendationAction.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/RecommendationAction.java new file mode 100644 index 000000000000..ae74b7e8bc5a --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/RecommendedActionSessionsOperationStatus.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/RecommendedActionSessionsOperationStatus.java new file mode 100644 index 000000000000..459f664eca10 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2020_01_01.implementation.MariaDBManager; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/RecommendedActions.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/RecommendedActions.java new file mode 100644 index 000000000000..9f060f42a6c3 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Sku.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Sku.java index 7f908b85af96..4bfa3db030b6 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Sku.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/Sku.java @@ -18,7 +18,7 @@ public class Sku { * The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, * GP_Gen5_8. */ - @JsonProperty(value = "name") + @JsonProperty(value = "name", required = true) private String name; /** diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/TagsObject.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/TagsObject.java new file mode 100644 index 000000000000..35dd9343197e --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/TopQueryStatistics.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/TopQueryStatistics.java new file mode 100644 index 000000000000..b25bae806358 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/TopQueryStatisticsInput.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/TopQueryStatisticsInput.java new file mode 100644 index 000000000000..e947392d206a --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatistic.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatistic.java new file mode 100644 index 000000000000..4881e4742c90 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatistic.java @@ -0,0 +1,83 @@ +/** + * 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.v2020_01_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2020_01_01.implementation.WaitStatisticInner; +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.v2020_01_01.implementation.MariaDBManager; +import org.joda.time.DateTime; + +/** + * Type representing WaitStatistic. + */ +public interface WaitStatistic extends HasInner, 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatistics.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatistics.java new file mode 100644 index 000000000000..2d21c378ae6c --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatisticsInput.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/WaitStatisticsInput.java new file mode 100644 index 000000000000..51c7e8f06151 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorImpl.java new file mode 100644 index 000000000000..080650ce4e45 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorInner.java new file mode 100644 index 000000000000..79cc21bb604f --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorsImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorsImpl.java new file mode 100644 index 000000000000..d592f6051bad --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2020_01_01.Advisors; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorsInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorsInner.java new file mode 100644 index 000000000000..d11a69701a7d --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/AdvisorsInner.java @@ -0,0 +1,397 @@ +/** + * 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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, advisorName, 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."); + } + final String apiVersion = "2018-06-01"; + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/CheckNameAvailabilitysInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/CheckNameAvailabilitysInner.java index 27e3d8cacc3e..f44a902376d3 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/CheckNameAvailabilitysInner.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/CheckNameAvailabilitysInner.java @@ -55,7 +55,7 @@ public CheckNameAvailabilitysInner(Retrofit retrofit, MariaDBManagementClientImp */ interface CheckNameAvailabilitysService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2020_01_01.CheckNameAvailabilitys execute" }) - @POST("subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/checkNameAvailability") + @POST("subscriptions/{subscriptionId}/providers/Microsoft.DBForMariaDB/checkNameAvailability") Observable> execute(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body NameAvailabilityRequest nameAvailabilityRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ConfigurationsInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ConfigurationsInner.java index eb3b0ab95d25..148a1926d5c9 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ConfigurationsInner.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ConfigurationsInner.java @@ -56,19 +56,19 @@ public ConfigurationsInner(Retrofit retrofit, MariaDBManagementClientImpl client */ interface ConfigurationsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2020_01_01.Configurations createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/configurations/{configurationName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/configurations/{configurationName}") Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body ConfigurationInner 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.v2020_01_01.Configurations beginCreateOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/configurations/{configurationName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/configurations/{configurationName}") Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body ConfigurationInner 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.v2020_01_01.Configurations get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/configurations/{configurationName}") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/configurations/{configurationName}") Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("configurationName") String configurationName, @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.v2020_01_01.Configurations listByServer" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/configurations") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/configurations") 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); } diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/DatabasesInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/DatabasesInner.java index e6c5d3db5522..eeae9a1c7caf 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/DatabasesInner.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/DatabasesInner.java @@ -57,27 +57,27 @@ public DatabasesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { */ interface DatabasesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2020_01_01.Databases createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/databases/{databaseName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases/{databaseName}") Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body DatabaseInner 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.v2020_01_01.Databases beginCreateOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/databases/{databaseName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases/{databaseName}") Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body DatabaseInner 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.v2020_01_01.Databases delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/databases/{databaseName}", method = "DELETE", hasBody = true) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases/{databaseName}", method = "DELETE", hasBody = true) Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.v2020_01_01.Databases beginDelete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/databases/{databaseName}", method = "DELETE", hasBody = true) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases/{databaseName}", method = "DELETE", hasBody = true) Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.v2020_01_01.Databases get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/databases/{databaseName}") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases/{databaseName}") Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("databaseName") String databaseName, @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.v2020_01_01.Databases listByServer" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/databases") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/databases") 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); } diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/FirewallRulesInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/FirewallRulesInner.java index b13529f0a527..49e2297085e5 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/FirewallRulesInner.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/FirewallRulesInner.java @@ -57,27 +57,27 @@ public FirewallRulesInner(Retrofit retrofit, MariaDBManagementClientImpl client) */ interface FirewallRulesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2020_01_01.FirewallRules createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}") Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("firewallRuleName") String firewallRuleName, @Query("api-version") String apiVersion, @Body FirewallRuleInner 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.v2020_01_01.FirewallRules beginCreateOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}") Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("firewallRuleName") String firewallRuleName, @Query("api-version") String apiVersion, @Body FirewallRuleInner 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.v2020_01_01.FirewallRules delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}", method = "DELETE", hasBody = true) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}", method = "DELETE", hasBody = true) Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("firewallRuleName") String firewallRuleName, @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.v2020_01_01.FirewallRules beginDelete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}", method = "DELETE", hasBody = true) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}", method = "DELETE", hasBody = true) Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("firewallRuleName") String firewallRuleName, @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.v2020_01_01.FirewallRules get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}") Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("firewallRuleName") String firewallRuleName, @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.v2020_01_01.FirewallRules listByServer" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/firewallRules") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/firewallRules") 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); } diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedPerformanceTiersImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedPerformanceTiersImpl.java index bd70d6322dc2..4304cde9f152 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedPerformanceTiersImpl.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedPerformanceTiersInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedPerformanceTiersInner.java index bf63aedffb7b..de6c3847674c 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedPerformanceTiersInner.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedPerformanceTiersInner.java @@ -53,7 +53,7 @@ public LocationBasedPerformanceTiersInner(Retrofit retrofit, MariaDBManagementCl */ interface LocationBasedPerformanceTiersService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2020_01_01.LocationBasedPerformanceTiers list" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/locations/{locationName}/performanceTiers") + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DBForMariaDB/locations/{locationName}/performanceTiers") Observable> list(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java new file mode 100644 index 000000000000..e0ffcb871675 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2020_01_01.LocationBasedRecommendedActionSessionsOperationStatus; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusInner.java new file mode 100644 index 000000000000..508fb6fc7500 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsOperationStatusInner.java @@ -0,0 +1,144 @@ +/** + * 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.v2020_01_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.v2020_01_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."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), locationName, operationId, 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java new file mode 100644 index 000000000000..7e0c7a773374 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2020_01_01.LocationBasedRecommendedActionSessionsResults; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsResultsInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsResultsInner.java new file mode 100644 index 000000000000..6b2cad4a85b4 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LocationBasedRecommendedActionSessionsResultsInner.java @@ -0,0 +1,303 @@ +/** + * 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.v2020_01_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.v2020_01_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.v2020_01_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."); + } + final String apiVersion = "2018-06-01"; + return service.list(this.client.subscriptionId(), locationName, operationId, 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LogFilesInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LogFilesInner.java index d029a54ba680..bbb45cc810f7 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LogFilesInner.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/LogFilesInner.java @@ -53,7 +53,7 @@ public LogFilesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { */ interface LogFilesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2020_01_01.LogFiles listByServer" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/logFiles") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/logFiles") 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); } diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/MariaDBManagementClientImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/MariaDBManagementClientImpl.java index 8937c48e62c4..0489d61c163a 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/MariaDBManagementClientImpl.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/MariaDBManagementClientImpl.java @@ -8,15 +8,32 @@ package com.microsoft.azure.management.mariadb.v2020_01_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; @@ -250,6 +267,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; + } + /** * The ServerSecurityAlertPoliciesInner object to access its operations. */ @@ -307,8 +441,18 @@ protected void initialize() { this.locationBasedPerformanceTiers = new LocationBasedPerformanceTiersInner(restClient().retrofit(), this); this.checkNameAvailabilitys = new CheckNameAvailabilitysInner(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.serverSecurityAlertPolicies = new ServerSecurityAlertPoliciesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); + initializeService(); } /** @@ -320,4 +464,290 @@ protected void initialize() { public String userAgent() { return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "MariaDBManagementClient", "2020-01-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.v2020_01_01.MariaDBManagementClient resetQueryPerformanceInsightData" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/resetQueryPerformanceInsightData") + Observable> resetQueryPerformanceInsightData(@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.v2020_01_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.v2020_01_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); + + } + + /** + * Reset data for Query Performance Insight. + * + * @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 QueryPerformanceInsightResetDataResultInner object if successful. + */ + public QueryPerformanceInsightResetDataResultInner resetQueryPerformanceInsightData(String resourceGroupName, String serverName) { + return resetQueryPerformanceInsightDataWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * Reset data for Query Performance Insight. + * + * @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 resetQueryPerformanceInsightDataAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetQueryPerformanceInsightDataWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Reset data for Query Performance Insight. + * + * @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 QueryPerformanceInsightResetDataResultInner object + */ + public Observable resetQueryPerformanceInsightDataAsync(String resourceGroupName, String serverName) { + return resetQueryPerformanceInsightDataWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, QueryPerformanceInsightResetDataResultInner>() { + @Override + public QueryPerformanceInsightResetDataResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reset data for Query Performance Insight. + * + * @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 QueryPerformanceInsightResetDataResultInner object + */ + public Observable> resetQueryPerformanceInsightDataWithServiceResponseAsync(String resourceGroupName, String serverName) { + 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."); + } + final String apiVersion = "2018-06-01"; + return service.resetQueryPerformanceInsightData(this.subscriptionId(), resourceGroupName, serverName, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = resetQueryPerformanceInsightDataDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse resetQueryPerformanceInsightDataDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.createRecommendedActionSession(this.subscriptionId(), resourceGroupName, serverName, advisorName, 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + final String apiVersion = "2018-06-01"; + return service.beginCreateRecommendedActionSession(this.subscriptionId(), resourceGroupName, serverName, advisorName, 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/MariaDBManager.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/MariaDBManager.java index 41ad375debb5..b3ee58a9b31c 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/MariaDBManager.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/MariaDBManager.java @@ -26,6 +26,15 @@ import com.microsoft.azure.management.mariadb.v2020_01_01.LocationBasedPerformanceTiers; import com.microsoft.azure.management.mariadb.v2020_01_01.CheckNameAvailabilitys; import com.microsoft.azure.management.mariadb.v2020_01_01.Operations; +import com.microsoft.azure.management.mariadb.v2020_01_01.QueryTexts; +import com.microsoft.azure.management.mariadb.v2020_01_01.TopQueryStatistics; +import com.microsoft.azure.management.mariadb.v2020_01_01.WaitStatistics; +import com.microsoft.azure.management.mariadb.v2020_01_01.Advisors; +import com.microsoft.azure.management.mariadb.v2020_01_01.RecommendedActions; +import com.microsoft.azure.management.mariadb.v2020_01_01.LocationBasedRecommendedActionSessionsOperationStatus; +import com.microsoft.azure.management.mariadb.v2020_01_01.LocationBasedRecommendedActionSessionsResults; +import com.microsoft.azure.management.mariadb.v2020_01_01.PrivateEndpointConnections; +import com.microsoft.azure.management.mariadb.v2020_01_01.PrivateLinkResources; import com.microsoft.azure.management.mariadb.v2020_01_01.ServerSecurityAlertPolicies; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -44,6 +53,15 @@ public final class MariaDBManager extends ManagerCore> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..8704b0632f4a --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,123 @@ +/** + * 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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_01.PrivateEndpointConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_01.PrivateEndpointProperty; +import com.microsoft.azure.management.mariadb.v2020_01_01.PrivateLinkServiceConnectionStateProperty; + +class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..7b897a932956 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_01.PrivateEndpointProperty; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionsImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..129aaf80c71a --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2020_01_01.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionsInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 000000000000..c614d9009de6 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,1133 @@ +/** + * 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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), 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."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + Observable> observable = service.createOrUpdate(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), parameters, 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."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.beginCreateOrUpdate(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), parameters, 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."); + } + final String apiVersion = "2018-06-01"; + Observable> observable = service.delete(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), 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."); + } + final String apiVersion = "2018-06-01"; + return service.beginDelete(resourceGroupName, serverName, privateEndpointConnectionName, this.client.subscriptionId(), 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."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, 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."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + Observable> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, 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."); + } + final String apiVersion = "2018-06-01"; + final Map tags = null; + TagsObject parameters = new TagsObject(); + parameters.withTags(null); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, 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."); + } + Validator.validate(tags); + final String apiVersion = "2018-06-01"; + TagsObject parameters = new TagsObject(); + parameters.withTags(tags); + return service.beginUpdateTags(this.client.subscriptionId(), resourceGroupName, serverName, privateEndpointConnectionName, 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."); + } + final String apiVersion = "2018-06-01"; + return service.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourceImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..39aa3110d4ce --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_01.PrivateLinkResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourceInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..fd9d5e6c3bf6 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourcesImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..d24244453de9 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2020_01_01.PrivateLinkResources; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourcesInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 000000000000..af4757aaf50c --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,397 @@ +/** + * 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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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."); + } + final String apiVersion = "2018-06-01"; + return service.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), 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."); + } + final String apiVersion = "2018-06-01"; + return service.get(resourceGroupName, serverName, groupName, this.client.subscriptionId(), 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryPerformanceInsightResetDataResultInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryPerformanceInsightResetDataResultInner.java new file mode 100644 index 000000000000..31cb8f53690e --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryPerformanceInsightResetDataResultInner.java @@ -0,0 +1,71 @@ +/** + * 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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_01.QueryPerformanceInsightResetDataResultState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of Query Performance Insight data reset. + */ +public class QueryPerformanceInsightResetDataResultInner { + /** + * Indicates result of the operation. Possible values include: 'Succeeded', + * 'Failed'. + */ + @JsonProperty(value = "status") + private QueryPerformanceInsightResetDataResultState status; + + /** + * operation message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get indicates result of the operation. Possible values include: 'Succeeded', 'Failed'. + * + * @return the status value + */ + public QueryPerformanceInsightResetDataResultState status() { + return this.status; + } + + /** + * Set indicates result of the operation. Possible values include: 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the QueryPerformanceInsightResetDataResultInner object itself. + */ + public QueryPerformanceInsightResetDataResultInner withStatus(QueryPerformanceInsightResetDataResultState status) { + this.status = status; + return this; + } + + /** + * Get operation message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set operation message. + * + * @param message the message value to set + * @return the QueryPerformanceInsightResetDataResultInner object itself. + */ + public QueryPerformanceInsightResetDataResultInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryStatisticImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryStatisticImpl.java new file mode 100644 index 000000000000..411a4556359b --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryStatisticInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryStatisticInner.java new file mode 100644 index 000000000000..4095cac2725a --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextImpl.java new file mode 100644 index 000000000000..13e7af896ac2 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextInner.java new file mode 100644 index 000000000000..54d874315826 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextsImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextsImpl.java new file mode 100644 index 000000000000..78d2979822f8 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2020_01_01.QueryTexts; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextsInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextsInner.java new file mode 100644 index 000000000000..5a20b6cd4d52 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/QueryTextsInner.java @@ -0,0 +1,409 @@ +/** + * 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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, queryId, 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 (queryIds == null) { + throw new IllegalArgumentException("Parameter queryIds is required and cannot be null."); + } + Validator.validate(queryIds); + final String apiVersion = "2018-06-01"; + String queryIdsConverted = this.client.serializerAdapter().serializeList(queryIds, CollectionFormat.MULTI); + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendationActionImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendationActionImpl.java new file mode 100644 index 000000000000..431002a831b4 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendationActionInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendationActionInner.java new file mode 100644 index 000000000000..0ce8119c30d1 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionSessionsOperationStatusImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionSessionsOperationStatusImpl.java new file mode 100644 index 000000000000..9fc081629292 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionSessionsOperationStatusInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionSessionsOperationStatusInner.java new file mode 100644 index 000000000000..072b5404c751 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionsImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionsImpl.java new file mode 100644 index 000000000000..e61c11c5da96 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2020_01_01.RecommendedActions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionsInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionsInner.java new file mode 100644 index 000000000000..6c38ba063a11 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/RecommendedActionsInner.java @@ -0,0 +1,540 @@ +/** + * 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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, advisorName, recommendedActionName, 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."); + } + final String apiVersion = "2018-06-01"; + final String sessionId = null; + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, advisorName, 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."); + } + final String apiVersion = "2018-06-01"; + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, advisorName, 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ReplicasInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ReplicasInner.java index 1dad858510ad..28827e16ecc6 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ReplicasInner.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ReplicasInner.java @@ -53,7 +53,7 @@ public ReplicasInner(Retrofit retrofit, MariaDBManagementClientImpl client) { */ interface ReplicasService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2020_01_01.Replicas listByServer" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/replicas") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/replicas") 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); } diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ServersInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ServersInner.java index 7bbeb019be4b..52558121db3e 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ServersInner.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/ServersInner.java @@ -66,47 +66,47 @@ public ServersInner(Retrofit retrofit, MariaDBManagementClientImpl client) { */ interface ServersService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2020_01_01.Servers create" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}") Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Body ServerForCreate 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.v2020_01_01.Servers beginCreate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}") Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Body ServerForCreate 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.v2020_01_01.Servers update" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}") + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}") Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Body ServerUpdateParameters 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.v2020_01_01.Servers beginUpdate" }) - @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}") + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}") Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Query("api-version") String apiVersion, @Body ServerUpdateParameters 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.v2020_01_01.Servers delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}", method = "DELETE", hasBody = true) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}", method = "DELETE", hasBody = true) Observable> delete(@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.v2020_01_01.Servers beginDelete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}", method = "DELETE", hasBody = true) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}", method = "DELETE", hasBody = true) Observable> beginDelete(@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.v2020_01_01.Servers getByResourceGroup" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}") Observable> getByResourceGroup(@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.v2020_01_01.Servers listByResourceGroup" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers") Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.v2020_01_01.Servers list" }) - @GET("subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/servers") + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DBForMariaDB/servers") Observable> list(@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.v2020_01_01.Servers restart" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/restart") + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/restart") Observable> restart(@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.v2020_01_01.Servers beginRestart" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/restart") + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/restart") Observable> beginRestart(@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.v2020_01_01.Servers start" }) diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/TopQueryStatisticsImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/TopQueryStatisticsImpl.java new file mode 100644 index 000000000000..ed17715da528 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2020_01_01.TopQueryStatistics; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/TopQueryStatisticsInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/TopQueryStatisticsInner.java new file mode 100644 index 000000000000..14141feb135b --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/TopQueryStatisticsInner.java @@ -0,0 +1,409 @@ +/** + * 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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, queryStatisticId, 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, 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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/VirtualNetworkRulesInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/VirtualNetworkRulesInner.java index e272efe6008b..b8fcc2a67b30 100644 --- a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/VirtualNetworkRulesInner.java +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/VirtualNetworkRulesInner.java @@ -62,27 +62,27 @@ public VirtualNetworkRulesInner(Retrofit retrofit, MariaDBManagementClientImpl c */ interface VirtualNetworkRulesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2020_01_01.VirtualNetworkRules get" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}") Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("subscriptionId") String subscriptionId, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @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.v2020_01_01.VirtualNetworkRules createOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}") Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("subscriptionId") String subscriptionId, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @Query("api-version") String apiVersion, @Body VirtualNetworkRuleInner 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.v2020_01_01.VirtualNetworkRules beginCreateOrUpdate" }) - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}") + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}") Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("subscriptionId") String subscriptionId, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @Query("api-version") String apiVersion, @Body VirtualNetworkRuleInner 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.v2020_01_01.VirtualNetworkRules delete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", method = "DELETE", hasBody = true) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", method = "DELETE", hasBody = true) Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @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.v2020_01_01.VirtualNetworkRules beginDelete" }) - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", method = "DELETE", hasBody = true) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", method = "DELETE", hasBody = true) Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("virtualNetworkRuleName") String virtualNetworkRuleName, @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.v2020_01_01.VirtualNetworkRules listByServer" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/virtualNetworkRules") + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMariaDB/servers/{serverName}/virtualNetworkRules") 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.v2020_01_01.VirtualNetworkRules listByServerNext" }) diff --git a/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticImpl.java new file mode 100644 index 000000000000..599e8ff94cbb --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticInner.java new file mode 100644 index 000000000000..0d7624e5f3a0 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticsImpl.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticsImpl.java new file mode 100644 index 000000000000..b1a49f5b0505 --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_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.v2020_01_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2020_01_01.WaitStatistics; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2020_01_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-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticsInner.java b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticsInner.java new file mode 100644 index 000000000000..fa745a44fc5a --- /dev/null +++ b/sdk/mariadb/mgmt-v2020_01_01/src/main/java/com/microsoft/azure/management/mariadb/v2020_01_01/implementation/WaitStatisticsInner.java @@ -0,0 +1,409 @@ +/** + * 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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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.v2020_01_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."); + } + final String apiVersion = "2018-06-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, waitStatisticsId, 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-06-01"; + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, 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); + } + +}