From e3a1329dc70e797387b10ecd6f4509c62f12e3ec Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 12 Sep 2018 15:24:41 -0700 Subject: [PATCH 1/4] [AutoPR mariadb/resource-manager] Add mariadb swagger spec (#2359) * Generated from d76559bb32dbc6be98d3f9cc774377be21694188 Add mariadb swagger spec * Generated from 74e04a40cc63c0e6634cce5256bc660b8986132e Fix readme and set properties --- .../v2018_06_01_preview/pom.xml | 133 +++ .../CheckNameAvailabilitys.java | 28 + .../v2018_06_01_preview/Configuration.java | 155 ++++ .../v2018_06_01_preview/Configurations.java | 41 + .../mariadb/v2018_06_01_preview/Database.java | 135 +++ .../v2018_06_01_preview/Databases.java | 53 ++ .../v2018_06_01_preview/FirewallRule.java | 115 +++ .../v2018_06_01_preview/FirewallRules.java | 53 ++ .../GeoRedundantBackup.java | 41 + .../LocationBasedPerformanceTiers.java | 27 + .../mariadb/v2018_06_01_preview/LogFile.java | 61 ++ .../mariadb/v2018_06_01_preview/LogFiles.java | 29 + .../v2018_06_01_preview/NameAvailability.java | 35 + .../NameAvailabilityRequest.java | 69 ++ .../v2018_06_01_preview/OperationDisplay.java | 77 ++ .../OperationListResult.java | 27 + .../v2018_06_01_preview/OperationOrigin.java | 44 + .../v2018_06_01_preview/Operations.java | 27 + .../PerformanceTierProperties.java | 31 + ...PerformanceTierServiceLevelObjectives.java | 225 +++++ .../mariadb/v2018_06_01_preview/Server.java | 179 ++++ .../v2018_06_01_preview/ServerForCreate.java | 122 +++ .../ServerPropertiesForCreate.java | 106 +++ .../ServerPropertiesForDefaultCreate.java | 74 ++ .../ServerPropertiesForGeoRestore.java | 48 + .../ServerPropertiesForRestore.java | 75 ++ .../ServerSecurityAlertPolicies.java | 30 + .../ServerSecurityAlertPolicy.java | 251 +++++ .../ServerSecurityAlertPolicyState.java | 53 ++ .../v2018_06_01_preview/ServerState.java | 44 + .../ServerUpdateParameters.java | 177 ++++ .../v2018_06_01_preview/ServerVersion.java | 41 + .../mariadb/v2018_06_01_preview/Servers.java | 25 + .../mariadb/v2018_06_01_preview/Sku.java | 149 +++ .../mariadb/v2018_06_01_preview/SkuTier.java | 44 + .../SslEnforcementEnum.java | 53 ++ .../v2018_06_01_preview/StorageProfile.java | 96 ++ .../CheckNameAvailabilitysImpl.java | 43 + .../CheckNameAvailabilitysInner.java | 143 +++ .../implementation/ConfigurationImpl.java | 136 +++ .../implementation/ConfigurationInner.java | 132 +++ .../implementation/ConfigurationsImpl.java | 74 ++ .../implementation/ConfigurationsInner.java | 446 +++++++++ .../implementation/DBforMariaDBManager.java | 195 ++++ .../implementation/DatabaseImpl.java | 116 +++ .../implementation/DatabaseInner.java | 72 ++ .../implementation/DatabasesImpl.java | 81 ++ .../implementation/DatabasesInner.java | 625 +++++++++++++ .../implementation/FirewallRuleImpl.java | 116 +++ .../implementation/FirewallRuleInner.java | 72 ++ .../implementation/FirewallRulesImpl.java | 81 ++ .../implementation/FirewallRulesInner.java | 625 +++++++++++++ .../implementation/IdParsingUtils.java | 57 ++ .../LocationBasedPerformanceTiersImpl.java | 53 ++ .../LocationBasedPerformanceTiersInner.java | 145 +++ .../implementation/LogFileImpl.java | 71 ++ .../implementation/LogFileInner.java | 118 +++ .../implementation/LogFilesImpl.java | 53 ++ .../implementation/LogFilesInner.java | 152 ++++ .../MariaDBManagementClientImpl.java | 308 +++++++ .../implementation/NameAvailabilityImpl.java | 41 + .../implementation/NameAvailabilityInner.java | 95 ++ .../implementation/OperationInner.java | 82 ++ .../OperationListResultImpl.java | 32 + .../OperationListResultInner.java | 44 + .../implementation/OperationsImpl.java | 42 + .../implementation/OperationsInner.java | 128 +++ .../implementation/PageImpl.java | 75 ++ .../PerformanceTierPropertiesImpl.java | 42 + .../PerformanceTierPropertiesInner.java | 71 ++ .../implementation/ServerImpl.java | 160 ++++ .../implementation/ServerInner.java | 237 +++++ .../ServerSecurityAlertPoliciesImpl.java | 55 ++ .../ServerSecurityAlertPoliciesInner.java | 332 +++++++ .../ServerSecurityAlertPolicyImpl.java | 171 ++++ .../ServerSecurityAlertPolicyInner.java | 209 +++++ .../implementation/ServersImpl.java | 138 +++ .../implementation/ServersInner.java | 860 ++++++++++++++++++ .../implementation/package-info.java | 11 + .../v2018_06_01_preview/package-info.java | 11 + 80 files changed, 9723 insertions(+) create mode 100644 mariadb/resource-manager/v2018_06_01_preview/pom.xml create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/CheckNameAvailabilitys.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Configuration.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Configurations.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Database.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Databases.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/FirewallRule.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/FirewallRules.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/GeoRedundantBackup.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LocationBasedPerformanceTiers.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LogFile.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LogFiles.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/NameAvailability.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/NameAvailabilityRequest.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationDisplay.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationListResult.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationOrigin.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Operations.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/PerformanceTierProperties.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/PerformanceTierServiceLevelObjectives.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Server.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerForCreate.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForCreate.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForDefaultCreate.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForGeoRestore.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForRestore.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicies.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicy.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicyState.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerState.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerUpdateParameters.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerVersion.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Servers.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Sku.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/SkuTier.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/SslEnforcementEnum.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/StorageProfile.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/CheckNameAvailabilitysImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/CheckNameAvailabilitysInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationsImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationsInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DBforMariaDBManager.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabaseImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabaseInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabasesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabasesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRuleImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRuleInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRulesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRulesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/IdParsingUtils.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LocationBasedPerformanceTiersImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LocationBasedPerformanceTiersInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFileImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFileInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFilesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFilesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/MariaDBManagementClientImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/NameAvailabilityImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/NameAvailabilityInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationListResultImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationListResultInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationsImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationsInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PageImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PerformanceTierPropertiesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PerformanceTierPropertiesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPoliciesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPoliciesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPolicyImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPolicyInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServersImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServersInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/package-info.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/package-info.java diff --git a/mariadb/resource-manager/v2018_06_01_preview/pom.xml b/mariadb/resource-manager/v2018_06_01_preview/pom.xml new file mode 100644 index 0000000000000..00bb41cd268d0 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.mariadb.v2018_06_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-dbformariadb + 1.0.0-beta + jar + Microsoft Azure SDK for DBforMariaDB Management + This package contains Microsoft DBforMariaDB Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/CheckNameAvailabilitys.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/CheckNameAvailabilitys.java new file mode 100644 index 0000000000000..00c48d277732d --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/CheckNameAvailabilitys.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.CheckNameAvailabilitysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing CheckNameAvailabilitys. + */ +public interface CheckNameAvailabilitys extends HasInner { + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable executeAsync(NameAvailabilityRequest nameAvailabilityRequest); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Configuration.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Configuration.java new file mode 100644 index 0000000000000..a0e2946a6704d --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Configuration.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.ConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; + +/** + * Type representing Configuration. + */ +public interface Configuration extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the allowedValues value. + */ + String allowedValues(); + + /** + * @return the dataType value. + */ + String dataType(); + + /** + * @return the defaultValue value. + */ + String defaultValue(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the source value. + */ + String source(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the value value. + */ + String value(); + + /** + * The entirety of the Configuration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithCreate { + } + + /** + * Grouping of Configuration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Configuration definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the configuration definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithCreate withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the configuration definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + */ + WithCreate withSource(String source); + } + + /** + * The stage of the configuration definition allowing to specify Value. + */ + interface WithValue { + /** + * Specifies value. + */ + WithCreate withValue(String value); + } + + /** + * 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.WithSource, DefinitionStages.WithValue { + } + } + /** + * The template for a Configuration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithSource, UpdateStages.WithValue { + } + + /** + * Grouping of Configuration update stages. + */ + interface UpdateStages { + /** + * The stage of the configuration update allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + */ + Update withSource(String source); + } + + /** + * The stage of the configuration update allowing to specify Value. + */ + interface WithValue { + /** + * Specifies value. + */ + Update withValue(String value); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Configurations.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Configurations.java new file mode 100644 index 0000000000000..391bad5bdf83d --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Configurations.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.ConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Configurations. + */ +public interface Configurations extends SupportsCreating, HasInner { + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String configurationName); + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Database.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Database.java new file mode 100644 index 0000000000000..f4e05c05ddded --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Database.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DatabaseInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; + +/** + * Type representing Database. + */ +public interface Database extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the charset value. + */ + String charset(); + + /** + * @return the collation value. + */ + String collation(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Database definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithCreate { + } + + /** + * Grouping of Database definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Database definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the database definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithCreate withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the database definition allowing to specify Charset. + */ + interface WithCharset { + /** + * Specifies charset. + */ + WithCreate withCharset(String charset); + } + + /** + * The stage of the database definition allowing to specify Collation. + */ + interface WithCollation { + /** + * Specifies collation. + */ + WithCreate withCollation(String collation); + } + + /** + * 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.WithCharset, DefinitionStages.WithCollation { + } + } + /** + * The template for a Database update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCharset, UpdateStages.WithCollation { + } + + /** + * Grouping of Database update stages. + */ + interface UpdateStages { + /** + * The stage of the database update allowing to specify Charset. + */ + interface WithCharset { + /** + * Specifies charset. + */ + Update withCharset(String charset); + } + + /** + * The stage of the database update allowing to specify Collation. + */ + interface WithCollation { + /** + * Specifies collation. + */ + Update withCollation(String collation); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Databases.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Databases.java new file mode 100644 index 0000000000000..b090ae9808742 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Databases.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DatabasesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Databases. + */ +public interface Databases extends SupportsCreating, HasInner { + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String databaseName); + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serverName, String databaseName); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/FirewallRule.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/FirewallRule.java new file mode 100644 index 0000000000000..e326d40c64f16 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/FirewallRule.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.FirewallRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; + +/** + * Type representing FirewallRule. + */ +public interface FirewallRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the endIpAddress value. + */ + String endIpAddress(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startIpAddress value. + */ + String startIpAddress(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the FirewallRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithEndIpAddress, DefinitionStages.WithStartIpAddress, DefinitionStages.WithCreate { + } + + /** + * Grouping of FirewallRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a FirewallRule definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the firewallrule definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithEndIpAddress withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the firewallrule definition allowing to specify EndIpAddress. + */ + interface WithEndIpAddress { + /** + * Specifies endIpAddress. + */ + WithStartIpAddress withEndIpAddress(String endIpAddress); + } + + /** + * The stage of the firewallrule definition allowing to specify StartIpAddress. + */ + interface WithStartIpAddress { + /** + * Specifies startIpAddress. + */ + WithCreate withStartIpAddress(String startIpAddress); + } + + /** + * 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 { + } + } + /** + * The template for a FirewallRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of FirewallRule update stages. + */ + interface UpdateStages { + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/FirewallRules.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/FirewallRules.java new file mode 100644 index 0000000000000..79e8097c66f97 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/FirewallRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.FirewallRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing FirewallRules. + */ +public interface FirewallRules extends SupportsCreating, HasInner { + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String firewallRuleName); + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serverName, String firewallRuleName); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/GeoRedundantBackup.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/GeoRedundantBackup.java new file mode 100644 index 0000000000000..955992b551937 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/GeoRedundantBackup.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for GeoRedundantBackup. + */ +public final class GeoRedundantBackup extends ExpandableStringEnum { + /** Static value Enabled for GeoRedundantBackup. */ + public static final GeoRedundantBackup ENABLED = fromString("Enabled"); + + /** Static value Disabled for GeoRedundantBackup. */ + public static final GeoRedundantBackup DISABLED = fromString("Disabled"); + + /** + * Creates or finds a GeoRedundantBackup from its string representation. + * @param name a name to look for + * @return the corresponding GeoRedundantBackup + */ + @JsonCreator + public static GeoRedundantBackup fromString(String name) { + return fromString(name, GeoRedundantBackup.class); + } + + /** + * @return known GeoRedundantBackup values + */ + public static Collection values() { + return values(GeoRedundantBackup.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LocationBasedPerformanceTiers.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LocationBasedPerformanceTiers.java new file mode 100644 index 0000000000000..d90065c172498 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LocationBasedPerformanceTiers.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.PerformanceTierProperties; + +/** + * Type representing LocationBasedPerformanceTiers. + */ +public interface LocationBasedPerformanceTiers { + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String locationName); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LogFile.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LogFile.java new file mode 100644 index 0000000000000..8a075c73d4d3d --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LogFile.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.LogFileInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; +import org.joda.time.DateTime; + +/** + * Type representing LogFile. + */ +public interface LogFile extends HasInner, HasManager { + /** + * @return the createdTime value. + */ + DateTime createdTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the logFileType value. + */ + String logFileType(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sizeInKB value. + */ + Long sizeInKB(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the url value. + */ + String url(); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LogFiles.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LogFiles.java new file mode 100644 index 0000000000000..1a8dd305db45c --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/LogFiles.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.LogFilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LogFiles. + */ +public interface LogFiles extends HasInner { + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/NameAvailability.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/NameAvailability.java new file mode 100644 index 0000000000000..7c46753c76544 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/NameAvailability.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.NameAvailabilityInner; + +/** + * Type representing NameAvailability. + */ +public interface NameAvailability extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/NameAvailabilityRequest.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/NameAvailabilityRequest.java new file mode 100644 index 0000000000000..b2f2fed1ac28b --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/NameAvailabilityRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Request from client to check resource name availability. + */ +public class NameAvailabilityRequest { + /** + * Resource name to verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type used for verification. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get resource name to verify. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name to verify. + * + * @param name the name value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type used for verification. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type used for verification. + * + * @param type the type value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationDisplay.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..847ff4016b583 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Operation resource provider name. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Localized friendly name for the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Operation description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get operation resource provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get localized friendly name for the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationListResult.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationListResult.java new file mode 100644 index 0000000000000..c13edb6a9bc48 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.OperationListResultInner; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationOrigin.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationOrigin.java new file mode 100644 index 0000000000000..ddef3ad59de6b --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/OperationOrigin.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationOrigin. + */ +public final class OperationOrigin extends ExpandableStringEnum { + /** Static value NotSpecified for OperationOrigin. */ + public static final OperationOrigin NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value user for OperationOrigin. */ + public static final OperationOrigin USER = fromString("user"); + + /** Static value system for OperationOrigin. */ + public static final OperationOrigin SYSTEM = fromString("system"); + + /** + * Creates or finds a OperationOrigin from its string representation. + * @param name a name to look for + * @return the corresponding OperationOrigin + */ + @JsonCreator + public static OperationOrigin fromString(String name) { + return fromString(name, OperationOrigin.class); + } + + /** + * @return known OperationOrigin values + */ + public static Collection values() { + return values(OperationOrigin.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Operations.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Operations.java new file mode 100644 index 0000000000000..6b4f973f26067 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/PerformanceTierProperties.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/PerformanceTierProperties.java new file mode 100644 index 0000000000000..319e472024b04 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/PerformanceTierProperties.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.PerformanceTierPropertiesInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; +import java.util.List; + +/** + * Type representing PerformanceTierProperties. + */ +public interface PerformanceTierProperties extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the serviceLevelObjectives value. + */ + List serviceLevelObjectives(); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/PerformanceTierServiceLevelObjectives.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/PerformanceTierServiceLevelObjectives.java new file mode 100644 index 0000000000000..6a1b5c0f85105 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/PerformanceTierServiceLevelObjectives.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service level objectives for performance tier. + */ +public class PerformanceTierServiceLevelObjectives { + /** + * ID for the service level objective. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Edition of the performance tier. + */ + @JsonProperty(value = "edition") + private String edition; + + /** + * vCore associated with the service level objective. + */ + @JsonProperty(value = "vCore") + private Integer vCore; + + /** + * Hardware generation associated with the service level objective. + */ + @JsonProperty(value = "hardwareGeneration") + private String hardwareGeneration; + + /** + * Maximum Backup retention in days for the performance tier edition. + */ + @JsonProperty(value = "maxBackupRetentionDays") + private Integer maxBackupRetentionDays; + + /** + * Minimum Backup retention in days for the performance tier edition. + */ + @JsonProperty(value = "minBackupRetentionDays") + private Integer minBackupRetentionDays; + + /** + * Max storage allowed for a server. + */ + @JsonProperty(value = "maxStorageMB") + private Integer maxStorageMB; + + /** + * Max storage allowed for a server. + */ + @JsonProperty(value = "minStorageMB") + private Integer minStorageMB; + + /** + * Get iD for the service level objective. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD for the service level objective. + * + * @param id the id value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withId(String id) { + this.id = id; + return this; + } + + /** + * Get edition of the performance tier. + * + * @return the edition value + */ + public String edition() { + return this.edition; + } + + /** + * Set edition of the performance tier. + * + * @param edition the edition value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withEdition(String edition) { + this.edition = edition; + return this; + } + + /** + * Get vCore associated with the service level objective. + * + * @return the vCore value + */ + public Integer vCore() { + return this.vCore; + } + + /** + * Set vCore associated with the service level objective. + * + * @param vCore the vCore value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withVCore(Integer vCore) { + this.vCore = vCore; + return this; + } + + /** + * Get hardware generation associated with the service level objective. + * + * @return the hardwareGeneration value + */ + public String hardwareGeneration() { + return this.hardwareGeneration; + } + + /** + * Set hardware generation associated with the service level objective. + * + * @param hardwareGeneration the hardwareGeneration value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withHardwareGeneration(String hardwareGeneration) { + this.hardwareGeneration = hardwareGeneration; + return this; + } + + /** + * Get maximum Backup retention in days for the performance tier edition. + * + * @return the maxBackupRetentionDays value + */ + public Integer maxBackupRetentionDays() { + return this.maxBackupRetentionDays; + } + + /** + * Set maximum Backup retention in days for the performance tier edition. + * + * @param maxBackupRetentionDays the maxBackupRetentionDays value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withMaxBackupRetentionDays(Integer maxBackupRetentionDays) { + this.maxBackupRetentionDays = maxBackupRetentionDays; + return this; + } + + /** + * Get minimum Backup retention in days for the performance tier edition. + * + * @return the minBackupRetentionDays value + */ + public Integer minBackupRetentionDays() { + return this.minBackupRetentionDays; + } + + /** + * Set minimum Backup retention in days for the performance tier edition. + * + * @param minBackupRetentionDays the minBackupRetentionDays value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withMinBackupRetentionDays(Integer minBackupRetentionDays) { + this.minBackupRetentionDays = minBackupRetentionDays; + return this; + } + + /** + * Get max storage allowed for a server. + * + * @return the maxStorageMB value + */ + public Integer maxStorageMB() { + return this.maxStorageMB; + } + + /** + * Set max storage allowed for a server. + * + * @param maxStorageMB the maxStorageMB value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withMaxStorageMB(Integer maxStorageMB) { + this.maxStorageMB = maxStorageMB; + return this; + } + + /** + * Get max storage allowed for a server. + * + * @return the minStorageMB value + */ + public Integer minStorageMB() { + return this.minStorageMB; + } + + /** + * Set max storage allowed for a server. + * + * @param minStorageMB the minStorageMB value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withMinStorageMB(Integer minStorageMB) { + this.minStorageMB = minStorageMB; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Server.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Server.java new file mode 100644 index 0000000000000..3eff153c66b2b --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Server.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.ServerInner; + +/** + * Type representing Server. + */ +public interface Server extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the administratorLogin value. + */ + String administratorLogin(); + + /** + * @return the earliestRestoreDate value. + */ + DateTime earliestRestoreDate(); + + /** + * @return the fullyQualifiedDomainName value. + */ + String fullyQualifiedDomainName(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the sslEnforcement value. + */ + SslEnforcementEnum sslEnforcement(); + + /** + * @return the storageProfile value. + */ + StorageProfile storageProfile(); + + /** + * @return the userVisibleState value. + */ + ServerState userVisibleState(); + + /** + * @return the version value. + */ + ServerVersion version(); + + /** + * The entirety of the Server definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of Server definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Server definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Server definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the server definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + WithCreate withProperties(ServerPropertiesForCreate properties); + } + + /** + * The stage of the server update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(Sku sku); + } + + /** + * 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, Resource.DefinitionWithTags, DefinitionStages.WithSku { + } + } + /** + * The template for a Server update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithSku, UpdateStages.WithSslEnforcement, UpdateStages.WithStorageProfile, UpdateStages.WithVersion { + } + + /** + * Grouping of Server update stages. + */ + interface UpdateStages { + /** + * The stage of the server {0} allowing to specify AdministratorLoginPassword. + */ + interface WithAdministratorLoginPassword { + /** + * Specifies administratorLoginPassword. + */ + Update withAdministratorLoginPassword(String administratorLoginPassword); + } + + /** + * The stage of the server {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(Sku sku); + } + + /** + * The stage of the server {0} allowing to specify SslEnforcement. + */ + interface WithSslEnforcement { + /** + * Specifies sslEnforcement. + */ + Update withSslEnforcement(SslEnforcementEnum sslEnforcement); + } + + /** + * The stage of the server {0} allowing to specify StorageProfile. + */ + interface WithStorageProfile { + /** + * Specifies storageProfile. + */ + Update withStorageProfile(StorageProfile storageProfile); + } + + /** + * The stage of the server {0} allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + */ + Update withVersion(ServerVersion version); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerForCreate.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerForCreate.java new file mode 100644 index 0000000000000..ae56c8be1c79d --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerForCreate.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a server to be created. + */ +public class ServerForCreate { + /** + * The SKU (pricing tier) of the server. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Properties of the server. + */ + @JsonProperty(value = "properties", required = true) + private ServerPropertiesForCreate properties; + + /** + * The location the resource resides in. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the SKU (pricing tier) of the server. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU (pricing tier) of the server. + * + * @param sku the sku value to set + * @return the ServerForCreate object itself. + */ + public ServerForCreate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get properties of the server. + * + * @return the properties value + */ + public ServerPropertiesForCreate properties() { + return this.properties; + } + + /** + * Set properties of the server. + * + * @param properties the properties value to set + * @return the ServerForCreate object itself. + */ + public ServerForCreate withProperties(ServerPropertiesForCreate properties) { + this.properties = properties; + return this; + } + + /** + * Get the location the resource resides in. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location the resource resides in. + * + * @param location the location value to set + * @return the ServerForCreate object itself. + */ + public ServerForCreate withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get application-specific metadata in the form of key-value pairs. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set application-specific metadata in the form of key-value pairs. + * + * @param tags the tags value to set + * @return the ServerForCreate object itself. + */ + public ServerForCreate withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForCreate.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForCreate.java new file mode 100644 index 0000000000000..a115798c0d70f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForCreate.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The properties used to create a new server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("ServerPropertiesForCreate") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Default", value = ServerPropertiesForDefaultCreate.class), + @JsonSubTypes.Type(name = "PointInTimeRestore", value = ServerPropertiesForRestore.class), + @JsonSubTypes.Type(name = "GeoRestore", value = ServerPropertiesForGeoRestore.class) +}) +public class ServerPropertiesForCreate { + /** + * Server version. Possible values include: '5.6', '5.7'. + */ + @JsonProperty(value = "version") + private ServerVersion version; + + /** + * Enable ssl enforcement or not when connect to server. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "sslEnforcement") + private SslEnforcementEnum sslEnforcement; + + /** + * Storage profile of a server. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /** + * Get server version. Possible values include: '5.6', '5.7'. + * + * @return the version value + */ + public ServerVersion version() { + return this.version; + } + + /** + * Set server version. Possible values include: '5.6', '5.7'. + * + * @param version the version value to set + * @return the ServerPropertiesForCreate object itself. + */ + public ServerPropertiesForCreate withVersion(ServerVersion version) { + this.version = version; + return this; + } + + /** + * Get enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @return the sslEnforcement value + */ + public SslEnforcementEnum sslEnforcement() { + return this.sslEnforcement; + } + + /** + * Set enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @param sslEnforcement the sslEnforcement value to set + * @return the ServerPropertiesForCreate object itself. + */ + public ServerPropertiesForCreate withSslEnforcement(SslEnforcementEnum sslEnforcement) { + this.sslEnforcement = sslEnforcement; + return this; + } + + /** + * Get storage profile of a server. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set storage profile of a server. + * + * @param storageProfile the storageProfile value to set + * @return the ServerPropertiesForCreate object itself. + */ + public ServerPropertiesForCreate withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForDefaultCreate.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForDefaultCreate.java new file mode 100644 index 0000000000000..5c756f1ea0dae --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForDefaultCreate.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties used to create a new server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("Default") +public class ServerPropertiesForDefaultCreate extends ServerPropertiesForCreate { + /** + * The administrator's login name of a server. Can only be specified when + * the server is being created (and is required for creation). + */ + @JsonProperty(value = "administratorLogin", required = true) + private String administratorLogin; + + /** + * The password of the administrator login. + */ + @JsonProperty(value = "administratorLoginPassword", required = true) + private String administratorLoginPassword; + + /** + * Get the administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + * + * @return the administratorLogin value + */ + public String administratorLogin() { + return this.administratorLogin; + } + + /** + * Set the administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + * + * @param administratorLogin the administratorLogin value to set + * @return the ServerPropertiesForDefaultCreate object itself. + */ + public ServerPropertiesForDefaultCreate withAdministratorLogin(String administratorLogin) { + this.administratorLogin = administratorLogin; + return this; + } + + /** + * Get the password of the administrator login. + * + * @return the administratorLoginPassword value + */ + public String administratorLoginPassword() { + return this.administratorLoginPassword; + } + + /** + * Set the password of the administrator login. + * + * @param administratorLoginPassword the administratorLoginPassword value to set + * @return the ServerPropertiesForDefaultCreate object itself. + */ + public ServerPropertiesForDefaultCreate withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForGeoRestore.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForGeoRestore.java new file mode 100644 index 0000000000000..cfef4f1a22a6f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForGeoRestore.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties used to create a new server by restoring to a different + * region from a geo replicated backup. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("GeoRestore") +public class ServerPropertiesForGeoRestore extends ServerPropertiesForCreate { + /** + * The source server id to restore from. + */ + @JsonProperty(value = "sourceServerId", required = true) + private String sourceServerId; + + /** + * Get the source server id to restore from. + * + * @return the sourceServerId value + */ + public String sourceServerId() { + return this.sourceServerId; + } + + /** + * Set the source server id to restore from. + * + * @param sourceServerId the sourceServerId value to set + * @return the ServerPropertiesForGeoRestore object itself. + */ + public ServerPropertiesForGeoRestore withSourceServerId(String sourceServerId) { + this.sourceServerId = sourceServerId; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForRestore.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForRestore.java new file mode 100644 index 0000000000000..14b4ef818b5d0 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerPropertiesForRestore.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties used to create a new server by restoring from a backup. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("PointInTimeRestore") +public class ServerPropertiesForRestore extends ServerPropertiesForCreate { + /** + * The source server id to restore from. + */ + @JsonProperty(value = "sourceServerId", required = true) + private String sourceServerId; + + /** + * Restore point creation time (ISO8601 format), specifying the time to + * restore from. + */ + @JsonProperty(value = "restorePointInTime", required = true) + private DateTime restorePointInTime; + + /** + * Get the source server id to restore from. + * + * @return the sourceServerId value + */ + public String sourceServerId() { + return this.sourceServerId; + } + + /** + * Set the source server id to restore from. + * + * @param sourceServerId the sourceServerId value to set + * @return the ServerPropertiesForRestore object itself. + */ + public ServerPropertiesForRestore withSourceServerId(String sourceServerId) { + this.sourceServerId = sourceServerId; + return this; + } + + /** + * Get restore point creation time (ISO8601 format), specifying the time to restore from. + * + * @return the restorePointInTime value + */ + public DateTime restorePointInTime() { + return this.restorePointInTime; + } + + /** + * Set restore point creation time (ISO8601 format), specifying the time to restore from. + * + * @param restorePointInTime the restorePointInTime value to set + * @return the ServerPropertiesForRestore object itself. + */ + public ServerPropertiesForRestore withRestorePointInTime(DateTime restorePointInTime) { + this.restorePointInTime = restorePointInTime; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicies.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicies.java new file mode 100644 index 0000000000000..b97cb34c46b7b --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicies.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.ServerSecurityAlertPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ServerSecurityAlertPolicies. + */ +public interface ServerSecurityAlertPolicies extends SupportsCreating, HasInner { + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicy.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicy.java new file mode 100644 index 0000000000000..04dcf72000f96 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicy.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.ServerSecurityAlertPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; +import java.util.List; + +/** + * Type representing ServerSecurityAlertPolicy. + */ +public interface ServerSecurityAlertPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the disabledAlerts value. + */ + List disabledAlerts(); + + /** + * @return the emailAccountAdmins value. + */ + Boolean emailAccountAdmins(); + + /** + * @return the emailAddresses value. + */ + List emailAddresses(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the retentionDays value. + */ + Integer retentionDays(); + + /** + * @return the state value. + */ + ServerSecurityAlertPolicyState state(); + + /** + * @return the storageAccountAccessKey value. + */ + String storageAccountAccessKey(); + + /** + * @return the storageEndpoint value. + */ + String storageEndpoint(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ServerSecurityAlertPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithState, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServerSecurityAlertPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServerSecurityAlertPolicy definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithState withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + */ + WithCreate withState(ServerSecurityAlertPolicyState state); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify DisabledAlerts. + */ + interface WithDisabledAlerts { + /** + * Specifies disabledAlerts. + */ + WithCreate withDisabledAlerts(List disabledAlerts); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify EmailAccountAdmins. + */ + interface WithEmailAccountAdmins { + /** + * Specifies emailAccountAdmins. + */ + WithCreate withEmailAccountAdmins(Boolean emailAccountAdmins); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify EmailAddresses. + */ + interface WithEmailAddresses { + /** + * Specifies emailAddresses. + */ + WithCreate withEmailAddresses(List emailAddresses); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify RetentionDays. + */ + interface WithRetentionDays { + /** + * Specifies retentionDays. + */ + WithCreate withRetentionDays(Integer retentionDays); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify StorageAccountAccessKey. + */ + interface WithStorageAccountAccessKey { + /** + * Specifies storageAccountAccessKey. + */ + WithCreate withStorageAccountAccessKey(String storageAccountAccessKey); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify StorageEndpoint. + */ + interface WithStorageEndpoint { + /** + * Specifies storageEndpoint. + */ + WithCreate withStorageEndpoint(String storageEndpoint); + } + + /** + * 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.WithDisabledAlerts, DefinitionStages.WithEmailAccountAdmins, DefinitionStages.WithEmailAddresses, DefinitionStages.WithRetentionDays, DefinitionStages.WithStorageAccountAccessKey, DefinitionStages.WithStorageEndpoint { + } + } + /** + * The template for a ServerSecurityAlertPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDisabledAlerts, UpdateStages.WithEmailAccountAdmins, UpdateStages.WithEmailAddresses, UpdateStages.WithRetentionDays, UpdateStages.WithStorageAccountAccessKey, UpdateStages.WithStorageEndpoint { + } + + /** + * Grouping of ServerSecurityAlertPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the serversecurityalertpolicy update allowing to specify DisabledAlerts. + */ + interface WithDisabledAlerts { + /** + * Specifies disabledAlerts. + */ + Update withDisabledAlerts(List disabledAlerts); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify EmailAccountAdmins. + */ + interface WithEmailAccountAdmins { + /** + * Specifies emailAccountAdmins. + */ + Update withEmailAccountAdmins(Boolean emailAccountAdmins); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify EmailAddresses. + */ + interface WithEmailAddresses { + /** + * Specifies emailAddresses. + */ + Update withEmailAddresses(List emailAddresses); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify RetentionDays. + */ + interface WithRetentionDays { + /** + * Specifies retentionDays. + */ + Update withRetentionDays(Integer retentionDays); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify StorageAccountAccessKey. + */ + interface WithStorageAccountAccessKey { + /** + * Specifies storageAccountAccessKey. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify StorageEndpoint. + */ + interface WithStorageEndpoint { + /** + * Specifies storageEndpoint. + */ + Update withStorageEndpoint(String storageEndpoint); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicyState.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicyState.java new file mode 100644 index 0000000000000..a1476f6976a0a --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerSecurityAlertPolicyState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ServerSecurityAlertPolicyState. + */ +public enum ServerSecurityAlertPolicyState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a ServerSecurityAlertPolicyState instance. */ + private String value; + + ServerSecurityAlertPolicyState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ServerSecurityAlertPolicyState instance. + * + * @param value the serialized value to parse. + * @return the parsed ServerSecurityAlertPolicyState object, or null if unable to parse. + */ + @JsonCreator + public static ServerSecurityAlertPolicyState fromString(String value) { + ServerSecurityAlertPolicyState[] items = ServerSecurityAlertPolicyState.values(); + for (ServerSecurityAlertPolicyState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerState.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerState.java new file mode 100644 index 0000000000000..593315f0fdc5d --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServerState. + */ +public final class ServerState extends ExpandableStringEnum { + /** Static value Ready for ServerState. */ + public static final ServerState READY = fromString("Ready"); + + /** Static value Dropping for ServerState. */ + public static final ServerState DROPPING = fromString("Dropping"); + + /** Static value Disabled for ServerState. */ + public static final ServerState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ServerState from its string representation. + * @param name a name to look for + * @return the corresponding ServerState + */ + @JsonCreator + public static ServerState fromString(String name) { + return fromString(name, ServerState.class); + } + + /** + * @return known ServerState values + */ + public static Collection values() { + return values(ServerState.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerUpdateParameters.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerUpdateParameters.java new file mode 100644 index 0000000000000..c300508c673c7 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerUpdateParameters.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters allowd to update for a server. + */ +@JsonFlatten +public class ServerUpdateParameters { + /** + * The SKU (pricing tier) of the server. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Storage profile of a server. + */ + @JsonProperty(value = "properties.storageProfile") + private StorageProfile storageProfile; + + /** + * The password of the administrator login. + */ + @JsonProperty(value = "properties.administratorLoginPassword") + private String administratorLoginPassword; + + /** + * The version of a server. Possible values include: '5.6', '5.7'. + */ + @JsonProperty(value = "properties.version") + private ServerVersion version; + + /** + * Enable ssl enforcement or not when connect to server. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.sslEnforcement") + private SslEnforcementEnum sslEnforcement; + + /** + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the SKU (pricing tier) of the server. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU (pricing tier) of the server. + * + * @param sku the sku value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get storage profile of a server. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set storage profile of a server. + * + * @param storageProfile the storageProfile value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the password of the administrator login. + * + * @return the administratorLoginPassword value + */ + public String administratorLoginPassword() { + return this.administratorLoginPassword; + } + + /** + * Set the password of the administrator login. + * + * @param administratorLoginPassword the administratorLoginPassword value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; + return this; + } + + /** + * Get the version of a server. Possible values include: '5.6', '5.7'. + * + * @return the version value + */ + public ServerVersion version() { + return this.version; + } + + /** + * Set the version of a server. Possible values include: '5.6', '5.7'. + * + * @param version the version value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withVersion(ServerVersion version) { + this.version = version; + return this; + } + + /** + * Get enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @return the sslEnforcement value + */ + public SslEnforcementEnum sslEnforcement() { + return this.sslEnforcement; + } + + /** + * Set enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @param sslEnforcement the sslEnforcement value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withSslEnforcement(SslEnforcementEnum sslEnforcement) { + this.sslEnforcement = sslEnforcement; + return this; + } + + /** + * Get application-specific metadata in the form of key-value pairs. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set application-specific metadata in the form of key-value pairs. + * + * @param tags the tags value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerVersion.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerVersion.java new file mode 100644 index 0000000000000..a511fef3cd8d0 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerVersion.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServerVersion. + */ +public final class ServerVersion extends ExpandableStringEnum { + /** Static value 5.6 for ServerVersion. */ + public static final ServerVersion FIVE_FULL_STOP_SIX = fromString("5.6"); + + /** Static value 5.7 for ServerVersion. */ + public static final ServerVersion FIVE_FULL_STOP_SEVEN = fromString("5.7"); + + /** + * Creates or finds a ServerVersion from its string representation. + * @param name a name to look for + * @return the corresponding ServerVersion + */ + @JsonCreator + public static ServerVersion fromString(String name) { + return fromString(name, ServerVersion.class); + } + + /** + * @return known ServerVersion values + */ + public static Collection values() { + return values(ServerVersion.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Servers.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Servers.java new file mode 100644 index 0000000000000..d57a8c43c305e --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Servers.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.ServersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Servers. + */ +public interface Servers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Sku.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Sku.java new file mode 100644 index 0000000000000..6d4c691a2d384 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/Sku.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Billing information related properties of a server. + */ +public class Sku { + /** + * The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, + * GP_Gen5_8. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The tier of the particular SKU, e.g. Basic. Possible values include: + * 'Basic', 'GeneralPurpose', 'MemoryOptimized'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * The scale up/out capacity, representing server's compute units. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * The size code, to be interpreted by resource as appropriate. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The family of hardware. + */ + @JsonProperty(value = "family") + private String family; + + /** + * Get the name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized'. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the scale up/out capacity, representing server's compute units. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the scale up/out capacity, representing server's compute units. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the size code, to be interpreted by resource as appropriate. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the size code, to be interpreted by resource as appropriate. + * + * @param size the size value to set + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family of hardware. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the family of hardware. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/SkuTier.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/SkuTier.java new file mode 100644 index 0000000000000..5f67847ecf13f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/SkuTier.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value GeneralPurpose for SkuTier. */ + public static final SkuTier GENERAL_PURPOSE = fromString("GeneralPurpose"); + + /** Static value MemoryOptimized for SkuTier. */ + public static final SkuTier MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/SslEnforcementEnum.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/SslEnforcementEnum.java new file mode 100644 index 0000000000000..8b14cd4b4360f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/SslEnforcementEnum.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SslEnforcementEnum. + */ +public enum SslEnforcementEnum { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a SslEnforcementEnum instance. */ + private String value; + + SslEnforcementEnum(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SslEnforcementEnum instance. + * + * @param value the serialized value to parse. + * @return the parsed SslEnforcementEnum object, or null if unable to parse. + */ + @JsonCreator + public static SslEnforcementEnum fromString(String value) { + SslEnforcementEnum[] items = SslEnforcementEnum.values(); + for (SslEnforcementEnum item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/StorageProfile.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/StorageProfile.java new file mode 100644 index 0000000000000..e43166a7a06ff --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/StorageProfile.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Storage Profile properties of a server. + */ +public class StorageProfile { + /** + * Backup retention days for the server. + */ + @JsonProperty(value = "backupRetentionDays") + private Integer backupRetentionDays; + + /** + * Enable Geo-redundant or not for server backup. Possible values include: + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "geoRedundantBackup") + private GeoRedundantBackup geoRedundantBackup; + + /** + * Max storage allowed for a server. + */ + @JsonProperty(value = "storageMB") + private Integer storageMB; + + /** + * Get backup retention days for the server. + * + * @return the backupRetentionDays value + */ + public Integer backupRetentionDays() { + return this.backupRetentionDays; + } + + /** + * Set backup retention days for the server. + * + * @param backupRetentionDays the backupRetentionDays value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withBackupRetentionDays(Integer backupRetentionDays) { + this.backupRetentionDays = backupRetentionDays; + return this; + } + + /** + * Get enable Geo-redundant or not for server backup. Possible values include: 'Enabled', 'Disabled'. + * + * @return the geoRedundantBackup value + */ + public GeoRedundantBackup geoRedundantBackup() { + return this.geoRedundantBackup; + } + + /** + * Set enable Geo-redundant or not for server backup. Possible values include: 'Enabled', 'Disabled'. + * + * @param geoRedundantBackup the geoRedundantBackup value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withGeoRedundantBackup(GeoRedundantBackup geoRedundantBackup) { + this.geoRedundantBackup = geoRedundantBackup; + return this; + } + + /** + * Get max storage allowed for a server. + * + * @return the storageMB value + */ + public Integer storageMB() { + return this.storageMB; + } + + /** + * Set max storage allowed for a server. + * + * @param storageMB the storageMB value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withStorageMB(Integer storageMB) { + this.storageMB = storageMB; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/CheckNameAvailabilitysImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/CheckNameAvailabilitysImpl.java new file mode 100644 index 0000000000000..fedee95ea996f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/CheckNameAvailabilitysImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.CheckNameAvailabilitys; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.NameAvailability; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.NameAvailabilityRequest; + +class CheckNameAvailabilitysImpl extends WrapperImpl implements CheckNameAvailabilitys { + private final DBforMariaDBManager manager; + + CheckNameAvailabilitysImpl(DBforMariaDBManager manager) { + super(manager.inner().checkNameAvailabilitys()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable executeAsync(NameAvailabilityRequest nameAvailabilityRequest) { + CheckNameAvailabilitysInner client = this.inner(); + return client.executeAsync(nameAvailabilityRequest) + .map(new Func1() { + @Override + public NameAvailability call(NameAvailabilityInner inner) { + return new NameAvailabilityImpl(inner, manager()); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/CheckNameAvailabilitysInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/CheckNameAvailabilitysInner.java new file mode 100644 index 0000000000000..dd5bce2ecd455 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/CheckNameAvailabilitysInner.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.NameAvailabilityRequest; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +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; + +/** + * An instance of this class provides access to all the operations defined + * in CheckNameAvailabilitys. + */ +public class CheckNameAvailabilitysInner { + /** The Retrofit service to perform REST calls. */ + private CheckNameAvailabilitysService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of CheckNameAvailabilitysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CheckNameAvailabilitysInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(CheckNameAvailabilitysService.class); + this.client = client; + } + + /** + * The interface defining all the services for CheckNameAvailabilitys to be + * used by Retrofit to perform actually REST calls. + */ + interface CheckNameAvailabilitysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.CheckNameAvailabilitys execute" }) + @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); + + } + + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @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 NameAvailabilityInner object if successful. + */ + public NameAvailabilityInner execute(NameAvailabilityRequest nameAvailabilityRequest) { + return executeWithServiceResponseAsync(nameAvailabilityRequest).toBlocking().single().body(); + } + + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @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 executeAsync(NameAvailabilityRequest nameAvailabilityRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeWithServiceResponseAsync(nameAvailabilityRequest), serviceCallback); + } + + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable executeAsync(NameAvailabilityRequest nameAvailabilityRequest) { + return executeWithServiceResponseAsync(nameAvailabilityRequest).map(new Func1, NameAvailabilityInner>() { + @Override + public NameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable> executeWithServiceResponseAsync(NameAvailabilityRequest nameAvailabilityRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (nameAvailabilityRequest == null) { + throw new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null."); + } + Validator.validate(nameAvailabilityRequest); + return service.execute(this.client.subscriptionId(), this.client.apiVersion(), nameAvailabilityRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = executeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse executeDelegate(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/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationImpl.java new file mode 100644 index 0000000000000..d3841d53b94c4 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationImpl.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Configuration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class ConfigurationImpl extends CreatableUpdatableImpl implements Configuration, Configuration.Definition, Configuration.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String configurationName; + + ConfigurationImpl(String name, DBforMariaDBManager manager) { + super(name, new ConfigurationInner()); + this.manager = manager; + // Set resource name + this.configurationName = name; + // + } + + ConfigurationImpl(ConfigurationInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.configurationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.configurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "configurations"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ConfigurationsInner client = this.manager().inner().configurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.configurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ConfigurationsInner client = this.manager().inner().configurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.configurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ConfigurationsInner client = this.manager().inner().configurations(); + return client.getAsync(this.resourceGroupName, this.serverName, this.configurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String allowedValues() { + return this.inner().allowedValues(); + } + + @Override + public String dataType() { + return this.inner().dataType(); + } + + @Override + public String defaultValue() { + return this.inner().defaultValue(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String source() { + return this.inner().source(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String value() { + return this.inner().value(); + } + + @Override + public ConfigurationImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public ConfigurationImpl withSource(String source) { + this.inner().withSource(source); + return this; + } + + @Override + public ConfigurationImpl withValue(String value) { + this.inner().withValue(value); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationInner.java new file mode 100644 index 0000000000000..0d76950e6cf57 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationInner.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a Configuration. + */ +@JsonFlatten +public class ConfigurationInner extends ProxyResource { + /** + * Value of the configuration. + */ + @JsonProperty(value = "properties.value") + private String value; + + /** + * Description of the configuration. + */ + @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Default value of the configuration. + */ + @JsonProperty(value = "properties.defaultValue", access = JsonProperty.Access.WRITE_ONLY) + private String defaultValue; + + /** + * Data type of the configuration. + */ + @JsonProperty(value = "properties.dataType", access = JsonProperty.Access.WRITE_ONLY) + private String dataType; + + /** + * Allowed values of the configuration. + */ + @JsonProperty(value = "properties.allowedValues", access = JsonProperty.Access.WRITE_ONLY) + private String allowedValues; + + /** + * Source of the configuration. + */ + @JsonProperty(value = "properties.source") + private String source; + + /** + * Get value of the configuration. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set value of the configuration. + * + * @param value the value value to set + * @return the ConfigurationInner object itself. + */ + public ConfigurationInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Get description of the configuration. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get default value of the configuration. + * + * @return the defaultValue value + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Get data type of the configuration. + * + * @return the dataType value + */ + public String dataType() { + return this.dataType; + } + + /** + * Get allowed values of the configuration. + * + * @return the allowedValues value + */ + public String allowedValues() { + return this.allowedValues; + } + + /** + * Get source of the configuration. + * + * @return the source value + */ + public String source() { + return this.source; + } + + /** + * Set source of the configuration. + * + * @param source the source value to set + * @return the ConfigurationInner object itself. + */ + public ConfigurationInner withSource(String source) { + this.source = source; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationsImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationsImpl.java new file mode 100644 index 0000000000000..4eb6e92d9af92 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationsImpl.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Configurations; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Configuration; + +class ConfigurationsImpl extends WrapperImpl implements Configurations { + private final DBforMariaDBManager manager; + + ConfigurationsImpl(DBforMariaDBManager manager) { + super(manager.inner().configurations()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public ConfigurationImpl define(String name) { + return wrapModel(name); + } + + private ConfigurationImpl wrapModel(ConfigurationInner inner) { + return new ConfigurationImpl(inner, manager()); + } + + private ConfigurationImpl wrapModel(String name) { + return new ConfigurationImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + ConfigurationsInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Configuration call(ConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String configurationName) { + ConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, configurationName) + .map(new Func1() { + @Override + public Configuration call(ConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationsInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationsInner.java new file mode 100644 index 0000000000000..4dbd5e8828cc0 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ConfigurationsInner.java @@ -0,0 +1,446 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.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 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.PUT; +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 Configurations. + */ +public class ConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private ConfigurationsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConfigurationsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(ConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Configurations to be + * used by Retrofit to perform actually REST calls. + */ + interface ConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.Configurations createOrUpdate" }) + @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.v2018_06_01_preview.Configurations beginCreateOrUpdate" }) + @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.v2018_06_01_preview.Configurations get" }) + @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.v2018_06_01_preview.Configurations listByServer" }) + @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); + + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @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 ConfigurationInner object if successful. + */ + public ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters).toBlocking().last().body(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @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 configurationName, ConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters), serviceCallback); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters).map(new Func1, ConfigurationInner>() { + @Override + public ConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String configurationName, ConfigurationInner 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 (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @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 ConfigurationInner object if successful. + */ + public ConfigurationInner beginCreateOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters).toBlocking().single().body(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @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 configurationName, ConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters), serviceCallback); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters).map(new Func1, ConfigurationInner>() { + @Override + public ConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String configurationName, ConfigurationInner 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 (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, configurationName, this.client.apiVersion(), parameters, 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); + } + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @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 ConfigurationInner object if successful. + */ + public ConfigurationInner get(String resourceGroupName, String serverName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, configurationName).toBlocking().single().body(); + } + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String configurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, configurationName), serviceCallback); + } + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, configurationName).map(new Func1, ConfigurationInner>() { + @Override + public ConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String configurationName) { + 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 (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 List<ConfigurationInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConfigurationInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConfigurationInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DBforMariaDBManager.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DBforMariaDBManager.java new file mode 100644 index 0000000000000..eff7fa9475f7f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DBforMariaDBManager.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Servers; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.FirewallRules; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Databases; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Configurations; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.LogFiles; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.LocationBasedPerformanceTiers; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.CheckNameAvailabilitys; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerSecurityAlertPolicies; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DBforMariaDB resource management. + */ +public final class DBforMariaDBManager extends ManagerCore { + private Servers servers; + private FirewallRules firewallRules; + private Databases databases; + private Configurations configurations; + private LogFiles logFiles; + private LocationBasedPerformanceTiers locationBasedPerformanceTiers; + private CheckNameAvailabilitys checkNameAvailabilitys; + private ServerSecurityAlertPolicies serverSecurityAlertPolicies; + private Operations operations; + /** + * Get a Configurable instance that can be used to create DBforMariaDBManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DBforMariaDBManager.ConfigurableImpl(); + } + /** + * Creates an instance of DBforMariaDBManager that exposes DBforMariaDB resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DBforMariaDBManager + */ + public static DBforMariaDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DBforMariaDBManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DBforMariaDBManager that exposes DBforMariaDB resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DBforMariaDBManager + */ + public static DBforMariaDBManager authenticate(RestClient restClient, String subscriptionId) { + return new DBforMariaDBManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DBforMariaDBManager that exposes DBforMariaDB management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DBforMariaDB management API entry points that work across subscriptions + */ + DBforMariaDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Servers. + */ + public Servers servers() { + if (this.servers == null) { + this.servers = new ServersImpl(this); + } + return this.servers; + } + + /** + * @return Entry point to manage FirewallRules. + */ + public FirewallRules firewallRules() { + if (this.firewallRules == null) { + this.firewallRules = new FirewallRulesImpl(this); + } + return this.firewallRules; + } + + /** + * @return Entry point to manage Databases. + */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(this); + } + return this.databases; + } + + /** + * @return Entry point to manage Configurations. + */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(this); + } + return this.configurations; + } + + /** + * @return Entry point to manage LogFiles. + */ + public LogFiles logFiles() { + if (this.logFiles == null) { + this.logFiles = new LogFilesImpl(this); + } + return this.logFiles; + } + + /** + * @return Entry point to manage LocationBasedPerformanceTiers. + */ + public LocationBasedPerformanceTiers locationBasedPerformanceTiers() { + if (this.locationBasedPerformanceTiers == null) { + this.locationBasedPerformanceTiers = new LocationBasedPerformanceTiersImpl(this); + } + return this.locationBasedPerformanceTiers; + } + + /** + * @return Entry point to manage CheckNameAvailabilitys. + */ + public CheckNameAvailabilitys checkNameAvailabilitys() { + if (this.checkNameAvailabilitys == null) { + this.checkNameAvailabilitys = new CheckNameAvailabilitysImpl(this); + } + return this.checkNameAvailabilitys; + } + + /** + * @return Entry point to manage ServerSecurityAlertPolicies. + */ + public ServerSecurityAlertPolicies serverSecurityAlertPolicies() { + if (this.serverSecurityAlertPolicies == null) { + this.serverSecurityAlertPolicies = new ServerSecurityAlertPoliciesImpl(this); + } + return this.serverSecurityAlertPolicies; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DBforMariaDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DBforMariaDBManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DBforMariaDBManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new MariaDBManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabaseImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabaseImpl.java new file mode 100644 index 0000000000000..491fcb2056ae0 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabaseImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Database; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class DatabaseImpl extends CreatableUpdatableImpl implements Database, Database.Definition, Database.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String databaseName; + + DatabaseImpl(String name, DBforMariaDBManager manager) { + super(name, new DatabaseInner()); + this.manager = manager; + // Set resource name + this.databaseName = name; + // + } + + DatabaseImpl(DatabaseInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.databaseName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.databaseName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.databaseName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.getAsync(this.resourceGroupName, this.serverName, this.databaseName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String charset() { + return this.inner().charset(); + } + + @Override + public String collation() { + return this.inner().collation(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DatabaseImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public DatabaseImpl withCharset(String charset) { + this.inner().withCharset(charset); + return this; + } + + @Override + public DatabaseImpl withCollation(String collation) { + this.inner().withCollation(collation); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabaseInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabaseInner.java new file mode 100644 index 0000000000000..949b9bcdfb793 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabaseInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a Database. + */ +@JsonFlatten +public class DatabaseInner extends ProxyResource { + /** + * The charset of the database. + */ + @JsonProperty(value = "properties.charset") + private String charset; + + /** + * The collation of the database. + */ + @JsonProperty(value = "properties.collation") + private String collation; + + /** + * Get the charset of the database. + * + * @return the charset value + */ + public String charset() { + return this.charset; + } + + /** + * Set the charset of the database. + * + * @param charset the charset value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withCharset(String charset) { + this.charset = charset; + return this; + } + + /** + * Get the collation of the database. + * + * @return the collation value + */ + public String collation() { + return this.collation; + } + + /** + * Set the collation of the database. + * + * @param collation the collation value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withCollation(String collation) { + this.collation = collation; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabasesImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabasesImpl.java new file mode 100644 index 0000000000000..b3c49cdf09684 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabasesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Databases; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Database; + +class DatabasesImpl extends WrapperImpl implements Databases { + private final DBforMariaDBManager manager; + + DatabasesImpl(DBforMariaDBManager manager) { + super(manager.inner().databases()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public DatabaseImpl define(String name) { + return wrapModel(name); + } + + private DatabaseImpl wrapModel(DatabaseInner inner) { + return new DatabaseImpl(inner, manager()); + } + + private DatabaseImpl wrapModel(String name) { + return new DatabaseImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + DatabasesInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Database call(DatabaseInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String databaseName) { + DatabasesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, databaseName) + .map(new Func1() { + @Override + public Database call(DatabaseInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serverName, String databaseName) { + DatabasesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serverName, databaseName).toCompletable(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabasesInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabasesInner.java new file mode 100644 index 0000000000000..c86c98df193d9 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DatabasesInner.java @@ -0,0 +1,625 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.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 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.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +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 Databases. + */ +public class DatabasesInner { + /** The Retrofit service to perform REST calls. */ + private DatabasesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of DatabasesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatabasesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(DatabasesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Databases to be + * used by Retrofit to perform actually REST calls. + */ + interface DatabasesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.Databases createOrUpdate" }) + @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.v2018_06_01_preview.Databases beginCreateOrUpdate" }) + @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.v2018_06_01_preview.Databases delete" }) + @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.v2018_06_01_preview.Databases beginDelete" }) + @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.v2018_06_01_preview.Databases get" }) + @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.v2018_06_01_preview.Databases listByServer" }) + @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); + + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a 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 + * @return the DatabaseInner object if successful. + */ + public DatabaseInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a 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 createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a 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 + * @return the DatabaseInner object if successful. + */ + public DatabaseInner beginCreateOrUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a 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 beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), parameters, 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(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 delete(String resourceGroupName, String serverName, String databaseName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body(); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 deleteAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName, String databaseName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 beginDelete(String resourceGroupName, String serverName, String databaseName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 beginDeleteAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String databaseName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 + * @return the DatabaseInner object if successful. + */ + public DatabaseInner get(String resourceGroupName, String serverName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + } + + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 getAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + } + + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 List<DatabaseInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabaseInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabaseInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRuleImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRuleImpl.java new file mode 100644 index 0000000000000..00d87c6f9a039 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRuleImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.FirewallRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class FirewallRuleImpl extends CreatableUpdatableImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String firewallRuleName; + + FirewallRuleImpl(String name, DBforMariaDBManager manager) { + super(name, new FirewallRuleInner()); + this.manager = manager; + // Set resource name + this.firewallRuleName = name; + // + } + + FirewallRuleImpl(FirewallRuleInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.firewallRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.firewallRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "firewallRules"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.firewallRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.firewallRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.getAsync(this.resourceGroupName, this.serverName, this.firewallRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String endIpAddress() { + return this.inner().endIpAddress(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String startIpAddress() { + return this.inner().startIpAddress(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public FirewallRuleImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public FirewallRuleImpl withEndIpAddress(String endIpAddress) { + this.inner().withEndIpAddress(endIpAddress); + return this; + } + + @Override + public FirewallRuleImpl withStartIpAddress(String startIpAddress) { + this.inner().withStartIpAddress(startIpAddress); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRuleInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRuleInner.java new file mode 100644 index 0000000000000..8bd2b3c9a22b2 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRuleInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a server firewall rule. + */ +@JsonFlatten +public class FirewallRuleInner extends ProxyResource { + /** + * The start IP address of the server firewall rule. Must be IPv4 format. + */ + @JsonProperty(value = "properties.startIpAddress", required = true) + private String startIpAddress; + + /** + * The end IP address of the server firewall rule. Must be IPv4 format. + */ + @JsonProperty(value = "properties.endIpAddress", required = true) + private String endIpAddress; + + /** + * Get the start IP address of the server firewall rule. Must be IPv4 format. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address of the server firewall rule. Must be IPv4 format. + * + * @param startIpAddress the startIpAddress value to set + * @return the FirewallRuleInner object itself. + */ + public FirewallRuleInner withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address of the server firewall rule. Must be IPv4 format. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address of the server firewall rule. Must be IPv4 format. + * + * @param endIpAddress the endIpAddress value to set + * @return the FirewallRuleInner object itself. + */ + public FirewallRuleInner withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRulesImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRulesImpl.java new file mode 100644 index 0000000000000..3a408112acbd8 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.FirewallRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.FirewallRule; + +class FirewallRulesImpl extends WrapperImpl implements FirewallRules { + private final DBforMariaDBManager manager; + + FirewallRulesImpl(DBforMariaDBManager manager) { + super(manager.inner().firewallRules()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public FirewallRuleImpl define(String name) { + return wrapModel(name); + } + + private FirewallRuleImpl wrapModel(FirewallRuleInner inner) { + return new FirewallRuleImpl(inner, manager()); + } + + private FirewallRuleImpl wrapModel(String name) { + return new FirewallRuleImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + FirewallRulesInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String firewallRuleName) { + FirewallRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, firewallRuleName) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serverName, String firewallRuleName) { + FirewallRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serverName, firewallRuleName).toCompletable(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRulesInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRulesInner.java new file mode 100644 index 0000000000000..2827599348522 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/FirewallRulesInner.java @@ -0,0 +1,625 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.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 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.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +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 FirewallRules. + */ +public class FirewallRulesInner { + /** The Retrofit service to perform REST calls. */ + private FirewallRulesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of FirewallRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FirewallRulesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(FirewallRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for FirewallRules to be + * used by Retrofit to perform actually REST calls. + */ + interface FirewallRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.FirewallRules createOrUpdate" }) + @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.v2018_06_01_preview.FirewallRules beginCreateOrUpdate" }) + @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.v2018_06_01_preview.FirewallRules delete" }) + @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.v2018_06_01_preview.FirewallRules beginDelete" }) + @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.v2018_06_01_preview.FirewallRules get" }) + @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.v2018_06_01_preview.FirewallRules listByServer" }) + @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); + + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @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 FirewallRuleInner object if successful. + */ + public FirewallRuleInner createOrUpdate(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @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 firewallRuleName, FirewallRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters), serviceCallback); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @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 FirewallRuleInner object if successful. + */ + public FirewallRuleInner beginCreateOrUpdate(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @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 firewallRuleName, FirewallRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters), serviceCallback); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), parameters, 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(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @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 firewallRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).toBlocking().last().body(); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serverName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName), serviceCallback); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName, String firewallRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName) { + 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @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 firewallRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serverName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName), serviceCallback); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String firewallRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName) { + 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @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 FirewallRuleInner object if successful. + */ + public FirewallRuleInner get(String resourceGroupName, String serverName, String firewallRuleName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName), serviceCallback); + } + + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String firewallRuleName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName) { + 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 List<FirewallRuleInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FirewallRuleInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FirewallRuleInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/IdParsingUtils.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..427abacc8e4c9 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LocationBasedPerformanceTiersImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LocationBasedPerformanceTiersImpl.java new file mode 100644 index 0000000000000..8c79445abc0f5 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LocationBasedPerformanceTiersImpl.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. + * abc + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.LocationBasedPerformanceTiers; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.PerformanceTierProperties; + +class LocationBasedPerformanceTiersImpl extends WrapperImpl implements LocationBasedPerformanceTiers { + private final DBforMariaDBManager manager; + + LocationBasedPerformanceTiersImpl(DBforMariaDBManager manager) { + super(manager.inner().locationBasedPerformanceTiers()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + private PerformanceTierPropertiesImpl wrapPerformanceTierPropertiesModel(PerformanceTierPropertiesInner inner) { + return new PerformanceTierPropertiesImpl(inner, manager()); + } + + @Override + public Observable listAsync(String locationName) { + LocationBasedPerformanceTiersInner client = this.inner(); + return client.listAsync(locationName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PerformanceTierProperties call(PerformanceTierPropertiesInner inner) { + return wrapPerformanceTierPropertiesModel(inner); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LocationBasedPerformanceTiersInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LocationBasedPerformanceTiersInner.java new file mode 100644 index 0000000000000..9a26d47f4bfb7 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LocationBasedPerformanceTiersInner.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LocationBasedPerformanceTiers. + */ +public class LocationBasedPerformanceTiersInner { + /** The Retrofit service to perform REST calls. */ + private LocationBasedPerformanceTiersService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of LocationBasedPerformanceTiersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationBasedPerformanceTiersInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(LocationBasedPerformanceTiersService.class); + this.client = client; + } + + /** + * The interface defining all the services for LocationBasedPerformanceTiers to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationBasedPerformanceTiersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.LocationBasedPerformanceTiers list" }) + @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); + + } + + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @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 List<PerformanceTierPropertiesInner> object if successful. + */ + public List list(String locationName) { + return listWithServiceResponseAsync(locationName).toBlocking().single().body(); + } + + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @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(String locationName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(locationName), serviceCallback); + } + + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PerformanceTierPropertiesInner> object + */ + public Observable> listAsync(String locationName) { + return listWithServiceResponseAsync(locationName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PerformanceTierPropertiesInner> object + */ + public Observable>> listWithServiceResponseAsync(String locationName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), locationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFileImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFileImpl.java new file mode 100644 index 0000000000000..8a5c1f9fae3c4 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFileImpl.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.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.LogFile; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class LogFileImpl extends WrapperImpl implements LogFile { + private final DBforMariaDBManager manager; + + LogFileImpl(LogFileInner inner, DBforMariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + + + @Override + public DateTime createdTime() { + return this.inner().createdTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String logFileType() { + return this.inner().logFileType(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long sizeInKB() { + return this.inner().sizeInKB(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String url() { + return this.inner().url(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFileInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFileInner.java new file mode 100644 index 0000000000000..c463bae75428a --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFileInner.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.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 log file. + */ +@JsonFlatten +public class LogFileInner extends ProxyResource { + /** + * Size of the log file. + */ + @JsonProperty(value = "properties.sizeInKB") + private Long sizeInKB; + + /** + * Creation timestamp of the log file. + */ + @JsonProperty(value = "properties.createdTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdTime; + + /** + * Last modified timestamp of the log file. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Type of the log file. + */ + @JsonProperty(value = "properties.type") + private String logFileType; + + /** + * The url to download the log file from. + */ + @JsonProperty(value = "properties.url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /** + * Get size of the log file. + * + * @return the sizeInKB value + */ + public Long sizeInKB() { + return this.sizeInKB; + } + + /** + * Set size of the log file. + * + * @param sizeInKB the sizeInKB value to set + * @return the LogFileInner object itself. + */ + public LogFileInner withSizeInKB(Long sizeInKB) { + this.sizeInKB = sizeInKB; + return this; + } + + /** + * Get creation timestamp of the log file. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Get last modified timestamp of the log file. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get type of the log file. + * + * @return the logFileType value + */ + public String logFileType() { + return this.logFileType; + } + + /** + * Set type of the log file. + * + * @param logFileType the logFileType value to set + * @return the LogFileInner object itself. + */ + public LogFileInner withLogFileType(String logFileType) { + this.logFileType = logFileType; + return this; + } + + /** + * Get the url to download the log file from. + * + * @return the url value + */ + public String url() { + return this.url; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFilesImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFilesImpl.java new file mode 100644 index 0000000000000..0d6b31c23947a --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFilesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.LogFiles; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.LogFile; + +class LogFilesImpl extends WrapperImpl implements LogFiles { + private final DBforMariaDBManager manager; + + LogFilesImpl(DBforMariaDBManager manager) { + super(manager.inner().logFiles()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + private LogFileImpl wrapModel(LogFileInner inner) { + return new LogFileImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + LogFilesInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public LogFile call(LogFileInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFilesInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFilesInner.java new file mode 100644 index 0000000000000..96b9f62dee173 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/LogFilesInner.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LogFiles. + */ +public class LogFilesInner { + /** The Retrofit service to perform REST calls. */ + private LogFilesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of LogFilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LogFilesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(LogFilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LogFiles to be + * used by Retrofit to perform actually REST calls. + */ + interface LogFilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.LogFiles listByServer" }) + @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); + + } + + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 List<LogFileInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LogFileInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LogFileInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/MariaDBManagementClientImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/MariaDBManagementClientImpl.java new file mode 100644 index 0000000000000..f799b5ea5fc99 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/MariaDBManagementClientImpl.java @@ -0,0 +1,308 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the MariaDBManagementClientImpl class. + */ +public class MariaDBManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription ID that identifies an Azure subscription. */ + private String subscriptionId; + + /** + * Gets The subscription ID that identifies an Azure subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription ID that identifies an Azure subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MariaDBManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version to use for the request. */ + private String apiVersion; + + /** + * Gets The API version to use for the request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public MariaDBManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public MariaDBManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public MariaDBManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ServersInner object to access its operations. + */ + private ServersInner servers; + + /** + * Gets the ServersInner object to access its operations. + * @return the ServersInner object. + */ + public ServersInner servers() { + return this.servers; + } + + /** + * The FirewallRulesInner object to access its operations. + */ + private FirewallRulesInner firewallRules; + + /** + * Gets the FirewallRulesInner object to access its operations. + * @return the FirewallRulesInner object. + */ + public FirewallRulesInner firewallRules() { + return this.firewallRules; + } + + /** + * The DatabasesInner object to access its operations. + */ + private DatabasesInner databases; + + /** + * Gets the DatabasesInner object to access its operations. + * @return the DatabasesInner object. + */ + public DatabasesInner databases() { + return this.databases; + } + + /** + * The ConfigurationsInner object to access its operations. + */ + private ConfigurationsInner configurations; + + /** + * Gets the ConfigurationsInner object to access its operations. + * @return the ConfigurationsInner object. + */ + public ConfigurationsInner configurations() { + return this.configurations; + } + + /** + * The LogFilesInner object to access its operations. + */ + private LogFilesInner logFiles; + + /** + * Gets the LogFilesInner object to access its operations. + * @return the LogFilesInner object. + */ + public LogFilesInner logFiles() { + return this.logFiles; + } + + /** + * The LocationBasedPerformanceTiersInner object to access its operations. + */ + private LocationBasedPerformanceTiersInner locationBasedPerformanceTiers; + + /** + * Gets the LocationBasedPerformanceTiersInner object to access its operations. + * @return the LocationBasedPerformanceTiersInner object. + */ + public LocationBasedPerformanceTiersInner locationBasedPerformanceTiers() { + return this.locationBasedPerformanceTiers; + } + + /** + * The CheckNameAvailabilitysInner object to access its operations. + */ + private CheckNameAvailabilitysInner checkNameAvailabilitys; + + /** + * Gets the CheckNameAvailabilitysInner object to access its operations. + * @return the CheckNameAvailabilitysInner object. + */ + public CheckNameAvailabilitysInner checkNameAvailabilitys() { + return this.checkNameAvailabilitys; + } + + /** + * The ServerSecurityAlertPoliciesInner object to access its operations. + */ + private ServerSecurityAlertPoliciesInner serverSecurityAlertPolicies; + + /** + * Gets the ServerSecurityAlertPoliciesInner object to access its operations. + * @return the ServerSecurityAlertPoliciesInner object. + */ + public ServerSecurityAlertPoliciesInner serverSecurityAlertPolicies() { + return this.serverSecurityAlertPolicies; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of MariaDBManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public MariaDBManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of MariaDBManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MariaDBManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MariaDBManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public MariaDBManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-06-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.servers = new ServersInner(restClient().retrofit(), this); + this.firewallRules = new FirewallRulesInner(restClient().retrofit(), this); + this.databases = new DatabasesInner(restClient().retrofit(), this); + this.configurations = new ConfigurationsInner(restClient().retrofit(), this); + this.logFiles = new LogFilesInner(restClient().retrofit(), this); + this.locationBasedPerformanceTiers = new LocationBasedPerformanceTiersInner(restClient().retrofit(), this); + this.checkNameAvailabilitys = new CheckNameAvailabilitysInner(restClient().retrofit(), this); + this.serverSecurityAlertPolicies = new ServerSecurityAlertPoliciesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "MariaDBManagementClient", "2018-06-01-preview"); + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/NameAvailabilityImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/NameAvailabilityImpl.java new file mode 100644 index 0000000000000..d9a49221ed821 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/NameAvailabilityImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.NameAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class NameAvailabilityImpl extends WrapperImpl implements NameAvailability { + private final DBforMariaDBManager manager; + NameAvailabilityImpl(NameAvailabilityInner inner, DBforMariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/NameAvailabilityInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/NameAvailabilityInner.java new file mode 100644 index 0000000000000..3e7d6f9ea8352 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/NameAvailabilityInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a resource name availability. + */ +public class NameAvailabilityInner { + /** + * Error Message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Indicates whether the resource name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * Reason for name being unavailable. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get error Message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error Message. + * + * @param message the message value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get indicates whether the resource name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set indicates whether the resource name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get reason for name being unavailable. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set reason for name being unavailable. + * + * @param reason the reason value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..644f8511eed50 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationInner.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.OperationDisplay; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.OperationOrigin; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API operation definition. + */ +public class OperationInner { + /** + * The name of the operation being performed on this particular object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The localized display information for this particular operation or + * action. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: + * 'NotSpecified', 'user', 'system'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private OperationOrigin origin; + + /** + * Additional descriptions for the operation. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private Map properties; + + /** + * Get the name of the operation being performed on this particular object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the localized display information for this particular operation or action. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the intended executor of the operation. Possible values include: 'NotSpecified', 'user', 'system'. + * + * @return the origin value + */ + public OperationOrigin origin() { + return this.origin; + } + + /** + * Get additional descriptions for the operation. + * + * @return the properties value + */ + public Map properties() { + return this.properties; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationListResultImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..9f3f3871754f5 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final DBforMariaDBManager manager; + OperationListResultImpl(OperationListResultInner inner, DBforMariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationListResultInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..365ca3fdd9309 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationListResultInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of resource provider operations. + */ +public class OperationListResultInner { + /** + * The list of resource provider operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of resource provider operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of resource provider operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationsImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..4976ec1a0c7a9 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DBforMariaDBManager manager; + + OperationsImpl(DBforMariaDBManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationsInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..72d89847e2644 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.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.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.Operations list" }) + @GET("providers/Microsoft.DBforMariaDB/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available REST API operations. + * + * @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 OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available REST API operations. + * + * @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 ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(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/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PageImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..6023c4d9ad942 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PerformanceTierPropertiesImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PerformanceTierPropertiesImpl.java new file mode 100644 index 0000000000000..a2f489d35e927 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PerformanceTierPropertiesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.PerformanceTierProperties; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.PerformanceTierServiceLevelObjectives; + +class PerformanceTierPropertiesImpl extends WrapperImpl implements PerformanceTierProperties { + private final DBforMariaDBManager manager; + + PerformanceTierPropertiesImpl(PerformanceTierPropertiesInner inner, DBforMariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List serviceLevelObjectives() { + return this.inner().serviceLevelObjectives(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PerformanceTierPropertiesInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PerformanceTierPropertiesInner.java new file mode 100644 index 0000000000000..fe3dd9f190d3c --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PerformanceTierPropertiesInner.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.v2018_06_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.PerformanceTierServiceLevelObjectives; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Performance tier properties. + */ +public class PerformanceTierPropertiesInner { + /** + * ID of the performance tier. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Service level objectives associated with the performance tier. + */ + @JsonProperty(value = "serviceLevelObjectives") + private List serviceLevelObjectives; + + /** + * Get iD of the performance tier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the performance tier. + * + * @param id the id value to set + * @return the PerformanceTierPropertiesInner object itself. + */ + public PerformanceTierPropertiesInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get service level objectives associated with the performance tier. + * + * @return the serviceLevelObjectives value + */ + public List serviceLevelObjectives() { + return this.serviceLevelObjectives; + } + + /** + * Set service level objectives associated with the performance tier. + * + * @param serviceLevelObjectives the serviceLevelObjectives value to set + * @return the PerformanceTierPropertiesInner object itself. + */ + public PerformanceTierPropertiesInner withServiceLevelObjectives(List serviceLevelObjectives) { + this.serviceLevelObjectives = serviceLevelObjectives; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerImpl.java new file mode 100644 index 0000000000000..130f1ecfe33b4 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerImpl.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Server; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerUpdateParameters; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerForCreate; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Sku; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.SslEnforcementEnum; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.StorageProfile; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerState; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerVersion; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerPropertiesForCreate; +import rx.functions.Func1; + +class ServerImpl extends GroupableResourceCoreImpl implements Server, Server.Definition, Server.Update { + private ServerForCreate createParameter; + private ServerUpdateParameters updateParameter; + ServerImpl(String name, ServerInner inner, DBforMariaDBManager manager) { + super(name, inner, manager); + this.createParameter = new ServerForCreate(); + this.updateParameter = new ServerUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + ServersInner client = this.manager().inner().servers(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public ServerInner call(ServerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServersInner client = this.manager().inner().servers(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ServerInner call(ServerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServersInner client = this.manager().inner().servers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new ServerForCreate(); + this.updateParameter = new ServerUpdateParameters(); + } + + @Override + public String administratorLogin() { + return this.inner().administratorLogin(); + } + + @Override + public DateTime earliestRestoreDate() { + return this.inner().earliestRestoreDate(); + } + + @Override + public String fullyQualifiedDomainName() { + return this.inner().fullyQualifiedDomainName(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public SslEnforcementEnum sslEnforcement() { + return this.inner().sslEnforcement(); + } + + @Override + public StorageProfile storageProfile() { + return this.inner().storageProfile(); + } + + @Override + public ServerState userVisibleState() { + return this.inner().userVisibleState(); + } + + @Override + public ServerVersion version() { + return this.inner().version(); + } + + @Override + public ServerImpl withProperties(ServerPropertiesForCreate properties) { + this.createParameter.withProperties(properties); + return this; + } + + @Override + public ServerImpl withAdministratorLoginPassword(String administratorLoginPassword) { + this.updateParameter.withAdministratorLoginPassword(administratorLoginPassword); + return this; + } + + @Override + public ServerImpl withSslEnforcement(SslEnforcementEnum sslEnforcement) { + this.updateParameter.withSslEnforcement(sslEnforcement); + return this; + } + + @Override + public ServerImpl withStorageProfile(StorageProfile storageProfile) { + this.updateParameter.withStorageProfile(storageProfile); + return this; + } + + @Override + public ServerImpl withVersion(ServerVersion version) { + this.updateParameter.withVersion(version); + return this; + } + + @Override + public ServerImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerInner.java new file mode 100644 index 0000000000000..2f5d13d39576c --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerInner.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Sku; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerVersion; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.SslEnforcementEnum; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.StorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Represents a server. + */ +@JsonFlatten +public class ServerInner extends Resource { + /** + * The SKU (pricing tier) of the server. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The administrator's login name of a server. Can only be specified when + * the server is being created (and is required for creation). + */ + @JsonProperty(value = "properties.administratorLogin") + private String administratorLogin; + + /** + * Server version. Possible values include: '5.6', '5.7'. + */ + @JsonProperty(value = "properties.version") + private ServerVersion version; + + /** + * Enable ssl enforcement or not when connect to server. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.sslEnforcement") + private SslEnforcementEnum sslEnforcement; + + /** + * A state of a server that is visible to user. Possible values include: + * 'Ready', 'Dropping', 'Disabled'. + */ + @JsonProperty(value = "properties.userVisibleState") + private ServerState userVisibleState; + + /** + * The fully qualified domain name of a server. + */ + @JsonProperty(value = "properties.fullyQualifiedDomainName") + private String fullyQualifiedDomainName; + + /** + * Earliest restore point creation time (ISO8601 format). + */ + @JsonProperty(value = "properties.earliestRestoreDate") + private DateTime earliestRestoreDate; + + /** + * Storage profile of a server. + */ + @JsonProperty(value = "properties.storageProfile") + private StorageProfile storageProfile; + + /** + * Get the SKU (pricing tier) of the server. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU (pricing tier) of the server. + * + * @param sku the sku value to set + * @return the ServerInner object itself. + */ + public ServerInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + * + * @return the administratorLogin value + */ + public String administratorLogin() { + return this.administratorLogin; + } + + /** + * Set the administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + * + * @param administratorLogin the administratorLogin value to set + * @return the ServerInner object itself. + */ + public ServerInner withAdministratorLogin(String administratorLogin) { + this.administratorLogin = administratorLogin; + return this; + } + + /** + * Get server version. Possible values include: '5.6', '5.7'. + * + * @return the version value + */ + public ServerVersion version() { + return this.version; + } + + /** + * Set server version. Possible values include: '5.6', '5.7'. + * + * @param version the version value to set + * @return the ServerInner object itself. + */ + public ServerInner withVersion(ServerVersion version) { + this.version = version; + return this; + } + + /** + * Get enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @return the sslEnforcement value + */ + public SslEnforcementEnum sslEnforcement() { + return this.sslEnforcement; + } + + /** + * Set enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @param sslEnforcement the sslEnforcement value to set + * @return the ServerInner object itself. + */ + public ServerInner withSslEnforcement(SslEnforcementEnum sslEnforcement) { + this.sslEnforcement = sslEnforcement; + return this; + } + + /** + * Get a state of a server that is visible to user. Possible values include: 'Ready', 'Dropping', 'Disabled'. + * + * @return the userVisibleState value + */ + public ServerState userVisibleState() { + return this.userVisibleState; + } + + /** + * Set a state of a server that is visible to user. Possible values include: 'Ready', 'Dropping', 'Disabled'. + * + * @param userVisibleState the userVisibleState value to set + * @return the ServerInner object itself. + */ + public ServerInner withUserVisibleState(ServerState userVisibleState) { + this.userVisibleState = userVisibleState; + return this; + } + + /** + * Get the fully qualified domain name of a server. + * + * @return the fullyQualifiedDomainName value + */ + public String fullyQualifiedDomainName() { + return this.fullyQualifiedDomainName; + } + + /** + * Set the fully qualified domain name of a server. + * + * @param fullyQualifiedDomainName the fullyQualifiedDomainName value to set + * @return the ServerInner object itself. + */ + public ServerInner withFullyQualifiedDomainName(String fullyQualifiedDomainName) { + this.fullyQualifiedDomainName = fullyQualifiedDomainName; + return this; + } + + /** + * Get earliest restore point creation time (ISO8601 format). + * + * @return the earliestRestoreDate value + */ + public DateTime earliestRestoreDate() { + return this.earliestRestoreDate; + } + + /** + * Set earliest restore point creation time (ISO8601 format). + * + * @param earliestRestoreDate the earliestRestoreDate value to set + * @return the ServerInner object itself. + */ + public ServerInner withEarliestRestoreDate(DateTime earliestRestoreDate) { + this.earliestRestoreDate = earliestRestoreDate; + return this; + } + + /** + * Get storage profile of a server. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set storage profile of a server. + * + * @param storageProfile the storageProfile value to set + * @return the ServerInner object itself. + */ + public ServerInner withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPoliciesImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPoliciesImpl.java new file mode 100644 index 0000000000000..cc9f64cf17401 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPoliciesImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerSecurityAlertPolicies; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerSecurityAlertPolicy; + +class ServerSecurityAlertPoliciesImpl extends WrapperImpl implements ServerSecurityAlertPolicies { + private final DBforMariaDBManager manager; + + ServerSecurityAlertPoliciesImpl(DBforMariaDBManager manager) { + super(manager.inner().serverSecurityAlertPolicies()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public ServerSecurityAlertPolicyImpl define(String name) { + return wrapModel(name); + } + + private ServerSecurityAlertPolicyImpl wrapModel(ServerSecurityAlertPolicyInner inner) { + return new ServerSecurityAlertPolicyImpl(inner, manager()); + } + + private ServerSecurityAlertPolicyImpl wrapModel(String name) { + return new ServerSecurityAlertPolicyImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName) { + ServerSecurityAlertPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName) + .map(new Func1() { + @Override + public ServerSecurityAlertPolicy call(ServerSecurityAlertPolicyInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPoliciesInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPoliciesInner.java new file mode 100644 index 0000000000000..7457ed9ae97f7 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPoliciesInner.java @@ -0,0 +1,332 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.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 com.microsoft.rest.Validator; +import java.io.IOException; +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.PUT; +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 ServerSecurityAlertPolicies. + */ +public class ServerSecurityAlertPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private ServerSecurityAlertPoliciesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of ServerSecurityAlertPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServerSecurityAlertPoliciesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(ServerSecurityAlertPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServerSecurityAlertPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ServerSecurityAlertPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerSecurityAlertPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("securityAlertPolicyName") String securityAlertPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerSecurityAlertPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("securityAlertPolicyName") String securityAlertPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServerSecurityAlertPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerSecurityAlertPolicies beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("securityAlertPolicyName") String securityAlertPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServerSecurityAlertPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 ServerSecurityAlertPolicyInner object if successful. + */ + public ServerSecurityAlertPolicyInner get(String resourceGroupName, String serverName) { + return getWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 getAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerSecurityAlertPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String serverName) { + return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, ServerSecurityAlertPolicyInner>() { + @Override + public ServerSecurityAlertPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerSecurityAlertPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String securityAlertPolicyName = "Default"; + return service.get(resourceGroupName, serverName, securityAlertPolicyName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @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 ServerSecurityAlertPolicyInner object if successful. + */ + public ServerSecurityAlertPolicyInner createOrUpdate(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @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, ServerSecurityAlertPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerSecurityAlertPolicyInner>() { + @Override + public ServerSecurityAlertPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String securityAlertPolicyName = "Default"; + Observable> observable = service.createOrUpdate(resourceGroupName, serverName, securityAlertPolicyName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @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 ServerSecurityAlertPolicyInner object if successful. + */ + public ServerSecurityAlertPolicyInner beginCreateOrUpdate(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @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, ServerSecurityAlertPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerSecurityAlertPolicyInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerSecurityAlertPolicyInner>() { + @Override + public ServerSecurityAlertPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerSecurityAlertPolicyInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String securityAlertPolicyName = "Default"; + return service.beginCreateOrUpdate(resourceGroupName, serverName, securityAlertPolicyName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPolicyImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPolicyImpl.java new file mode 100644 index 0000000000000..89fd5c29bd3cd --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPolicyImpl.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerSecurityAlertPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerSecurityAlertPolicyState; +import java.util.List; + +class ServerSecurityAlertPolicyImpl extends CreatableUpdatableImpl implements ServerSecurityAlertPolicy, ServerSecurityAlertPolicy.Definition, ServerSecurityAlertPolicy.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + + ServerSecurityAlertPolicyImpl(String name, DBforMariaDBManager manager) { + super(name, new ServerSecurityAlertPolicyInner()); + this.manager = manager; + // Set resource name + this.serverName = name; + // + } + + ServerSecurityAlertPolicyImpl(ServerSecurityAlertPolicyInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.serverName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ServerSecurityAlertPoliciesInner client = this.manager().inner().serverSecurityAlertPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServerSecurityAlertPoliciesInner client = this.manager().inner().serverSecurityAlertPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServerSecurityAlertPoliciesInner client = this.manager().inner().serverSecurityAlertPolicies(); + return client.getAsync(this.resourceGroupName, this.serverName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List disabledAlerts() { + return this.inner().disabledAlerts(); + } + + @Override + public Boolean emailAccountAdmins() { + return this.inner().emailAccountAdmins(); + } + + @Override + public List emailAddresses() { + return this.inner().emailAddresses(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer retentionDays() { + return this.inner().retentionDays(); + } + + @Override + public ServerSecurityAlertPolicyState state() { + return this.inner().state(); + } + + @Override + public String storageAccountAccessKey() { + return this.inner().storageAccountAccessKey(); + } + + @Override + public String storageEndpoint() { + return this.inner().storageEndpoint(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ServerSecurityAlertPolicyImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withState(ServerSecurityAlertPolicyState state) { + this.inner().withState(state); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withDisabledAlerts(List disabledAlerts) { + this.inner().withDisabledAlerts(disabledAlerts); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withEmailAccountAdmins(Boolean emailAccountAdmins) { + this.inner().withEmailAccountAdmins(emailAccountAdmins); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withEmailAddresses(List emailAddresses) { + this.inner().withEmailAddresses(emailAddresses); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withRetentionDays(Integer retentionDays) { + this.inner().withRetentionDays(retentionDays); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.inner().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withStorageEndpoint(String storageEndpoint) { + this.inner().withStorageEndpoint(storageEndpoint); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPolicyInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPolicyInner.java new file mode 100644 index 0000000000000..2dc5fcc2d231d --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServerSecurityAlertPolicyInner.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerSecurityAlertPolicyState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A server security alert policy. + */ +@JsonFlatten +public class ServerSecurityAlertPolicyInner extends ProxyResource { + /** + * Specifies the state of the policy, whether it is enabled or disabled. + * Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.state", required = true) + private ServerSecurityAlertPolicyState state; + + /** + * Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly. + */ + @JsonProperty(value = "properties.disabledAlerts") + private List disabledAlerts; + + /** + * Specifies an array of e-mail addresses to which the alert is sent. + */ + @JsonProperty(value = "properties.emailAddresses") + private List emailAddresses; + + /** + * Specifies that the alert is sent to the account administrators. + */ + @JsonProperty(value = "properties.emailAccountAdmins") + private Boolean emailAccountAdmins; + + /** + * Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold + * all Threat Detection audit logs. + */ + @JsonProperty(value = "properties.storageEndpoint") + private String storageEndpoint; + + /** + * Specifies the identifier key of the Threat Detection audit storage + * account. + */ + @JsonProperty(value = "properties.storageAccountAccessKey") + private String storageAccountAccessKey; + + /** + * Specifies the number of days to keep in the Threat Detection audit logs. + */ + @JsonProperty(value = "properties.retentionDays") + private Integer retentionDays; + + /** + * Get specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the state value + */ + public ServerSecurityAlertPolicyState state() { + return this.state; + } + + /** + * Set specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param state the state value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withState(ServerSecurityAlertPolicyState state) { + this.state = state; + return this; + } + + /** + * Get specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly. + * + * @return the disabledAlerts value + */ + public List disabledAlerts() { + return this.disabledAlerts; + } + + /** + * Set specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly. + * + * @param disabledAlerts the disabledAlerts value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withDisabledAlerts(List disabledAlerts) { + this.disabledAlerts = disabledAlerts; + return this; + } + + /** + * Get specifies an array of e-mail addresses to which the alert is sent. + * + * @return the emailAddresses value + */ + public List emailAddresses() { + return this.emailAddresses; + } + + /** + * Set specifies an array of e-mail addresses to which the alert is sent. + * + * @param emailAddresses the emailAddresses value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withEmailAddresses(List emailAddresses) { + this.emailAddresses = emailAddresses; + return this; + } + + /** + * Get specifies that the alert is sent to the account administrators. + * + * @return the emailAccountAdmins value + */ + public Boolean emailAccountAdmins() { + return this.emailAccountAdmins; + } + + /** + * Set specifies that the alert is sent to the account administrators. + * + * @param emailAccountAdmins the emailAccountAdmins value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withEmailAccountAdmins(Boolean emailAccountAdmins) { + this.emailAccountAdmins = emailAccountAdmins; + return this; + } + + /** + * Get specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @return the storageEndpoint value + */ + public String storageEndpoint() { + return this.storageEndpoint; + } + + /** + * Set specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @param storageEndpoint the storageEndpoint value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withStorageEndpoint(String storageEndpoint) { + this.storageEndpoint = storageEndpoint; + return this; + } + + /** + * Get specifies the identifier key of the Threat Detection audit storage account. + * + * @return the storageAccountAccessKey value + */ + public String storageAccountAccessKey() { + return this.storageAccountAccessKey; + } + + /** + * Set specifies the identifier key of the Threat Detection audit storage account. + * + * @param storageAccountAccessKey the storageAccountAccessKey value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get specifies the number of days to keep in the Threat Detection audit logs. + * + * @return the retentionDays value + */ + public Integer retentionDays() { + return this.retentionDays; + } + + /** + * Set specifies the number of days to keep in the Threat Detection audit logs. + * + * @param retentionDays the retentionDays value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServersImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServersImpl.java new file mode 100644 index 0000000000000..2707ddce5f444 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServersImpl.java @@ -0,0 +1,138 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Servers; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Server; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ServersImpl extends GroupableResourcesCoreImpl implements Servers { + protected ServersImpl(DBforMariaDBManager manager) { + super(manager.inner().servers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Server call(ServerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServersInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Server call(ServerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ServerImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ServerImpl wrapModel(ServerInner inner) { + return new ServerImpl(inner.name(), inner, manager()); + } + + @Override + protected ServerImpl wrapModel(String name) { + return new ServerImpl(name, new ServerInner(), this.manager()); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServersInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServersInner.java new file mode 100644 index 0000000000000..475a730e351fb --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/ServersInner.java @@ -0,0 +1,860 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerForCreate; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.ServerUpdateParameters; +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.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +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 Servers. + */ +public class ServersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServersService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of ServersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServersInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(ServersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Servers to be + * used by Retrofit to perform actually REST calls. + */ + interface ServersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.Servers create" }) + @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.v2018_06_01_preview.Servers beginCreate" }) + @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.v2018_06_01_preview.Servers update" }) + @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.v2018_06_01_preview.Servers beginUpdate" }) + @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.v2018_06_01_preview.Servers delete" }) + @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.v2018_06_01_preview.Servers beginDelete" }) + @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.v2018_06_01_preview.Servers getByResourceGroup" }) + @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.v2018_06_01_preview.Servers listByResourceGroup" }) + @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.v2018_06_01_preview.Servers list" }) + @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); + + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 ServerInner object if successful. + */ + public ServerInner create(String resourceGroupName, String serverName, ServerForCreate parameters) { + return createWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String serverName, ServerForCreate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String serverName, ServerForCreate parameters) { + return createWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String serverName, ServerForCreate parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 ServerInner object if successful. + */ + public ServerInner beginCreate(String resourceGroupName, String serverName, ServerForCreate parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String serverName, ServerForCreate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String serverName, ServerForCreate parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerForCreate parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a 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 ServerInner object if successful. + */ + public ServerInner update(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().last().body(); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a 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 ServerInner object if successful. + */ + public ServerInner beginUpdate(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body(); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(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 server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 + */ + public void delete(String resourceGroupName, String serverName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().last().body(); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 deleteAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 + */ + public void beginDelete(String resourceGroupName, String serverName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 beginDeleteAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse 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); + } + + /** + * Gets information about a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 ServerInner object if successful. + */ + public ServerInner getByResourceGroup(String resourceGroupName, String serverName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * Gets information about a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 getByResourceGroupAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Gets information about a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String serverName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(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 all the servers in a given resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * List all the servers in a given resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * List all the servers in a given resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @return the observable to the List<ServerInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List all the servers in a given resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @return the observable to the List<ServerInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(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 all the servers in a given subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * List all the servers in a given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List all the servers in a given subscription. + * + * @return the observable to the List<ServerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List all the servers in a given subscription. + * + * @return the observable to the List<ServerInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/package-info.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..20d42a39c29bb --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the implementation classes for MariaDBManagementClient. + * MariaDB Client. + */ +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/package-info.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/package-info.java new file mode 100644 index 0000000000000..60414162c94d8 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the classes for MariaDBManagementClient. + * MariaDB Client. + */ +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; From f4d306f61ff4edafade1436c6e0cdbe189e6581e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 26 Oct 2018 10:17:21 -0700 Subject: [PATCH 2/4] Generated from a22fb0a860ea419d71515faad8a2802617881561 (#2535) Add Vnet resource for Microsoft.DBforMariaDB --- .../VirtualNetworkRule.java | 130 +++ .../VirtualNetworkRuleState.java | 50 ++ .../VirtualNetworkRules.java | 53 ++ .../implementation/DBforMariaDBManager.java | 12 + .../MariaDBManagementClientImpl.java | 14 + .../implementation/PageImpl1.java | 75 ++ .../VirtualNetworkRuleImpl.java | 122 +++ .../VirtualNetworkRuleInner.java | 90 ++ .../VirtualNetworkRulesImpl.java | 81 ++ .../VirtualNetworkRulesInner.java | 777 ++++++++++++++++++ 10 files changed, 1404 insertions(+) create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRule.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRuleState.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRules.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PageImpl1.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRuleImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRuleInner.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRulesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRulesInner.java diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRule.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRule.java new file mode 100644 index 0000000000000..9601e76b43399 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRule.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.VirtualNetworkRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.DBforMariaDBManager; + +/** + * Type representing VirtualNetworkRule. + */ +public interface VirtualNetworkRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the ignoreMissingVnetServiceEndpoint value. + */ + Boolean ignoreMissingVnetServiceEndpoint(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the state value. + */ + VirtualNetworkRuleState state(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualNetworkSubnetId value. + */ + String virtualNetworkSubnetId(); + + /** + * The entirety of the VirtualNetworkRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithVirtualNetworkSubnetId, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkRule definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the virtualnetworkrule definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithVirtualNetworkSubnetId withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the virtualnetworkrule definition allowing to specify VirtualNetworkSubnetId. + */ + interface WithVirtualNetworkSubnetId { + /** + * Specifies virtualNetworkSubnetId. + */ + WithCreate withVirtualNetworkSubnetId(String virtualNetworkSubnetId); + } + + /** + * The stage of the virtualnetworkrule definition allowing to specify IgnoreMissingVnetServiceEndpoint. + */ + interface WithIgnoreMissingVnetServiceEndpoint { + /** + * Specifies ignoreMissingVnetServiceEndpoint. + */ + WithCreate withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint); + } + + /** + * 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.WithIgnoreMissingVnetServiceEndpoint { + } + } + /** + * The template for a VirtualNetworkRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIgnoreMissingVnetServiceEndpoint { + } + + /** + * Grouping of VirtualNetworkRule update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkrule update allowing to specify IgnoreMissingVnetServiceEndpoint. + */ + interface WithIgnoreMissingVnetServiceEndpoint { + /** + * Specifies ignoreMissingVnetServiceEndpoint. + */ + Update withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRuleState.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRuleState.java new file mode 100644 index 0000000000000..603559a9dabe6 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRuleState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkRuleState. + */ +public final class VirtualNetworkRuleState extends ExpandableStringEnum { + /** Static value Initializing for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState INITIALIZING = fromString("Initializing"); + + /** Static value InProgress for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState IN_PROGRESS = fromString("InProgress"); + + /** Static value Ready for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState READY = fromString("Ready"); + + /** Static value Deleting for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState DELETING = fromString("Deleting"); + + /** Static value Unknown for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a VirtualNetworkRuleState from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkRuleState + */ + @JsonCreator + public static VirtualNetworkRuleState fromString(String name) { + return fromString(name, VirtualNetworkRuleState.class); + } + + /** + * @return known VirtualNetworkRuleState values + */ + public static Collection values() { + return values(VirtualNetworkRuleState.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRules.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRules.java new file mode 100644 index 0000000000000..262e011f90793 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/VirtualNetworkRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation.VirtualNetworkRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkRules. + */ +public interface VirtualNetworkRules extends SupportsCreating, HasInner { + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName); + + /** + * Gets a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName); + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DBforMariaDBManager.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DBforMariaDBManager.java index eff7fa9475f7f..27705bf332cbf 100644 --- a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DBforMariaDBManager.java +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/DBforMariaDBManager.java @@ -18,6 +18,7 @@ import com.microsoft.rest.RestClient; import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Servers; import com.microsoft.azure.management.mariadb.v2018_06_01_preview.FirewallRules; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.VirtualNetworkRules; import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Databases; import com.microsoft.azure.management.mariadb.v2018_06_01_preview.Configurations; import com.microsoft.azure.management.mariadb.v2018_06_01_preview.LogFiles; @@ -34,6 +35,7 @@ public final class DBforMariaDBManager extends ManagerCore { private Servers servers; private FirewallRules firewallRules; + private VirtualNetworkRules virtualNetworkRules; private Databases databases; private Configurations configurations; private LogFiles logFiles; @@ -108,6 +110,16 @@ public FirewallRules firewallRules() { return this.firewallRules; } + /** + * @return Entry point to manage VirtualNetworkRules. + */ + public VirtualNetworkRules virtualNetworkRules() { + if (this.virtualNetworkRules == null) { + this.virtualNetworkRules = new VirtualNetworkRulesImpl(this); + } + return this.virtualNetworkRules; + } + /** * @return Entry point to manage Databases. */ diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/MariaDBManagementClientImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/MariaDBManagementClientImpl.java index f799b5ea5fc99..6aeae65f54557 100644 --- a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/MariaDBManagementClientImpl.java +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/MariaDBManagementClientImpl.java @@ -158,6 +158,19 @@ public FirewallRulesInner firewallRules() { return this.firewallRules; } + /** + * The VirtualNetworkRulesInner object to access its operations. + */ + private VirtualNetworkRulesInner virtualNetworkRules; + + /** + * Gets the VirtualNetworkRulesInner object to access its operations. + * @return the VirtualNetworkRulesInner object. + */ + public VirtualNetworkRulesInner virtualNetworkRules() { + return this.virtualNetworkRules; + } + /** * The DatabasesInner object to access its operations. */ @@ -286,6 +299,7 @@ protected void initialize() { this.generateClientRequestId = true; this.servers = new ServersInner(restClient().retrofit(), this); this.firewallRules = new FirewallRulesInner(restClient().retrofit(), this); + this.virtualNetworkRules = new VirtualNetworkRulesInner(restClient().retrofit(), this); this.databases = new DatabasesInner(restClient().retrofit(), this); this.configurations = new ConfigurationsInner(restClient().retrofit(), this); this.logFiles = new LogFilesInner(restClient().retrofit(), this); diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PageImpl1.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PageImpl1.java new file mode 100644 index 0000000000000..9da59217f9236 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRuleImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRuleImpl.java new file mode 100644 index 0000000000000..6782eaca867d0 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRuleImpl.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.VirtualNetworkRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.VirtualNetworkRuleState; + +class VirtualNetworkRuleImpl extends CreatableUpdatableImpl implements VirtualNetworkRule, VirtualNetworkRule.Definition, VirtualNetworkRule.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String virtualNetworkRuleName; + + VirtualNetworkRuleImpl(String name, DBforMariaDBManager manager) { + super(name, new VirtualNetworkRuleInner()); + this.manager = manager; + // Set resource name + this.virtualNetworkRuleName = name; + // + } + + VirtualNetworkRuleImpl(VirtualNetworkRuleInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.virtualNetworkRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.virtualNetworkRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworkRules"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkRulesInner client = this.manager().inner().virtualNetworkRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.virtualNetworkRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkRulesInner client = this.manager().inner().virtualNetworkRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.virtualNetworkRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkRulesInner client = this.manager().inner().virtualNetworkRules(); + return client.getAsync(this.resourceGroupName, this.serverName, this.virtualNetworkRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean ignoreMissingVnetServiceEndpoint() { + return this.inner().ignoreMissingVnetServiceEndpoint(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public VirtualNetworkRuleState state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String virtualNetworkSubnetId() { + return this.inner().virtualNetworkSubnetId(); + } + + @Override + public VirtualNetworkRuleImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public VirtualNetworkRuleImpl withVirtualNetworkSubnetId(String virtualNetworkSubnetId) { + this.inner().withVirtualNetworkSubnetId(virtualNetworkSubnetId); + return this; + } + + @Override + public VirtualNetworkRuleImpl withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { + this.inner().withIgnoreMissingVnetServiceEndpoint(ignoreMissingVnetServiceEndpoint); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRuleInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRuleInner.java new file mode 100644 index 0000000000000..2229662c5b793 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRuleInner.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.VirtualNetworkRuleState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A virtual network rule. + */ +@JsonFlatten +public class VirtualNetworkRuleInner extends ProxyResource { + /** + * The ARM resource id of the virtual network subnet. + */ + @JsonProperty(value = "properties.virtualNetworkSubnetId", required = true) + private String virtualNetworkSubnetId; + + /** + * Create firewall rule before the virtual network has vnet service + * endpoint enabled. + */ + @JsonProperty(value = "properties.ignoreMissingVnetServiceEndpoint") + private Boolean ignoreMissingVnetServiceEndpoint; + + /** + * Virtual Network Rule State. Possible values include: 'Initializing', + * 'InProgress', 'Ready', 'Deleting', 'Unknown'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkRuleState state; + + /** + * Get the ARM resource id of the virtual network subnet. + * + * @return the virtualNetworkSubnetId value + */ + public String virtualNetworkSubnetId() { + return this.virtualNetworkSubnetId; + } + + /** + * Set the ARM resource id of the virtual network subnet. + * + * @param virtualNetworkSubnetId the virtualNetworkSubnetId value to set + * @return the VirtualNetworkRuleInner object itself. + */ + public VirtualNetworkRuleInner withVirtualNetworkSubnetId(String virtualNetworkSubnetId) { + this.virtualNetworkSubnetId = virtualNetworkSubnetId; + return this; + } + + /** + * Get create firewall rule before the virtual network has vnet service endpoint enabled. + * + * @return the ignoreMissingVnetServiceEndpoint value + */ + public Boolean ignoreMissingVnetServiceEndpoint() { + return this.ignoreMissingVnetServiceEndpoint; + } + + /** + * Set create firewall rule before the virtual network has vnet service endpoint enabled. + * + * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set + * @return the VirtualNetworkRuleInner object itself. + */ + public VirtualNetworkRuleInner withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { + this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; + return this; + } + + /** + * Get virtual Network Rule State. Possible values include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown'. + * + * @return the state value + */ + public VirtualNetworkRuleState state() { + return this.state; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRulesImpl.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRulesImpl.java new file mode 100644 index 0000000000000..c52eb62eae6b3 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.VirtualNetworkRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01_preview.VirtualNetworkRule; + +class VirtualNetworkRulesImpl extends WrapperImpl implements VirtualNetworkRules { + private final DBforMariaDBManager manager; + + VirtualNetworkRulesImpl(DBforMariaDBManager manager) { + super(manager.inner().virtualNetworkRules()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public VirtualNetworkRuleImpl define(String name) { + return wrapModel(name); + } + + private VirtualNetworkRuleImpl wrapModel(VirtualNetworkRuleInner inner) { + return new VirtualNetworkRuleImpl(inner, manager()); + } + + private VirtualNetworkRuleImpl wrapModel(String name) { + return new VirtualNetworkRuleImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName) { + VirtualNetworkRulesInner 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 VirtualNetworkRule call(VirtualNetworkRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + VirtualNetworkRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, virtualNetworkRuleName) + .map(new Func1() { + @Override + public VirtualNetworkRule call(VirtualNetworkRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + VirtualNetworkRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serverName, virtualNetworkRuleName).toCompletable(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRulesInner.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRulesInner.java new file mode 100644 index 0000000000000..1f08d985ae252 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/implementation/VirtualNetworkRulesInner.java @@ -0,0 +1,777 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01_preview.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 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.HTTP; +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 VirtualNetworkRules. + */ +public class VirtualNetworkRulesInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkRulesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkRulesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkRules to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01_preview.VirtualNetworkRules get" }) + @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.v2018_06_01_preview.VirtualNetworkRules createOrUpdate" }) + @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.v2018_06_01_preview.VirtualNetworkRules beginCreateOrUpdate" }) + @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.v2018_06_01_preview.VirtualNetworkRules delete" }) + @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.v2018_06_01_preview.VirtualNetworkRules beginDelete" }) + @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.v2018_06_01_preview.VirtualNetworkRules listByServer" }) + @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.v2018_06_01_preview.VirtualNetworkRules listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @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 VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner get(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).toBlocking().single().body(); + } + + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName), serviceCallback); + } + + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, serverName, this.client.subscriptionId(), virtualNetworkRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @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 VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner createOrUpdate(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @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 virtualNetworkRuleName, VirtualNetworkRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters), serviceCallback); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, serverName, this.client.subscriptionId(), virtualNetworkRuleName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @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 VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner beginCreateOrUpdate(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @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 virtualNetworkRuleName, VirtualNetworkRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters), serviceCallback); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, serverName, this.client.subscriptionId(), virtualNetworkRuleName, this.client.apiVersion(), parameters, 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(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @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 virtualNetworkRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).toBlocking().last().body(); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName), serviceCallback); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + 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 (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, serverName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @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 virtualNetworkRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).toBlocking().single().body(); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName), serviceCallback); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + 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 (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, serverName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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<VirtualNetworkRuleInner> 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 a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkRuleInner> 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 a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkRuleInner> 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 a list of virtual network rules in a server. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of virtual network rules in 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<VirtualNetworkRuleInner> 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 a list of virtual network rules in 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 a list of virtual network rules in 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<VirtualNetworkRuleInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of virtual network rules in 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<VirtualNetworkRuleInner> 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 a list of virtual network rules in 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<VirtualNetworkRuleInner> 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); + } + +} From 13581e2c04ad99090e87505c25d513361596c351 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 3 Dec 2018 14:30:11 -0800 Subject: [PATCH 3/4] Generated from 17ec7c2490ebb4fbbd1b3f459afb8fd3b7ff6f74 (#2704) typo: mariadb/resource-manager/Microsoft.DBforMariaDB - allowd -> allowed - Trim trailing spaces --- .../mariadb/v2018_06_01_preview/ServerUpdateParameters.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerUpdateParameters.java b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerUpdateParameters.java index c300508c673c7..b350c55b09deb 100644 --- a/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerUpdateParameters.java +++ b/mariadb/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01_preview/ServerUpdateParameters.java @@ -13,7 +13,7 @@ import com.microsoft.rest.serializer.JsonFlatten; /** - * Parameters allowd to update for a server. + * Parameters allowed to update for a server. */ @JsonFlatten public class ServerUpdateParameters { From 84d76f89445d95528d5187c83504b64d817a1917 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 28 Feb 2019 12:20:43 -0800 Subject: [PATCH 4/4] Generated from 7f79b096eb31c9b00c3b4df649e1743071b48b8f (#2987) Update MariaDB api version --- mariadb/resource-manager/v2018_06_01/pom.xml | 133 +++ .../v2018_06_01/CheckNameAvailabilitys.java | 28 + .../mariadb/v2018_06_01/Configuration.java | 155 +++ .../mariadb/v2018_06_01/Configurations.java | 41 + .../mariadb/v2018_06_01/Database.java | 135 +++ .../mariadb/v2018_06_01/Databases.java | 53 + .../mariadb/v2018_06_01/FirewallRule.java | 115 ++ .../mariadb/v2018_06_01/FirewallRules.java | 53 + .../v2018_06_01/GeoRedundantBackup.java | 41 + .../LocationBasedPerformanceTiers.java | 27 + .../mariadb/v2018_06_01/LogFile.java | 61 + .../mariadb/v2018_06_01/LogFiles.java | 29 + .../mariadb/v2018_06_01/NameAvailability.java | 35 + .../v2018_06_01/NameAvailabilityRequest.java | 69 ++ .../mariadb/v2018_06_01/OperationDisplay.java | 77 ++ .../v2018_06_01/OperationListResult.java | 27 + .../mariadb/v2018_06_01/OperationOrigin.java | 44 + .../mariadb/v2018_06_01/Operations.java | 27 + .../PerformanceTierProperties.java | 31 + ...PerformanceTierServiceLevelObjectives.java | 225 ++++ .../mariadb/v2018_06_01/Replicas.java | 29 + .../mariadb/v2018_06_01/Server.java | 204 ++++ .../mariadb/v2018_06_01/ServerForCreate.java | 122 ++ .../ServerPropertiesForCreate.java | 107 ++ .../ServerPropertiesForDefaultCreate.java | 74 ++ .../ServerPropertiesForGeoRestore.java | 48 + .../ServerPropertiesForReplica.java | 47 + .../ServerPropertiesForRestore.java | 75 ++ .../ServerSecurityAlertPolicies.java | 30 + .../ServerSecurityAlertPolicy.java | 251 ++++ .../ServerSecurityAlertPolicyState.java | 53 + .../mariadb/v2018_06_01/ServerServer.java | 102 ++ .../mariadb/v2018_06_01/ServerState.java | 44 + .../v2018_06_01/ServerUpdateParameters.java | 203 ++++ .../mariadb/v2018_06_01/ServerVersion.java | 41 + .../mariadb/v2018_06_01/Servers.java | 36 + .../management/mariadb/v2018_06_01/Sku.java | 149 +++ .../mariadb/v2018_06_01/SkuTier.java | 44 + .../v2018_06_01/SslEnforcementEnum.java | 53 + .../mariadb/v2018_06_01/StorageProfile.java | 96 ++ .../v2018_06_01/VirtualNetworkRule.java | 130 +++ .../v2018_06_01/VirtualNetworkRuleState.java | 50 + .../v2018_06_01/VirtualNetworkRules.java | 53 + .../CheckNameAvailabilitysImpl.java | 43 + .../CheckNameAvailabilitysInner.java | 143 +++ .../implementation/ConfigurationImpl.java | 136 +++ .../implementation/ConfigurationInner.java | 132 +++ .../implementation/ConfigurationsImpl.java | 74 ++ .../implementation/ConfigurationsInner.java | 446 +++++++ .../implementation/DBforMariaDBManager.java | 219 ++++ .../implementation/DatabaseImpl.java | 116 ++ .../implementation/DatabaseInner.java | 72 ++ .../implementation/DatabasesImpl.java | 81 ++ .../implementation/DatabasesInner.java | 625 ++++++++++ .../implementation/FirewallRuleImpl.java | 116 ++ .../implementation/FirewallRuleInner.java | 72 ++ .../implementation/FirewallRulesImpl.java | 81 ++ .../implementation/FirewallRulesInner.java | 625 ++++++++++ .../implementation/IdParsingUtils.java | 57 + .../LocationBasedPerformanceTiersImpl.java | 53 + .../LocationBasedPerformanceTiersInner.java | 145 +++ .../implementation/LogFileImpl.java | 71 ++ .../implementation/LogFileInner.java | 118 ++ .../implementation/LogFilesImpl.java | 53 + .../implementation/LogFilesInner.java | 152 +++ .../MariaDBManagementClientImpl.java | 336 ++++++ .../implementation/NameAvailabilityImpl.java | 41 + .../implementation/NameAvailabilityInner.java | 95 ++ .../implementation/OperationInner.java | 82 ++ .../OperationListResultImpl.java | 32 + .../OperationListResultInner.java | 44 + .../implementation/OperationsImpl.java | 42 + .../implementation/OperationsInner.java | 128 +++ .../v2018_06_01/implementation/PageImpl.java | 75 ++ .../v2018_06_01/implementation/PageImpl1.java | 75 ++ .../PerformanceTierPropertiesImpl.java | 42 + .../PerformanceTierPropertiesInner.java | 71 ++ .../implementation/ReplicasImpl.java | 53 + .../implementation/ReplicasInner.java | 152 +++ .../implementation/ServerImpl.java | 181 +++ .../implementation/ServerInner.java | 315 +++++ .../ServerSecurityAlertPoliciesImpl.java | 55 + .../ServerSecurityAlertPoliciesInner.java | 332 ++++++ .../ServerSecurityAlertPolicyImpl.java | 171 +++ .../ServerSecurityAlertPolicyInner.java | 209 ++++ .../implementation/ServerServerImpl.java | 117 ++ .../implementation/ServersImpl.java | 144 +++ .../implementation/ServersInner.java | 1023 +++++++++++++++++ .../VirtualNetworkRuleImpl.java | 122 ++ .../VirtualNetworkRuleInner.java | 90 ++ .../VirtualNetworkRulesImpl.java | 81 ++ .../VirtualNetworkRulesInner.java | 777 +++++++++++++ .../implementation/package-info.java | 11 + .../mariadb/v2018_06_01/package-info.java | 11 + 94 files changed, 11984 insertions(+) create mode 100644 mariadb/resource-manager/v2018_06_01/pom.xml create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/CheckNameAvailabilitys.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configuration.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configurations.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Database.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Databases.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRule.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRules.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/GeoRedundantBackup.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedPerformanceTiers.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFile.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFiles.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/NameAvailability.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/NameAvailabilityRequest.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationDisplay.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationListResult.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationOrigin.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Operations.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PerformanceTierProperties.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PerformanceTierServiceLevelObjectives.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Replicas.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Server.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerForCreate.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForCreate.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForDefaultCreate.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForGeoRestore.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForReplica.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForRestore.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicies.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicy.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicyState.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerServer.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerState.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerUpdateParameters.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerVersion.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Servers.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Sku.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/SkuTier.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/SslEnforcementEnum.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/StorageProfile.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRule.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRuleState.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRules.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/CheckNameAvailabilitysImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/CheckNameAvailabilitysInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DBforMariaDBManager.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabaseImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabaseInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRuleImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRuleInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/IdParsingUtils.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFileImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFileInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManagementClientImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/NameAvailabilityImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/NameAvailabilityInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationListResultImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationListResultInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationsImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationsInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PageImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PageImpl1.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PerformanceTierPropertiesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PerformanceTierPropertiesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPolicyImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPolicyInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerServerImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServersImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServersInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRuleImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRuleInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesImpl.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesInner.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/package-info.java create mode 100644 mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/package-info.java diff --git a/mariadb/resource-manager/v2018_06_01/pom.xml b/mariadb/resource-manager/v2018_06_01/pom.xml new file mode 100644 index 0000000000000..ad39b2dc8e24e --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.mariadb.v2018_06_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-dbformariadb + 1.0.0-beta + jar + Microsoft Azure SDK for DBforMariaDB Management + This package contains Microsoft DBforMariaDB Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/CheckNameAvailabilitys.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/CheckNameAvailabilitys.java new file mode 100644 index 0000000000000..edac73a93bb13 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/CheckNameAvailabilitys.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.CheckNameAvailabilitysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing CheckNameAvailabilitys. + */ +public interface CheckNameAvailabilitys extends HasInner { + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable executeAsync(NameAvailabilityRequest nameAvailabilityRequest); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configuration.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configuration.java new file mode 100644 index 0000000000000..c5171f97912c7 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configuration.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.ConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; + +/** + * Type representing Configuration. + */ +public interface Configuration extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the allowedValues value. + */ + String allowedValues(); + + /** + * @return the dataType value. + */ + String dataType(); + + /** + * @return the defaultValue value. + */ + String defaultValue(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the source value. + */ + String source(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the value value. + */ + String value(); + + /** + * The entirety of the Configuration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithCreate { + } + + /** + * Grouping of Configuration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Configuration definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the configuration definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithCreate withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the configuration definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + */ + WithCreate withSource(String source); + } + + /** + * The stage of the configuration definition allowing to specify Value. + */ + interface WithValue { + /** + * Specifies value. + */ + WithCreate withValue(String value); + } + + /** + * 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.WithSource, DefinitionStages.WithValue { + } + } + /** + * The template for a Configuration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithSource, UpdateStages.WithValue { + } + + /** + * Grouping of Configuration update stages. + */ + interface UpdateStages { + /** + * The stage of the configuration update allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + */ + Update withSource(String source); + } + + /** + * The stage of the configuration update allowing to specify Value. + */ + interface WithValue { + /** + * Specifies value. + */ + Update withValue(String value); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configurations.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configurations.java new file mode 100644 index 0000000000000..4467a872d5d27 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Configurations.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.ConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Configurations. + */ +public interface Configurations extends SupportsCreating, HasInner { + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String configurationName); + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Database.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Database.java new file mode 100644 index 0000000000000..95f4333188156 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Database.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DatabaseInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; + +/** + * Type representing Database. + */ +public interface Database extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the charset value. + */ + String charset(); + + /** + * @return the collation value. + */ + String collation(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Database definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithCreate { + } + + /** + * Grouping of Database definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Database definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the database definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithCreate withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the database definition allowing to specify Charset. + */ + interface WithCharset { + /** + * Specifies charset. + */ + WithCreate withCharset(String charset); + } + + /** + * The stage of the database definition allowing to specify Collation. + */ + interface WithCollation { + /** + * Specifies collation. + */ + WithCreate withCollation(String collation); + } + + /** + * 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.WithCharset, DefinitionStages.WithCollation { + } + } + /** + * The template for a Database update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCharset, UpdateStages.WithCollation { + } + + /** + * Grouping of Database update stages. + */ + interface UpdateStages { + /** + * The stage of the database update allowing to specify Charset. + */ + interface WithCharset { + /** + * Specifies charset. + */ + Update withCharset(String charset); + } + + /** + * The stage of the database update allowing to specify Collation. + */ + interface WithCollation { + /** + * Specifies collation. + */ + Update withCollation(String collation); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Databases.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Databases.java new file mode 100644 index 0000000000000..fe3b60208e5b9 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Databases.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DatabasesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Databases. + */ +public interface Databases extends SupportsCreating, HasInner { + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String databaseName); + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serverName, String databaseName); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRule.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRule.java new file mode 100644 index 0000000000000..f8ce9e0f7eb4e --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRule.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.FirewallRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; + +/** + * Type representing FirewallRule. + */ +public interface FirewallRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the endIpAddress value. + */ + String endIpAddress(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startIpAddress value. + */ + String startIpAddress(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the FirewallRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithEndIpAddress, DefinitionStages.WithStartIpAddress, DefinitionStages.WithCreate { + } + + /** + * Grouping of FirewallRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a FirewallRule definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the firewallrule definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithEndIpAddress withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the firewallrule definition allowing to specify EndIpAddress. + */ + interface WithEndIpAddress { + /** + * Specifies endIpAddress. + */ + WithStartIpAddress withEndIpAddress(String endIpAddress); + } + + /** + * The stage of the firewallrule definition allowing to specify StartIpAddress. + */ + interface WithStartIpAddress { + /** + * Specifies startIpAddress. + */ + WithCreate withStartIpAddress(String startIpAddress); + } + + /** + * 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 { + } + } + /** + * The template for a FirewallRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of FirewallRule update stages. + */ + interface UpdateStages { + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRules.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRules.java new file mode 100644 index 0000000000000..96126962df351 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/FirewallRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.FirewallRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing FirewallRules. + */ +public interface FirewallRules extends SupportsCreating, HasInner { + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String firewallRuleName); + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serverName, String firewallRuleName); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/GeoRedundantBackup.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/GeoRedundantBackup.java new file mode 100644 index 0000000000000..30b5ed5338cf5 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/GeoRedundantBackup.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for GeoRedundantBackup. + */ +public final class GeoRedundantBackup extends ExpandableStringEnum { + /** Static value Enabled for GeoRedundantBackup. */ + public static final GeoRedundantBackup ENABLED = fromString("Enabled"); + + /** Static value Disabled for GeoRedundantBackup. */ + public static final GeoRedundantBackup DISABLED = fromString("Disabled"); + + /** + * Creates or finds a GeoRedundantBackup from its string representation. + * @param name a name to look for + * @return the corresponding GeoRedundantBackup + */ + @JsonCreator + public static GeoRedundantBackup fromString(String name) { + return fromString(name, GeoRedundantBackup.class); + } + + /** + * @return known GeoRedundantBackup values + */ + public static Collection values() { + return values(GeoRedundantBackup.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedPerformanceTiers.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedPerformanceTiers.java new file mode 100644 index 0000000000000..c65e71aa07eca --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LocationBasedPerformanceTiers.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.PerformanceTierProperties; + +/** + * Type representing LocationBasedPerformanceTiers. + */ +public interface LocationBasedPerformanceTiers { + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String locationName); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFile.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFile.java new file mode 100644 index 0000000000000..c9cdca6708730 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFile.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.LogFileInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; +import org.joda.time.DateTime; + +/** + * Type representing LogFile. + */ +public interface LogFile extends HasInner, HasManager { + /** + * @return the createdTime value. + */ + DateTime createdTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the logFileType value. + */ + String logFileType(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sizeInKB value. + */ + Long sizeInKB(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the url value. + */ + String url(); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFiles.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFiles.java new file mode 100644 index 0000000000000..346784cc5b88c --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/LogFiles.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.LogFilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LogFiles. + */ +public interface LogFiles extends HasInner { + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/NameAvailability.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/NameAvailability.java new file mode 100644 index 0000000000000..174aab056f4eb --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/NameAvailability.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.NameAvailabilityInner; + +/** + * Type representing NameAvailability. + */ +public interface NameAvailability extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/NameAvailabilityRequest.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/NameAvailabilityRequest.java new file mode 100644 index 0000000000000..a9169f490cadd --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/NameAvailabilityRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Request from client to check resource name availability. + */ +public class NameAvailabilityRequest { + /** + * Resource name to verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type used for verification. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get resource name to verify. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name to verify. + * + * @param name the name value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type used for verification. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type used for verification. + * + * @param type the type value to set + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationDisplay.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationDisplay.java new file mode 100644 index 0000000000000..e42bc6b81f4e9 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Operation resource provider name. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Localized friendly name for the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Operation description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get operation resource provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get localized friendly name for the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationListResult.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationListResult.java new file mode 100644 index 0000000000000..c5665a77850b0 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.OperationListResultInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.OperationInner; +import java.util.List; + +/** + * Type representing OperationListResult. + */ +public interface OperationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationOrigin.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationOrigin.java new file mode 100644 index 0000000000000..c0d8c9a659b4e --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/OperationOrigin.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationOrigin. + */ +public final class OperationOrigin extends ExpandableStringEnum { + /** Static value NotSpecified for OperationOrigin. */ + public static final OperationOrigin NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value user for OperationOrigin. */ + public static final OperationOrigin USER = fromString("user"); + + /** Static value system for OperationOrigin. */ + public static final OperationOrigin SYSTEM = fromString("system"); + + /** + * Creates or finds a OperationOrigin from its string representation. + * @param name a name to look for + * @return the corresponding OperationOrigin + */ + @JsonCreator + public static OperationOrigin fromString(String name) { + return fromString(name, OperationOrigin.class); + } + + /** + * @return known OperationOrigin values + */ + public static Collection values() { + return values(OperationOrigin.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Operations.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Operations.java new file mode 100644 index 0000000000000..1dc0cc40f6591 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PerformanceTierProperties.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PerformanceTierProperties.java new file mode 100644 index 0000000000000..a5ad5747190e4 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PerformanceTierProperties.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.PerformanceTierPropertiesInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; +import java.util.List; + +/** + * Type representing PerformanceTierProperties. + */ +public interface PerformanceTierProperties extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the serviceLevelObjectives value. + */ + List serviceLevelObjectives(); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PerformanceTierServiceLevelObjectives.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PerformanceTierServiceLevelObjectives.java new file mode 100644 index 0000000000000..576cd1560aa7a --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/PerformanceTierServiceLevelObjectives.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service level objectives for performance tier. + */ +public class PerformanceTierServiceLevelObjectives { + /** + * ID for the service level objective. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Edition of the performance tier. + */ + @JsonProperty(value = "edition") + private String edition; + + /** + * vCore associated with the service level objective. + */ + @JsonProperty(value = "vCore") + private Integer vCore; + + /** + * Hardware generation associated with the service level objective. + */ + @JsonProperty(value = "hardwareGeneration") + private String hardwareGeneration; + + /** + * Maximum Backup retention in days for the performance tier edition. + */ + @JsonProperty(value = "maxBackupRetentionDays") + private Integer maxBackupRetentionDays; + + /** + * Minimum Backup retention in days for the performance tier edition. + */ + @JsonProperty(value = "minBackupRetentionDays") + private Integer minBackupRetentionDays; + + /** + * Max storage allowed for a server. + */ + @JsonProperty(value = "maxStorageMB") + private Integer maxStorageMB; + + /** + * Max storage allowed for a server. + */ + @JsonProperty(value = "minStorageMB") + private Integer minStorageMB; + + /** + * Get iD for the service level objective. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD for the service level objective. + * + * @param id the id value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withId(String id) { + this.id = id; + return this; + } + + /** + * Get edition of the performance tier. + * + * @return the edition value + */ + public String edition() { + return this.edition; + } + + /** + * Set edition of the performance tier. + * + * @param edition the edition value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withEdition(String edition) { + this.edition = edition; + return this; + } + + /** + * Get vCore associated with the service level objective. + * + * @return the vCore value + */ + public Integer vCore() { + return this.vCore; + } + + /** + * Set vCore associated with the service level objective. + * + * @param vCore the vCore value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withVCore(Integer vCore) { + this.vCore = vCore; + return this; + } + + /** + * Get hardware generation associated with the service level objective. + * + * @return the hardwareGeneration value + */ + public String hardwareGeneration() { + return this.hardwareGeneration; + } + + /** + * Set hardware generation associated with the service level objective. + * + * @param hardwareGeneration the hardwareGeneration value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withHardwareGeneration(String hardwareGeneration) { + this.hardwareGeneration = hardwareGeneration; + return this; + } + + /** + * Get maximum Backup retention in days for the performance tier edition. + * + * @return the maxBackupRetentionDays value + */ + public Integer maxBackupRetentionDays() { + return this.maxBackupRetentionDays; + } + + /** + * Set maximum Backup retention in days for the performance tier edition. + * + * @param maxBackupRetentionDays the maxBackupRetentionDays value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withMaxBackupRetentionDays(Integer maxBackupRetentionDays) { + this.maxBackupRetentionDays = maxBackupRetentionDays; + return this; + } + + /** + * Get minimum Backup retention in days for the performance tier edition. + * + * @return the minBackupRetentionDays value + */ + public Integer minBackupRetentionDays() { + return this.minBackupRetentionDays; + } + + /** + * Set minimum Backup retention in days for the performance tier edition. + * + * @param minBackupRetentionDays the minBackupRetentionDays value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withMinBackupRetentionDays(Integer minBackupRetentionDays) { + this.minBackupRetentionDays = minBackupRetentionDays; + return this; + } + + /** + * Get max storage allowed for a server. + * + * @return the maxStorageMB value + */ + public Integer maxStorageMB() { + return this.maxStorageMB; + } + + /** + * Set max storage allowed for a server. + * + * @param maxStorageMB the maxStorageMB value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withMaxStorageMB(Integer maxStorageMB) { + this.maxStorageMB = maxStorageMB; + return this; + } + + /** + * Get max storage allowed for a server. + * + * @return the minStorageMB value + */ + public Integer minStorageMB() { + return this.minStorageMB; + } + + /** + * Set max storage allowed for a server. + * + * @param minStorageMB the minStorageMB value to set + * @return the PerformanceTierServiceLevelObjectives object itself. + */ + public PerformanceTierServiceLevelObjectives withMinStorageMB(Integer minStorageMB) { + this.minStorageMB = minStorageMB; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Replicas.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Replicas.java new file mode 100644 index 0000000000000..b40a82aefbab1 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Replicas.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.ReplicasInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Replicas. + */ +public interface Replicas extends HasInner { + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByServerAsync(String resourceGroupName, String serverName); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Server.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Server.java new file mode 100644 index 0000000000000..4d107ad36f81e --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Server.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.ServerInner; + +/** + * Type representing Server. + */ +public interface Server extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the administratorLogin value. + */ + String administratorLogin(); + + /** + * @return the earliestRestoreDate value. + */ + DateTime earliestRestoreDate(); + + /** + * @return the fullyQualifiedDomainName value. + */ + String fullyQualifiedDomainName(); + + /** + * @return the masterServerId value. + */ + String masterServerId(); + + /** + * @return the replicaCapacity value. + */ + Integer replicaCapacity(); + + /** + * @return the replicationRole value. + */ + String replicationRole(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the sslEnforcement value. + */ + SslEnforcementEnum sslEnforcement(); + + /** + * @return the storageProfile value. + */ + StorageProfile storageProfile(); + + /** + * @return the userVisibleState value. + */ + ServerState userVisibleState(); + + /** + * @return the version value. + */ + ServerVersion version(); + + /** + * The entirety of the Server definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of Server definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Server definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Server definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the server definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + WithCreate withProperties(ServerPropertiesForCreate properties); + } + + /** + * The stage of the server update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(Sku sku); + } + + /** + * 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, Resource.DefinitionWithTags, DefinitionStages.WithSku { + } + } + /** + * The template for a Server update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithReplicationRole, UpdateStages.WithSku, UpdateStages.WithSslEnforcement, UpdateStages.WithStorageProfile, UpdateStages.WithVersion { + } + + /** + * Grouping of Server update stages. + */ + interface UpdateStages { + /** + * The stage of the server {0} allowing to specify AdministratorLoginPassword. + */ + interface WithAdministratorLoginPassword { + /** + * Specifies administratorLoginPassword. + */ + Update withAdministratorLoginPassword(String administratorLoginPassword); + } + + /** + * The stage of the server {0} allowing to specify ReplicationRole. + */ + interface WithReplicationRole { + /** + * Specifies replicationRole. + */ + Update withReplicationRole(String replicationRole); + } + + /** + * The stage of the server {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(Sku sku); + } + + /** + * The stage of the server {0} allowing to specify SslEnforcement. + */ + interface WithSslEnforcement { + /** + * Specifies sslEnforcement. + */ + Update withSslEnforcement(SslEnforcementEnum sslEnforcement); + } + + /** + * The stage of the server {0} allowing to specify StorageProfile. + */ + interface WithStorageProfile { + /** + * Specifies storageProfile. + */ + Update withStorageProfile(StorageProfile storageProfile); + } + + /** + * The stage of the server {0} allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + */ + Update withVersion(ServerVersion version); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerForCreate.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerForCreate.java new file mode 100644 index 0000000000000..5d88ad425853d --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerForCreate.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a server to be created. + */ +public class ServerForCreate { + /** + * The SKU (pricing tier) of the server. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Properties of the server. + */ + @JsonProperty(value = "properties", required = true) + private ServerPropertiesForCreate properties; + + /** + * The location the resource resides in. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the SKU (pricing tier) of the server. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU (pricing tier) of the server. + * + * @param sku the sku value to set + * @return the ServerForCreate object itself. + */ + public ServerForCreate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get properties of the server. + * + * @return the properties value + */ + public ServerPropertiesForCreate properties() { + return this.properties; + } + + /** + * Set properties of the server. + * + * @param properties the properties value to set + * @return the ServerForCreate object itself. + */ + public ServerForCreate withProperties(ServerPropertiesForCreate properties) { + this.properties = properties; + return this; + } + + /** + * Get the location the resource resides in. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location the resource resides in. + * + * @param location the location value to set + * @return the ServerForCreate object itself. + */ + public ServerForCreate withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get application-specific metadata in the form of key-value pairs. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set application-specific metadata in the form of key-value pairs. + * + * @param tags the tags value to set + * @return the ServerForCreate object itself. + */ + public ServerForCreate withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForCreate.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForCreate.java new file mode 100644 index 0000000000000..ac0b6a154a77c --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForCreate.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The properties used to create a new server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("ServerPropertiesForCreate") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Default", value = ServerPropertiesForDefaultCreate.class), + @JsonSubTypes.Type(name = "PointInTimeRestore", value = ServerPropertiesForRestore.class), + @JsonSubTypes.Type(name = "GeoRestore", value = ServerPropertiesForGeoRestore.class), + @JsonSubTypes.Type(name = "Replica", value = ServerPropertiesForReplica.class) +}) +public class ServerPropertiesForCreate { + /** + * Server version. Possible values include: '5.6', '5.7'. + */ + @JsonProperty(value = "version") + private ServerVersion version; + + /** + * Enable ssl enforcement or not when connect to server. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "sslEnforcement") + private SslEnforcementEnum sslEnforcement; + + /** + * Storage profile of a server. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /** + * Get server version. Possible values include: '5.6', '5.7'. + * + * @return the version value + */ + public ServerVersion version() { + return this.version; + } + + /** + * Set server version. Possible values include: '5.6', '5.7'. + * + * @param version the version value to set + * @return the ServerPropertiesForCreate object itself. + */ + public ServerPropertiesForCreate withVersion(ServerVersion version) { + this.version = version; + return this; + } + + /** + * Get enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @return the sslEnforcement value + */ + public SslEnforcementEnum sslEnforcement() { + return this.sslEnforcement; + } + + /** + * Set enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @param sslEnforcement the sslEnforcement value to set + * @return the ServerPropertiesForCreate object itself. + */ + public ServerPropertiesForCreate withSslEnforcement(SslEnforcementEnum sslEnforcement) { + this.sslEnforcement = sslEnforcement; + return this; + } + + /** + * Get storage profile of a server. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set storage profile of a server. + * + * @param storageProfile the storageProfile value to set + * @return the ServerPropertiesForCreate object itself. + */ + public ServerPropertiesForCreate withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForDefaultCreate.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForDefaultCreate.java new file mode 100644 index 0000000000000..06c98e6714740 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForDefaultCreate.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties used to create a new server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("Default") +public class ServerPropertiesForDefaultCreate extends ServerPropertiesForCreate { + /** + * The administrator's login name of a server. Can only be specified when + * the server is being created (and is required for creation). + */ + @JsonProperty(value = "administratorLogin", required = true) + private String administratorLogin; + + /** + * The password of the administrator login. + */ + @JsonProperty(value = "administratorLoginPassword", required = true) + private String administratorLoginPassword; + + /** + * Get the administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + * + * @return the administratorLogin value + */ + public String administratorLogin() { + return this.administratorLogin; + } + + /** + * Set the administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + * + * @param administratorLogin the administratorLogin value to set + * @return the ServerPropertiesForDefaultCreate object itself. + */ + public ServerPropertiesForDefaultCreate withAdministratorLogin(String administratorLogin) { + this.administratorLogin = administratorLogin; + return this; + } + + /** + * Get the password of the administrator login. + * + * @return the administratorLoginPassword value + */ + public String administratorLoginPassword() { + return this.administratorLoginPassword; + } + + /** + * Set the password of the administrator login. + * + * @param administratorLoginPassword the administratorLoginPassword value to set + * @return the ServerPropertiesForDefaultCreate object itself. + */ + public ServerPropertiesForDefaultCreate withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForGeoRestore.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForGeoRestore.java new file mode 100644 index 0000000000000..841db628f5019 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForGeoRestore.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties used to create a new server by restoring to a different + * region from a geo replicated backup. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("GeoRestore") +public class ServerPropertiesForGeoRestore extends ServerPropertiesForCreate { + /** + * The source server id to restore from. + */ + @JsonProperty(value = "sourceServerId", required = true) + private String sourceServerId; + + /** + * Get the source server id to restore from. + * + * @return the sourceServerId value + */ + public String sourceServerId() { + return this.sourceServerId; + } + + /** + * Set the source server id to restore from. + * + * @param sourceServerId the sourceServerId value to set + * @return the ServerPropertiesForGeoRestore object itself. + */ + public ServerPropertiesForGeoRestore withSourceServerId(String sourceServerId) { + this.sourceServerId = sourceServerId; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForReplica.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForReplica.java new file mode 100644 index 0000000000000..2cc3741ea975c --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForReplica.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties to create a new replica. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("Replica") +public class ServerPropertiesForReplica extends ServerPropertiesForCreate { + /** + * The master server id to create replica from. + */ + @JsonProperty(value = "sourceServerId", required = true) + private String sourceServerId; + + /** + * Get the master server id to create replica from. + * + * @return the sourceServerId value + */ + public String sourceServerId() { + return this.sourceServerId; + } + + /** + * Set the master server id to create replica from. + * + * @param sourceServerId the sourceServerId value to set + * @return the ServerPropertiesForReplica object itself. + */ + public ServerPropertiesForReplica withSourceServerId(String sourceServerId) { + this.sourceServerId = sourceServerId; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForRestore.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForRestore.java new file mode 100644 index 0000000000000..6235e5bc2dba7 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerPropertiesForRestore.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties used to create a new server by restoring from a backup. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "createMode") +@JsonTypeName("PointInTimeRestore") +public class ServerPropertiesForRestore extends ServerPropertiesForCreate { + /** + * The source server id to restore from. + */ + @JsonProperty(value = "sourceServerId", required = true) + private String sourceServerId; + + /** + * Restore point creation time (ISO8601 format), specifying the time to + * restore from. + */ + @JsonProperty(value = "restorePointInTime", required = true) + private DateTime restorePointInTime; + + /** + * Get the source server id to restore from. + * + * @return the sourceServerId value + */ + public String sourceServerId() { + return this.sourceServerId; + } + + /** + * Set the source server id to restore from. + * + * @param sourceServerId the sourceServerId value to set + * @return the ServerPropertiesForRestore object itself. + */ + public ServerPropertiesForRestore withSourceServerId(String sourceServerId) { + this.sourceServerId = sourceServerId; + return this; + } + + /** + * Get restore point creation time (ISO8601 format), specifying the time to restore from. + * + * @return the restorePointInTime value + */ + public DateTime restorePointInTime() { + return this.restorePointInTime; + } + + /** + * Set restore point creation time (ISO8601 format), specifying the time to restore from. + * + * @param restorePointInTime the restorePointInTime value to set + * @return the ServerPropertiesForRestore object itself. + */ + public ServerPropertiesForRestore withRestorePointInTime(DateTime restorePointInTime) { + this.restorePointInTime = restorePointInTime; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicies.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicies.java new file mode 100644 index 0000000000000..80527a8cd2258 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicies.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.ServerSecurityAlertPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ServerSecurityAlertPolicies. + */ +public interface ServerSecurityAlertPolicies extends SupportsCreating, HasInner { + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicy.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicy.java new file mode 100644 index 0000000000000..45a4c1c3ff731 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicy.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.ServerSecurityAlertPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; +import java.util.List; + +/** + * Type representing ServerSecurityAlertPolicy. + */ +public interface ServerSecurityAlertPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the disabledAlerts value. + */ + List disabledAlerts(); + + /** + * @return the emailAccountAdmins value. + */ + Boolean emailAccountAdmins(); + + /** + * @return the emailAddresses value. + */ + List emailAddresses(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the retentionDays value. + */ + Integer retentionDays(); + + /** + * @return the state value. + */ + ServerSecurityAlertPolicyState state(); + + /** + * @return the storageAccountAccessKey value. + */ + String storageAccountAccessKey(); + + /** + * @return the storageEndpoint value. + */ + String storageEndpoint(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ServerSecurityAlertPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithState, DefinitionStages.WithCreate { + } + + /** + * Grouping of ServerSecurityAlertPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ServerSecurityAlertPolicy definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithState withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + */ + WithCreate withState(ServerSecurityAlertPolicyState state); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify DisabledAlerts. + */ + interface WithDisabledAlerts { + /** + * Specifies disabledAlerts. + */ + WithCreate withDisabledAlerts(List disabledAlerts); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify EmailAccountAdmins. + */ + interface WithEmailAccountAdmins { + /** + * Specifies emailAccountAdmins. + */ + WithCreate withEmailAccountAdmins(Boolean emailAccountAdmins); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify EmailAddresses. + */ + interface WithEmailAddresses { + /** + * Specifies emailAddresses. + */ + WithCreate withEmailAddresses(List emailAddresses); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify RetentionDays. + */ + interface WithRetentionDays { + /** + * Specifies retentionDays. + */ + WithCreate withRetentionDays(Integer retentionDays); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify StorageAccountAccessKey. + */ + interface WithStorageAccountAccessKey { + /** + * Specifies storageAccountAccessKey. + */ + WithCreate withStorageAccountAccessKey(String storageAccountAccessKey); + } + + /** + * The stage of the serversecurityalertpolicy definition allowing to specify StorageEndpoint. + */ + interface WithStorageEndpoint { + /** + * Specifies storageEndpoint. + */ + WithCreate withStorageEndpoint(String storageEndpoint); + } + + /** + * 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.WithDisabledAlerts, DefinitionStages.WithEmailAccountAdmins, DefinitionStages.WithEmailAddresses, DefinitionStages.WithRetentionDays, DefinitionStages.WithStorageAccountAccessKey, DefinitionStages.WithStorageEndpoint { + } + } + /** + * The template for a ServerSecurityAlertPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDisabledAlerts, UpdateStages.WithEmailAccountAdmins, UpdateStages.WithEmailAddresses, UpdateStages.WithRetentionDays, UpdateStages.WithStorageAccountAccessKey, UpdateStages.WithStorageEndpoint { + } + + /** + * Grouping of ServerSecurityAlertPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the serversecurityalertpolicy update allowing to specify DisabledAlerts. + */ + interface WithDisabledAlerts { + /** + * Specifies disabledAlerts. + */ + Update withDisabledAlerts(List disabledAlerts); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify EmailAccountAdmins. + */ + interface WithEmailAccountAdmins { + /** + * Specifies emailAccountAdmins. + */ + Update withEmailAccountAdmins(Boolean emailAccountAdmins); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify EmailAddresses. + */ + interface WithEmailAddresses { + /** + * Specifies emailAddresses. + */ + Update withEmailAddresses(List emailAddresses); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify RetentionDays. + */ + interface WithRetentionDays { + /** + * Specifies retentionDays. + */ + Update withRetentionDays(Integer retentionDays); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify StorageAccountAccessKey. + */ + interface WithStorageAccountAccessKey { + /** + * Specifies storageAccountAccessKey. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + + /** + * The stage of the serversecurityalertpolicy update allowing to specify StorageEndpoint. + */ + interface WithStorageEndpoint { + /** + * Specifies storageEndpoint. + */ + Update withStorageEndpoint(String storageEndpoint); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicyState.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicyState.java new file mode 100644 index 0000000000000..46a74d7d430cf --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerSecurityAlertPolicyState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ServerSecurityAlertPolicyState. + */ +public enum ServerSecurityAlertPolicyState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a ServerSecurityAlertPolicyState instance. */ + private String value; + + ServerSecurityAlertPolicyState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ServerSecurityAlertPolicyState instance. + * + * @param value the serialized value to parse. + * @return the parsed ServerSecurityAlertPolicyState object, or null if unable to parse. + */ + @JsonCreator + public static ServerSecurityAlertPolicyState fromString(String value) { + ServerSecurityAlertPolicyState[] items = ServerSecurityAlertPolicyState.values(); + for (ServerSecurityAlertPolicyState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerServer.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerServer.java new file mode 100644 index 0000000000000..4c7367751677f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerServer.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.ServerInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing ServerServer. + */ +public interface ServerServer extends HasInner, HasManager { + /** + * @return the administratorLogin value. + */ + String administratorLogin(); + + /** + * @return the earliestRestoreDate value. + */ + DateTime earliestRestoreDate(); + + /** + * @return the fullyQualifiedDomainName value. + */ + String fullyQualifiedDomainName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the masterServerId value. + */ + String masterServerId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the replicaCapacity value. + */ + Integer replicaCapacity(); + + /** + * @return the replicationRole value. + */ + String replicationRole(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the sslEnforcement value. + */ + SslEnforcementEnum sslEnforcement(); + + /** + * @return the storageProfile value. + */ + StorageProfile storageProfile(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the userVisibleState value. + */ + ServerState userVisibleState(); + + /** + * @return the version value. + */ + ServerVersion version(); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerState.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerState.java new file mode 100644 index 0000000000000..6a9ef621c3d61 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServerState. + */ +public final class ServerState extends ExpandableStringEnum { + /** Static value Ready for ServerState. */ + public static final ServerState READY = fromString("Ready"); + + /** Static value Dropping for ServerState. */ + public static final ServerState DROPPING = fromString("Dropping"); + + /** Static value Disabled for ServerState. */ + public static final ServerState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ServerState from its string representation. + * @param name a name to look for + * @return the corresponding ServerState + */ + @JsonCreator + public static ServerState fromString(String name) { + return fromString(name, ServerState.class); + } + + /** + * @return known ServerState values + */ + public static Collection values() { + return values(ServerState.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerUpdateParameters.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerUpdateParameters.java new file mode 100644 index 0000000000000..b23087b7e7a66 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerUpdateParameters.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters allowed to update for a server. + */ +@JsonFlatten +public class ServerUpdateParameters { + /** + * The SKU (pricing tier) of the server. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Storage profile of a server. + */ + @JsonProperty(value = "properties.storageProfile") + private StorageProfile storageProfile; + + /** + * The password of the administrator login. + */ + @JsonProperty(value = "properties.administratorLoginPassword") + private String administratorLoginPassword; + + /** + * The version of a server. Possible values include: '5.6', '5.7'. + */ + @JsonProperty(value = "properties.version") + private ServerVersion version; + + /** + * Enable ssl enforcement or not when connect to server. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.sslEnforcement") + private SslEnforcementEnum sslEnforcement; + + /** + * The replication role of the server. + */ + @JsonProperty(value = "properties.replicationRole") + private String replicationRole; + + /** + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the SKU (pricing tier) of the server. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU (pricing tier) of the server. + * + * @param sku the sku value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get storage profile of a server. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set storage profile of a server. + * + * @param storageProfile the storageProfile value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the password of the administrator login. + * + * @return the administratorLoginPassword value + */ + public String administratorLoginPassword() { + return this.administratorLoginPassword; + } + + /** + * Set the password of the administrator login. + * + * @param administratorLoginPassword the administratorLoginPassword value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; + return this; + } + + /** + * Get the version of a server. Possible values include: '5.6', '5.7'. + * + * @return the version value + */ + public ServerVersion version() { + return this.version; + } + + /** + * Set the version of a server. Possible values include: '5.6', '5.7'. + * + * @param version the version value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withVersion(ServerVersion version) { + this.version = version; + return this; + } + + /** + * Get enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @return the sslEnforcement value + */ + public SslEnforcementEnum sslEnforcement() { + return this.sslEnforcement; + } + + /** + * Set enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @param sslEnforcement the sslEnforcement value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withSslEnforcement(SslEnforcementEnum sslEnforcement) { + this.sslEnforcement = sslEnforcement; + return this; + } + + /** + * Get the replication role of the server. + * + * @return the replicationRole value + */ + public String replicationRole() { + return this.replicationRole; + } + + /** + * Set the replication role of the server. + * + * @param replicationRole the replicationRole value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withReplicationRole(String replicationRole) { + this.replicationRole = replicationRole; + return this; + } + + /** + * Get application-specific metadata in the form of key-value pairs. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set application-specific metadata in the form of key-value pairs. + * + * @param tags the tags value to set + * @return the ServerUpdateParameters object itself. + */ + public ServerUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerVersion.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerVersion.java new file mode 100644 index 0000000000000..31854e9fdb480 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/ServerVersion.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServerVersion. + */ +public final class ServerVersion extends ExpandableStringEnum { + /** Static value 5.6 for ServerVersion. */ + public static final ServerVersion FIVE_FULL_STOP_SIX = fromString("5.6"); + + /** Static value 5.7 for ServerVersion. */ + public static final ServerVersion FIVE_FULL_STOP_SEVEN = fromString("5.7"); + + /** + * Creates or finds a ServerVersion from its string representation. + * @param name a name to look for + * @return the corresponding ServerVersion + */ + @JsonCreator + public static ServerVersion fromString(String name) { + return fromString(name, ServerVersion.class); + } + + /** + * @return known ServerVersion values + */ + public static Collection values() { + return values(ServerVersion.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Servers.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Servers.java new file mode 100644 index 0000000000000..07e3952b94019 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Servers.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.ServersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Servers. + */ +public interface Servers extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable restartAsync(String resourceGroupName, String serverName); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Sku.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Sku.java new file mode 100644 index 0000000000000..73667f59e7fe4 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/Sku.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Billing information related properties of a server. + */ +public class Sku { + /** + * The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, + * GP_Gen5_8. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The tier of the particular SKU, e.g. Basic. Possible values include: + * 'Basic', 'GeneralPurpose', 'MemoryOptimized'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * The scale up/out capacity, representing server's compute units. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * The size code, to be interpreted by resource as appropriate. + */ + @JsonProperty(value = "size") + private String size; + + /** + * The family of hardware. + */ + @JsonProperty(value = "family") + private String family; + + /** + * Get the name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized'. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the scale up/out capacity, representing server's compute units. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the scale up/out capacity, representing server's compute units. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the size code, to be interpreted by resource as appropriate. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the size code, to be interpreted by resource as appropriate. + * + * @param size the size value to set + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family of hardware. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the family of hardware. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/SkuTier.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/SkuTier.java new file mode 100644 index 0000000000000..17a558378fd6f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/SkuTier.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value GeneralPurpose for SkuTier. */ + public static final SkuTier GENERAL_PURPOSE = fromString("GeneralPurpose"); + + /** Static value MemoryOptimized for SkuTier. */ + public static final SkuTier MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/SslEnforcementEnum.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/SslEnforcementEnum.java new file mode 100644 index 0000000000000..1da73e85d6f59 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/SslEnforcementEnum.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SslEnforcementEnum. + */ +public enum SslEnforcementEnum { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a SslEnforcementEnum instance. */ + private String value; + + SslEnforcementEnum(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SslEnforcementEnum instance. + * + * @param value the serialized value to parse. + * @return the parsed SslEnforcementEnum object, or null if unable to parse. + */ + @JsonCreator + public static SslEnforcementEnum fromString(String value) { + SslEnforcementEnum[] items = SslEnforcementEnum.values(); + for (SslEnforcementEnum item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/StorageProfile.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/StorageProfile.java new file mode 100644 index 0000000000000..96cfee6de9c9b --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/StorageProfile.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Storage Profile properties of a server. + */ +public class StorageProfile { + /** + * Backup retention days for the server. + */ + @JsonProperty(value = "backupRetentionDays") + private Integer backupRetentionDays; + + /** + * Enable Geo-redundant or not for server backup. Possible values include: + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "geoRedundantBackup") + private GeoRedundantBackup geoRedundantBackup; + + /** + * Max storage allowed for a server. + */ + @JsonProperty(value = "storageMB") + private Integer storageMB; + + /** + * Get backup retention days for the server. + * + * @return the backupRetentionDays value + */ + public Integer backupRetentionDays() { + return this.backupRetentionDays; + } + + /** + * Set backup retention days for the server. + * + * @param backupRetentionDays the backupRetentionDays value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withBackupRetentionDays(Integer backupRetentionDays) { + this.backupRetentionDays = backupRetentionDays; + return this; + } + + /** + * Get enable Geo-redundant or not for server backup. Possible values include: 'Enabled', 'Disabled'. + * + * @return the geoRedundantBackup value + */ + public GeoRedundantBackup geoRedundantBackup() { + return this.geoRedundantBackup; + } + + /** + * Set enable Geo-redundant or not for server backup. Possible values include: 'Enabled', 'Disabled'. + * + * @param geoRedundantBackup the geoRedundantBackup value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withGeoRedundantBackup(GeoRedundantBackup geoRedundantBackup) { + this.geoRedundantBackup = geoRedundantBackup; + return this; + } + + /** + * Get max storage allowed for a server. + * + * @return the storageMB value + */ + public Integer storageMB() { + return this.storageMB; + } + + /** + * Set max storage allowed for a server. + * + * @param storageMB the storageMB value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withStorageMB(Integer storageMB) { + this.storageMB = storageMB; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRule.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRule.java new file mode 100644 index 0000000000000..406267d8462fa --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRule.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.VirtualNetworkRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.DBforMariaDBManager; + +/** + * Type representing VirtualNetworkRule. + */ +public interface VirtualNetworkRule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the ignoreMissingVnetServiceEndpoint value. + */ + Boolean ignoreMissingVnetServiceEndpoint(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the state value. + */ + VirtualNetworkRuleState state(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualNetworkSubnetId value. + */ + String virtualNetworkSubnetId(); + + /** + * The entirety of the VirtualNetworkRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithServer, DefinitionStages.WithVirtualNetworkSubnetId, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualNetworkRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualNetworkRule definition. + */ + interface Blank extends WithServer { + } + + /** + * The stage of the virtualnetworkrule definition allowing to specify Server. + */ + interface WithServer { + /** + * Specifies resourceGroupName, serverName. + */ + WithVirtualNetworkSubnetId withExistingServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the virtualnetworkrule definition allowing to specify VirtualNetworkSubnetId. + */ + interface WithVirtualNetworkSubnetId { + /** + * Specifies virtualNetworkSubnetId. + */ + WithCreate withVirtualNetworkSubnetId(String virtualNetworkSubnetId); + } + + /** + * The stage of the virtualnetworkrule definition allowing to specify IgnoreMissingVnetServiceEndpoint. + */ + interface WithIgnoreMissingVnetServiceEndpoint { + /** + * Specifies ignoreMissingVnetServiceEndpoint. + */ + WithCreate withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint); + } + + /** + * 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.WithIgnoreMissingVnetServiceEndpoint { + } + } + /** + * The template for a VirtualNetworkRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIgnoreMissingVnetServiceEndpoint { + } + + /** + * Grouping of VirtualNetworkRule update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualnetworkrule update allowing to specify IgnoreMissingVnetServiceEndpoint. + */ + interface WithIgnoreMissingVnetServiceEndpoint { + /** + * Specifies ignoreMissingVnetServiceEndpoint. + */ + Update withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint); + } + + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRuleState.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRuleState.java new file mode 100644 index 0000000000000..dc01fb003a1f1 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRuleState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VirtualNetworkRuleState. + */ +public final class VirtualNetworkRuleState extends ExpandableStringEnum { + /** Static value Initializing for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState INITIALIZING = fromString("Initializing"); + + /** Static value InProgress for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState IN_PROGRESS = fromString("InProgress"); + + /** Static value Ready for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState READY = fromString("Ready"); + + /** Static value Deleting for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState DELETING = fromString("Deleting"); + + /** Static value Unknown for VirtualNetworkRuleState. */ + public static final VirtualNetworkRuleState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a VirtualNetworkRuleState from its string representation. + * @param name a name to look for + * @return the corresponding VirtualNetworkRuleState + */ + @JsonCreator + public static VirtualNetworkRuleState fromString(String name) { + return fromString(name, VirtualNetworkRuleState.class); + } + + /** + * @return known VirtualNetworkRuleState values + */ + public static Collection values() { + return values(VirtualNetworkRuleState.class); + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRules.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRules.java new file mode 100644 index 0000000000000..b189fc33fa8b5 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/VirtualNetworkRules.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.implementation.VirtualNetworkRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkRules. + */ +public interface VirtualNetworkRules extends SupportsCreating, HasInner { + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName); + + /** + * Gets a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName); + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/CheckNameAvailabilitysImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/CheckNameAvailabilitysImpl.java new file mode 100644 index 0000000000000..7a8e1aa14050b --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/CheckNameAvailabilitysImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.CheckNameAvailabilitys; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.NameAvailability; +import com.microsoft.azure.management.mariadb.v2018_06_01.NameAvailabilityRequest; + +class CheckNameAvailabilitysImpl extends WrapperImpl implements CheckNameAvailabilitys { + private final DBforMariaDBManager manager; + + CheckNameAvailabilitysImpl(DBforMariaDBManager manager) { + super(manager.inner().checkNameAvailabilitys()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable executeAsync(NameAvailabilityRequest nameAvailabilityRequest) { + CheckNameAvailabilitysInner client = this.inner(); + return client.executeAsync(nameAvailabilityRequest) + .map(new Func1() { + @Override + public NameAvailability call(NameAvailabilityInner inner) { + return new NameAvailabilityImpl(inner, manager()); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/CheckNameAvailabilitysInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/CheckNameAvailabilitysInner.java new file mode 100644 index 0000000000000..626188cd96527 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/CheckNameAvailabilitysInner.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.mariadb.v2018_06_01.NameAvailabilityRequest; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +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; + +/** + * An instance of this class provides access to all the operations defined + * in CheckNameAvailabilitys. + */ +public class CheckNameAvailabilitysInner { + /** The Retrofit service to perform REST calls. */ + private CheckNameAvailabilitysService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of CheckNameAvailabilitysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CheckNameAvailabilitysInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(CheckNameAvailabilitysService.class); + this.client = client; + } + + /** + * The interface defining all the services for CheckNameAvailabilitys to be + * used by Retrofit to perform actually REST calls. + */ + interface CheckNameAvailabilitysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.CheckNameAvailabilitys execute" }) + @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); + + } + + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @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 NameAvailabilityInner object if successful. + */ + public NameAvailabilityInner execute(NameAvailabilityRequest nameAvailabilityRequest) { + return executeWithServiceResponseAsync(nameAvailabilityRequest).toBlocking().single().body(); + } + + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @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 executeAsync(NameAvailabilityRequest nameAvailabilityRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeWithServiceResponseAsync(nameAvailabilityRequest), serviceCallback); + } + + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable executeAsync(NameAvailabilityRequest nameAvailabilityRequest) { + return executeWithServiceResponseAsync(nameAvailabilityRequest).map(new Func1, NameAvailabilityInner>() { + @Override + public NameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the availability of name for resource. + * + * @param nameAvailabilityRequest The required parameters for checking if resource name is available. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NameAvailabilityInner object + */ + public Observable> executeWithServiceResponseAsync(NameAvailabilityRequest nameAvailabilityRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (nameAvailabilityRequest == null) { + throw new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null."); + } + Validator.validate(nameAvailabilityRequest); + return service.execute(this.client.subscriptionId(), this.client.apiVersion(), nameAvailabilityRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = executeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse executeDelegate(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/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationImpl.java new file mode 100644 index 0000000000000..0883bdaa4bbaf --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationImpl.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.Configuration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class ConfigurationImpl extends CreatableUpdatableImpl implements Configuration, Configuration.Definition, Configuration.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String configurationName; + + ConfigurationImpl(String name, DBforMariaDBManager manager) { + super(name, new ConfigurationInner()); + this.manager = manager; + // Set resource name + this.configurationName = name; + // + } + + ConfigurationImpl(ConfigurationInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.configurationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.configurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "configurations"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ConfigurationsInner client = this.manager().inner().configurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.configurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ConfigurationsInner client = this.manager().inner().configurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.configurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ConfigurationsInner client = this.manager().inner().configurations(); + return client.getAsync(this.resourceGroupName, this.serverName, this.configurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String allowedValues() { + return this.inner().allowedValues(); + } + + @Override + public String dataType() { + return this.inner().dataType(); + } + + @Override + public String defaultValue() { + return this.inner().defaultValue(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String source() { + return this.inner().source(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String value() { + return this.inner().value(); + } + + @Override + public ConfigurationImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public ConfigurationImpl withSource(String source) { + this.inner().withSource(source); + return this; + } + + @Override + public ConfigurationImpl withValue(String value) { + this.inner().withValue(value); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationInner.java new file mode 100644 index 0000000000000..702a867ad2391 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationInner.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a Configuration. + */ +@JsonFlatten +public class ConfigurationInner extends ProxyResource { + /** + * Value of the configuration. + */ + @JsonProperty(value = "properties.value") + private String value; + + /** + * Description of the configuration. + */ + @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Default value of the configuration. + */ + @JsonProperty(value = "properties.defaultValue", access = JsonProperty.Access.WRITE_ONLY) + private String defaultValue; + + /** + * Data type of the configuration. + */ + @JsonProperty(value = "properties.dataType", access = JsonProperty.Access.WRITE_ONLY) + private String dataType; + + /** + * Allowed values of the configuration. + */ + @JsonProperty(value = "properties.allowedValues", access = JsonProperty.Access.WRITE_ONLY) + private String allowedValues; + + /** + * Source of the configuration. + */ + @JsonProperty(value = "properties.source") + private String source; + + /** + * Get value of the configuration. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set value of the configuration. + * + * @param value the value value to set + * @return the ConfigurationInner object itself. + */ + public ConfigurationInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Get description of the configuration. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get default value of the configuration. + * + * @return the defaultValue value + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Get data type of the configuration. + * + * @return the dataType value + */ + public String dataType() { + return this.dataType; + } + + /** + * Get allowed values of the configuration. + * + * @return the allowedValues value + */ + public String allowedValues() { + return this.allowedValues; + } + + /** + * Get source of the configuration. + * + * @return the source value + */ + public String source() { + return this.source; + } + + /** + * Set source of the configuration. + * + * @param source the source value to set + * @return the ConfigurationInner object itself. + */ + public ConfigurationInner withSource(String source) { + this.source = source; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsImpl.java new file mode 100644 index 0000000000000..1db30895624a8 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsImpl.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.Configurations; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01.Configuration; + +class ConfigurationsImpl extends WrapperImpl implements Configurations { + private final DBforMariaDBManager manager; + + ConfigurationsImpl(DBforMariaDBManager manager) { + super(manager.inner().configurations()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public ConfigurationImpl define(String name) { + return wrapModel(name); + } + + private ConfigurationImpl wrapModel(ConfigurationInner inner) { + return new ConfigurationImpl(inner, manager()); + } + + private ConfigurationImpl wrapModel(String name) { + return new ConfigurationImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + ConfigurationsInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Configuration call(ConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String configurationName) { + ConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, configurationName) + .map(new Func1() { + @Override + public Configuration call(ConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsInner.java new file mode 100644 index 0000000000000..8596165868ddc --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ConfigurationsInner.java @@ -0,0 +1,446 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import 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.PUT; +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 Configurations. + */ +public class ConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private ConfigurationsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConfigurationsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(ConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Configurations to be + * used by Retrofit to perform actually REST calls. + */ + interface ConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.Configurations createOrUpdate" }) + @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.v2018_06_01.Configurations beginCreateOrUpdate" }) + @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.v2018_06_01.Configurations get" }) + @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.v2018_06_01.Configurations listByServer" }) + @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); + + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @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 ConfigurationInner object if successful. + */ + public ConfigurationInner createOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters).toBlocking().last().body(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @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 configurationName, ConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters), serviceCallback); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters).map(new Func1, ConfigurationInner>() { + @Override + public ConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String configurationName, ConfigurationInner 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 (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @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 ConfigurationInner object if successful. + */ + public ConfigurationInner beginCreateOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters).toBlocking().single().body(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @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 configurationName, ConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters), serviceCallback); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters).map(new Func1, ConfigurationInner>() { + @Override + public ConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String configurationName, ConfigurationInner 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 (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, configurationName, this.client.apiVersion(), parameters, 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); + } + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @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 ConfigurationInner object if successful. + */ + public ConfigurationInner get(String resourceGroupName, String serverName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, configurationName).toBlocking().single().body(); + } + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String configurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, configurationName), serviceCallback); + } + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, configurationName).map(new Func1, ConfigurationInner>() { + @Override + public ConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String configurationName) { + 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 (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 List<ConfigurationInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConfigurationInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ConfigurationInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DBforMariaDBManager.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DBforMariaDBManager.java new file mode 100644 index 0000000000000..8701b535b4fb0 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DBforMariaDBManager.java @@ -0,0 +1,219 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.mariadb.v2018_06_01.Servers; +import com.microsoft.azure.management.mariadb.v2018_06_01.Replicas; +import com.microsoft.azure.management.mariadb.v2018_06_01.FirewallRules; +import com.microsoft.azure.management.mariadb.v2018_06_01.VirtualNetworkRules; +import com.microsoft.azure.management.mariadb.v2018_06_01.Databases; +import com.microsoft.azure.management.mariadb.v2018_06_01.Configurations; +import com.microsoft.azure.management.mariadb.v2018_06_01.LogFiles; +import com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedPerformanceTiers; +import com.microsoft.azure.management.mariadb.v2018_06_01.CheckNameAvailabilitys; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicies; +import com.microsoft.azure.management.mariadb.v2018_06_01.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DBforMariaDB resource management. + */ +public final class DBforMariaDBManager extends ManagerCore { + private Servers servers; + private Replicas replicas; + private FirewallRules firewallRules; + private VirtualNetworkRules virtualNetworkRules; + private Databases databases; + private Configurations configurations; + private LogFiles logFiles; + private LocationBasedPerformanceTiers locationBasedPerformanceTiers; + private CheckNameAvailabilitys checkNameAvailabilitys; + private ServerSecurityAlertPolicies serverSecurityAlertPolicies; + private Operations operations; + /** + * Get a Configurable instance that can be used to create DBforMariaDBManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DBforMariaDBManager.ConfigurableImpl(); + } + /** + * Creates an instance of DBforMariaDBManager that exposes DBforMariaDB resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DBforMariaDBManager + */ + public static DBforMariaDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DBforMariaDBManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DBforMariaDBManager that exposes DBforMariaDB resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DBforMariaDBManager + */ + public static DBforMariaDBManager authenticate(RestClient restClient, String subscriptionId) { + return new DBforMariaDBManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DBforMariaDBManager that exposes DBforMariaDB management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DBforMariaDB management API entry points that work across subscriptions + */ + DBforMariaDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Servers. + */ + public Servers servers() { + if (this.servers == null) { + this.servers = new ServersImpl(this); + } + return this.servers; + } + + /** + * @return Entry point to manage Replicas. + */ + public Replicas replicas() { + if (this.replicas == null) { + this.replicas = new ReplicasImpl(this); + } + return this.replicas; + } + + /** + * @return Entry point to manage FirewallRules. + */ + public FirewallRules firewallRules() { + if (this.firewallRules == null) { + this.firewallRules = new FirewallRulesImpl(this); + } + return this.firewallRules; + } + + /** + * @return Entry point to manage VirtualNetworkRules. + */ + public VirtualNetworkRules virtualNetworkRules() { + if (this.virtualNetworkRules == null) { + this.virtualNetworkRules = new VirtualNetworkRulesImpl(this); + } + return this.virtualNetworkRules; + } + + /** + * @return Entry point to manage Databases. + */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(this); + } + return this.databases; + } + + /** + * @return Entry point to manage Configurations. + */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(this); + } + return this.configurations; + } + + /** + * @return Entry point to manage LogFiles. + */ + public LogFiles logFiles() { + if (this.logFiles == null) { + this.logFiles = new LogFilesImpl(this); + } + return this.logFiles; + } + + /** + * @return Entry point to manage LocationBasedPerformanceTiers. + */ + public LocationBasedPerformanceTiers locationBasedPerformanceTiers() { + if (this.locationBasedPerformanceTiers == null) { + this.locationBasedPerformanceTiers = new LocationBasedPerformanceTiersImpl(this); + } + return this.locationBasedPerformanceTiers; + } + + /** + * @return Entry point to manage CheckNameAvailabilitys. + */ + public CheckNameAvailabilitys checkNameAvailabilitys() { + if (this.checkNameAvailabilitys == null) { + this.checkNameAvailabilitys = new CheckNameAvailabilitysImpl(this); + } + return this.checkNameAvailabilitys; + } + + /** + * @return Entry point to manage ServerSecurityAlertPolicies. + */ + public ServerSecurityAlertPolicies serverSecurityAlertPolicies() { + if (this.serverSecurityAlertPolicies == null) { + this.serverSecurityAlertPolicies = new ServerSecurityAlertPoliciesImpl(this); + } + return this.serverSecurityAlertPolicies; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DBforMariaDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DBforMariaDBManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DBforMariaDBManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new MariaDBManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabaseImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabaseImpl.java new file mode 100644 index 0000000000000..1dbee668afa84 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabaseImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.Database; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class DatabaseImpl extends CreatableUpdatableImpl implements Database, Database.Definition, Database.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String databaseName; + + DatabaseImpl(String name, DBforMariaDBManager manager) { + super(name, new DatabaseInner()); + this.manager = manager; + // Set resource name + this.databaseName = name; + // + } + + DatabaseImpl(DatabaseInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.databaseName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.databaseName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.databaseName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.getAsync(this.resourceGroupName, this.serverName, this.databaseName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String charset() { + return this.inner().charset(); + } + + @Override + public String collation() { + return this.inner().collation(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DatabaseImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public DatabaseImpl withCharset(String charset) { + this.inner().withCharset(charset); + return this; + } + + @Override + public DatabaseImpl withCollation(String collation) { + this.inner().withCollation(collation); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabaseInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabaseInner.java new file mode 100644 index 0000000000000..5371750d9f69f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabaseInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a Database. + */ +@JsonFlatten +public class DatabaseInner extends ProxyResource { + /** + * The charset of the database. + */ + @JsonProperty(value = "properties.charset") + private String charset; + + /** + * The collation of the database. + */ + @JsonProperty(value = "properties.collation") + private String collation; + + /** + * Get the charset of the database. + * + * @return the charset value + */ + public String charset() { + return this.charset; + } + + /** + * Set the charset of the database. + * + * @param charset the charset value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withCharset(String charset) { + this.charset = charset; + return this; + } + + /** + * Get the collation of the database. + * + * @return the collation value + */ + public String collation() { + return this.collation; + } + + /** + * Set the collation of the database. + * + * @param collation the collation value to set + * @return the DatabaseInner object itself. + */ + public DatabaseInner withCollation(String collation) { + this.collation = collation; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesImpl.java new file mode 100644 index 0000000000000..4385c8fb1c260 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.Databases; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01.Database; + +class DatabasesImpl extends WrapperImpl implements Databases { + private final DBforMariaDBManager manager; + + DatabasesImpl(DBforMariaDBManager manager) { + super(manager.inner().databases()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public DatabaseImpl define(String name) { + return wrapModel(name); + } + + private DatabaseImpl wrapModel(DatabaseInner inner) { + return new DatabaseImpl(inner, manager()); + } + + private DatabaseImpl wrapModel(String name) { + return new DatabaseImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + DatabasesInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Database call(DatabaseInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String databaseName) { + DatabasesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, databaseName) + .map(new Func1() { + @Override + public Database call(DatabaseInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serverName, String databaseName) { + DatabasesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serverName, databaseName).toCompletable(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesInner.java new file mode 100644 index 0000000000000..ea418c9d00242 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/DatabasesInner.java @@ -0,0 +1,625 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import 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.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +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 Databases. + */ +public class DatabasesInner { + /** The Retrofit service to perform REST calls. */ + private DatabasesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of DatabasesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatabasesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(DatabasesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Databases to be + * used by Retrofit to perform actually REST calls. + */ + interface DatabasesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.Databases createOrUpdate" }) + @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.v2018_06_01.Databases beginCreateOrUpdate" }) + @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.v2018_06_01.Databases delete" }) + @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.v2018_06_01.Databases beginDelete" }) + @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.v2018_06_01.Databases get" }) + @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.v2018_06_01.Databases listByServer" }) + @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); + + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a 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 + * @return the DatabaseInner object if successful. + */ + public DatabaseInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a 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 createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a 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 + * @return the DatabaseInner object if successful. + */ + public DatabaseInner beginCreateOrUpdate(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a 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 beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters), serviceCallback); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new database or updates an existing database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName, DatabaseInner 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), parameters, 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(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 delete(String resourceGroupName, String serverName, String databaseName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().last().body(); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 deleteAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName, String databaseName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 beginDelete(String resourceGroupName, String serverName, String databaseName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 beginDeleteAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String databaseName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 + * @return the DatabaseInner object if successful. + */ + public DatabaseInner get(String resourceGroupName, String serverName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).toBlocking().single().body(); + } + + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @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 getAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback); + } + + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a database. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 List<DatabaseInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabaseInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the databases in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabaseInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRuleImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRuleImpl.java new file mode 100644 index 0000000000000..cc1f4b1ccd9eb --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRuleImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.FirewallRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class FirewallRuleImpl extends CreatableUpdatableImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String firewallRuleName; + + FirewallRuleImpl(String name, DBforMariaDBManager manager) { + super(name, new FirewallRuleInner()); + this.manager = manager; + // Set resource name + this.firewallRuleName = name; + // + } + + FirewallRuleImpl(FirewallRuleInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.firewallRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.firewallRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "firewallRules"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.firewallRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.firewallRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + FirewallRulesInner client = this.manager().inner().firewallRules(); + return client.getAsync(this.resourceGroupName, this.serverName, this.firewallRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String endIpAddress() { + return this.inner().endIpAddress(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String startIpAddress() { + return this.inner().startIpAddress(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public FirewallRuleImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public FirewallRuleImpl withEndIpAddress(String endIpAddress) { + this.inner().withEndIpAddress(endIpAddress); + return this; + } + + @Override + public FirewallRuleImpl withStartIpAddress(String startIpAddress) { + this.inner().withStartIpAddress(startIpAddress); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRuleInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRuleInner.java new file mode 100644 index 0000000000000..ce280b3dd7cb4 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRuleInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a server firewall rule. + */ +@JsonFlatten +public class FirewallRuleInner extends ProxyResource { + /** + * The start IP address of the server firewall rule. Must be IPv4 format. + */ + @JsonProperty(value = "properties.startIpAddress", required = true) + private String startIpAddress; + + /** + * The end IP address of the server firewall rule. Must be IPv4 format. + */ + @JsonProperty(value = "properties.endIpAddress", required = true) + private String endIpAddress; + + /** + * Get the start IP address of the server firewall rule. Must be IPv4 format. + * + * @return the startIpAddress value + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the start IP address of the server firewall rule. Must be IPv4 format. + * + * @param startIpAddress the startIpAddress value to set + * @return the FirewallRuleInner object itself. + */ + public FirewallRuleInner withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the end IP address of the server firewall rule. Must be IPv4 format. + * + * @return the endIpAddress value + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the end IP address of the server firewall rule. Must be IPv4 format. + * + * @param endIpAddress the endIpAddress value to set + * @return the FirewallRuleInner object itself. + */ + public FirewallRuleInner withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesImpl.java new file mode 100644 index 0000000000000..83440894b48b9 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.FirewallRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01.FirewallRule; + +class FirewallRulesImpl extends WrapperImpl implements FirewallRules { + private final DBforMariaDBManager manager; + + FirewallRulesImpl(DBforMariaDBManager manager) { + super(manager.inner().firewallRules()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public FirewallRuleImpl define(String name) { + return wrapModel(name); + } + + private FirewallRuleImpl wrapModel(FirewallRuleInner inner) { + return new FirewallRuleImpl(inner, manager()); + } + + private FirewallRuleImpl wrapModel(String name) { + return new FirewallRuleImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + FirewallRulesInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String firewallRuleName) { + FirewallRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, firewallRuleName) + .map(new Func1() { + @Override + public FirewallRule call(FirewallRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serverName, String firewallRuleName) { + FirewallRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serverName, firewallRuleName).toCompletable(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesInner.java new file mode 100644 index 0000000000000..4f271ecf547c3 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/FirewallRulesInner.java @@ -0,0 +1,625 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import 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.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +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 FirewallRules. + */ +public class FirewallRulesInner { + /** The Retrofit service to perform REST calls. */ + private FirewallRulesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of FirewallRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FirewallRulesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(FirewallRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for FirewallRules to be + * used by Retrofit to perform actually REST calls. + */ + interface FirewallRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.FirewallRules createOrUpdate" }) + @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.v2018_06_01.FirewallRules beginCreateOrUpdate" }) + @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.v2018_06_01.FirewallRules delete" }) + @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.v2018_06_01.FirewallRules beginDelete" }) + @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.v2018_06_01.FirewallRules get" }) + @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.v2018_06_01.FirewallRules listByServer" }) + @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); + + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @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 FirewallRuleInner object if successful. + */ + public FirewallRuleInner createOrUpdate(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @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 firewallRuleName, FirewallRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters), serviceCallback); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @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 FirewallRuleInner object if successful. + */ + public FirewallRuleInner beginCreateOrUpdate(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @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 firewallRuleName, FirewallRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters), serviceCallback); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName, parameters).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName, FirewallRuleInner 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), parameters, 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(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @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 firewallRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).toBlocking().last().body(); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serverName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName), serviceCallback); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName, String firewallRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName) { + 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @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 firewallRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serverName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName), serviceCallback); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String firewallRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName) { + 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @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 FirewallRuleInner object if successful. + */ + public FirewallRuleInner get(String resourceGroupName, String serverName, String firewallRuleName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).toBlocking().single().body(); + } + + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String firewallRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName), serviceCallback); + } + + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String firewallRuleName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, firewallRuleName).map(new Func1, FirewallRuleInner>() { + @Override + public FirewallRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a server firewall rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FirewallRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String firewallRuleName) { + 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 (firewallRuleName == null) { + throw new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, serverName, firewallRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 List<FirewallRuleInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FirewallRuleInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the firewall rules in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FirewallRuleInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/IdParsingUtils.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..274465c9d3914 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersImpl.java new file mode 100644 index 0000000000000..3c773c6edd804 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersImpl.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. + * abc + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedPerformanceTiers; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01.PerformanceTierProperties; + +class LocationBasedPerformanceTiersImpl extends WrapperImpl implements LocationBasedPerformanceTiers { + private final DBforMariaDBManager manager; + + LocationBasedPerformanceTiersImpl(DBforMariaDBManager manager) { + super(manager.inner().locationBasedPerformanceTiers()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + private PerformanceTierPropertiesImpl wrapPerformanceTierPropertiesModel(PerformanceTierPropertiesInner inner) { + return new PerformanceTierPropertiesImpl(inner, manager()); + } + + @Override + public Observable listAsync(String locationName) { + LocationBasedPerformanceTiersInner client = this.inner(); + return client.listAsync(locationName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PerformanceTierProperties call(PerformanceTierPropertiesInner inner) { + return wrapPerformanceTierPropertiesModel(inner); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersInner.java new file mode 100644 index 0000000000000..e1b1927344fc4 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LocationBasedPerformanceTiersInner.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LocationBasedPerformanceTiers. + */ +public class LocationBasedPerformanceTiersInner { + /** The Retrofit service to perform REST calls. */ + private LocationBasedPerformanceTiersService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of LocationBasedPerformanceTiersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationBasedPerformanceTiersInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(LocationBasedPerformanceTiersService.class); + this.client = client; + } + + /** + * The interface defining all the services for LocationBasedPerformanceTiers to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationBasedPerformanceTiersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.LocationBasedPerformanceTiers list" }) + @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); + + } + + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @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 List<PerformanceTierPropertiesInner> object if successful. + */ + public List list(String locationName) { + return listWithServiceResponseAsync(locationName).toBlocking().single().body(); + } + + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @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(String locationName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(locationName), serviceCallback); + } + + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PerformanceTierPropertiesInner> object + */ + public Observable> listAsync(String locationName) { + return listWithServiceResponseAsync(locationName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the performance tiers at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PerformanceTierPropertiesInner> object + */ + public Observable>> listWithServiceResponseAsync(String locationName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), locationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFileImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFileImpl.java new file mode 100644 index 0000000000000..9dd1a38735f45 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFileImpl.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.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.LogFile; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class LogFileImpl extends WrapperImpl implements LogFile { + private final DBforMariaDBManager manager; + + LogFileImpl(LogFileInner inner, DBforMariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + + + @Override + public DateTime createdTime() { + return this.inner().createdTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String logFileType() { + return this.inner().logFileType(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long sizeInKB() { + return this.inner().sizeInKB(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String url() { + return this.inner().url(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFileInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFileInner.java new file mode 100644 index 0000000000000..4cf5b63763b45 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFileInner.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a log file. + */ +@JsonFlatten +public class LogFileInner extends ProxyResource { + /** + * Size of the log file. + */ + @JsonProperty(value = "properties.sizeInKB") + private Long sizeInKB; + + /** + * Creation timestamp of the log file. + */ + @JsonProperty(value = "properties.createdTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdTime; + + /** + * Last modified timestamp of the log file. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Type of the log file. + */ + @JsonProperty(value = "properties.type") + private String logFileType; + + /** + * The url to download the log file from. + */ + @JsonProperty(value = "properties.url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /** + * Get size of the log file. + * + * @return the sizeInKB value + */ + public Long sizeInKB() { + return this.sizeInKB; + } + + /** + * Set size of the log file. + * + * @param sizeInKB the sizeInKB value to set + * @return the LogFileInner object itself. + */ + public LogFileInner withSizeInKB(Long sizeInKB) { + this.sizeInKB = sizeInKB; + return this; + } + + /** + * Get creation timestamp of the log file. + * + * @return the createdTime value + */ + public DateTime createdTime() { + return this.createdTime; + } + + /** + * Get last modified timestamp of the log file. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get type of the log file. + * + * @return the logFileType value + */ + public String logFileType() { + return this.logFileType; + } + + /** + * Set type of the log file. + * + * @param logFileType the logFileType value to set + * @return the LogFileInner object itself. + */ + public LogFileInner withLogFileType(String logFileType) { + this.logFileType = logFileType; + return this; + } + + /** + * Get the url to download the log file from. + * + * @return the url value + */ + public String url() { + return this.url; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesImpl.java new file mode 100644 index 0000000000000..dfe86876eeb2f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.LogFiles; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01.LogFile; + +class LogFilesImpl extends WrapperImpl implements LogFiles { + private final DBforMariaDBManager manager; + + LogFilesImpl(DBforMariaDBManager manager) { + super(manager.inner().logFiles()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + private LogFileImpl wrapModel(LogFileInner inner) { + return new LogFileImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + LogFilesInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public LogFile call(LogFileInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesInner.java new file mode 100644 index 0000000000000..c64ff696226d1 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/LogFilesInner.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LogFiles. + */ +public class LogFilesInner { + /** The Retrofit service to perform REST calls. */ + private LogFilesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of LogFilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LogFilesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(LogFilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LogFiles to be + * used by Retrofit to perform actually REST calls. + */ + interface LogFilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.LogFiles listByServer" }) + @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); + + } + + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 List<LogFileInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LogFileInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the log files in a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LogFileInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManagementClientImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManagementClientImpl.java new file mode 100644 index 0000000000000..6b500b2b6f19f --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/MariaDBManagementClientImpl.java @@ -0,0 +1,336 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the MariaDBManagementClientImpl class. + */ +public class MariaDBManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription ID that identifies an Azure subscription. */ + private String subscriptionId; + + /** + * Gets The subscription ID that identifies an Azure subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription ID that identifies an Azure subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MariaDBManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version to use for the request. */ + private String apiVersion; + + /** + * Gets The API version to use for the request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public MariaDBManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public MariaDBManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public MariaDBManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ServersInner object to access its operations. + */ + private ServersInner servers; + + /** + * Gets the ServersInner object to access its operations. + * @return the ServersInner object. + */ + public ServersInner servers() { + return this.servers; + } + + /** + * The ReplicasInner object to access its operations. + */ + private ReplicasInner replicas; + + /** + * Gets the ReplicasInner object to access its operations. + * @return the ReplicasInner object. + */ + public ReplicasInner replicas() { + return this.replicas; + } + + /** + * The FirewallRulesInner object to access its operations. + */ + private FirewallRulesInner firewallRules; + + /** + * Gets the FirewallRulesInner object to access its operations. + * @return the FirewallRulesInner object. + */ + public FirewallRulesInner firewallRules() { + return this.firewallRules; + } + + /** + * The VirtualNetworkRulesInner object to access its operations. + */ + private VirtualNetworkRulesInner virtualNetworkRules; + + /** + * Gets the VirtualNetworkRulesInner object to access its operations. + * @return the VirtualNetworkRulesInner object. + */ + public VirtualNetworkRulesInner virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * The DatabasesInner object to access its operations. + */ + private DatabasesInner databases; + + /** + * Gets the DatabasesInner object to access its operations. + * @return the DatabasesInner object. + */ + public DatabasesInner databases() { + return this.databases; + } + + /** + * The ConfigurationsInner object to access its operations. + */ + private ConfigurationsInner configurations; + + /** + * Gets the ConfigurationsInner object to access its operations. + * @return the ConfigurationsInner object. + */ + public ConfigurationsInner configurations() { + return this.configurations; + } + + /** + * The LogFilesInner object to access its operations. + */ + private LogFilesInner logFiles; + + /** + * Gets the LogFilesInner object to access its operations. + * @return the LogFilesInner object. + */ + public LogFilesInner logFiles() { + return this.logFiles; + } + + /** + * The LocationBasedPerformanceTiersInner object to access its operations. + */ + private LocationBasedPerformanceTiersInner locationBasedPerformanceTiers; + + /** + * Gets the LocationBasedPerformanceTiersInner object to access its operations. + * @return the LocationBasedPerformanceTiersInner object. + */ + public LocationBasedPerformanceTiersInner locationBasedPerformanceTiers() { + return this.locationBasedPerformanceTiers; + } + + /** + * The CheckNameAvailabilitysInner object to access its operations. + */ + private CheckNameAvailabilitysInner checkNameAvailabilitys; + + /** + * Gets the CheckNameAvailabilitysInner object to access its operations. + * @return the CheckNameAvailabilitysInner object. + */ + public CheckNameAvailabilitysInner checkNameAvailabilitys() { + return this.checkNameAvailabilitys; + } + + /** + * The ServerSecurityAlertPoliciesInner object to access its operations. + */ + private ServerSecurityAlertPoliciesInner serverSecurityAlertPolicies; + + /** + * Gets the ServerSecurityAlertPoliciesInner object to access its operations. + * @return the ServerSecurityAlertPoliciesInner object. + */ + public ServerSecurityAlertPoliciesInner serverSecurityAlertPolicies() { + return this.serverSecurityAlertPolicies; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of MariaDBManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public MariaDBManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of MariaDBManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MariaDBManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MariaDBManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public MariaDBManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-06-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.servers = new ServersInner(restClient().retrofit(), this); + this.replicas = new ReplicasInner(restClient().retrofit(), this); + this.firewallRules = new FirewallRulesInner(restClient().retrofit(), this); + this.virtualNetworkRules = new VirtualNetworkRulesInner(restClient().retrofit(), this); + this.databases = new DatabasesInner(restClient().retrofit(), this); + this.configurations = new ConfigurationsInner(restClient().retrofit(), this); + this.logFiles = new LogFilesInner(restClient().retrofit(), this); + this.locationBasedPerformanceTiers = new LocationBasedPerformanceTiersInner(restClient().retrofit(), this); + this.checkNameAvailabilitys = new CheckNameAvailabilitysInner(restClient().retrofit(), this); + this.serverSecurityAlertPolicies = new ServerSecurityAlertPoliciesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "MariaDBManagementClient", "2018-06-01"); + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/NameAvailabilityImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/NameAvailabilityImpl.java new file mode 100644 index 0000000000000..d36d4eaea3b5c --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/NameAvailabilityImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.NameAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class NameAvailabilityImpl extends WrapperImpl implements NameAvailability { + private final DBforMariaDBManager manager; + NameAvailabilityImpl(NameAvailabilityInner inner, DBforMariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/NameAvailabilityInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/NameAvailabilityInner.java new file mode 100644 index 0000000000000..aee1babc3c1a0 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/NameAvailabilityInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a resource name availability. + */ +public class NameAvailabilityInner { + /** + * Error Message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Indicates whether the resource name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * Reason for name being unavailable. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Get error Message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error Message. + * + * @param message the message value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get indicates whether the resource name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set indicates whether the resource name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get reason for name being unavailable. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set reason for name being unavailable. + * + * @param reason the reason value to set + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..a7b459e975044 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationInner.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.OperationDisplay; +import com.microsoft.azure.management.mariadb.v2018_06_01.OperationOrigin; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API operation definition. + */ +public class OperationInner { + /** + * The name of the operation being performed on this particular object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The localized display information for this particular operation or + * action. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * The intended executor of the operation. Possible values include: + * 'NotSpecified', 'user', 'system'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private OperationOrigin origin; + + /** + * Additional descriptions for the operation. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private Map properties; + + /** + * Get the name of the operation being performed on this particular object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the localized display information for this particular operation or action. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the intended executor of the operation. Possible values include: 'NotSpecified', 'user', 'system'. + * + * @return the origin value + */ + public OperationOrigin origin() { + return this.origin; + } + + /** + * Get additional descriptions for the operation. + * + * @return the properties value + */ + public Map properties() { + return this.properties; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationListResultImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationListResultImpl.java new file mode 100644 index 0000000000000..c8706258f711e --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.OperationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class OperationListResultImpl extends WrapperImpl implements OperationListResult { + private final DBforMariaDBManager manager; + OperationListResultImpl(OperationListResultInner inner, DBforMariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationListResultInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationListResultInner.java new file mode 100644 index 0000000000000..5ccdfd182b914 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationListResultInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of resource provider operations. + */ +public class OperationListResultInner { + /** + * The list of resource provider operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of resource provider operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of resource provider operations. + * + * @param value the value value to set + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationsImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..5bae622b53eb3 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.OperationListResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DBforMariaDBManager manager; + + OperationsImpl(DBforMariaDBManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationListResult call(OperationListResultInner inner) { + return new OperationListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationsInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..7a43664597620 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.Operations list" }) + @GET("providers/Microsoft.DBforMariaDB/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available REST API operations. + * + * @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 OperationListResultInner object if successful. + */ + public OperationListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available REST API operations. + * + * @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 ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListResultInner>() { + @Override + public OperationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(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/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PageImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..6ad9dbbdf64d9 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PageImpl1.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PageImpl1.java new file mode 100644 index 0000000000000..e2acec8566e76 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PerformanceTierPropertiesImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PerformanceTierPropertiesImpl.java new file mode 100644 index 0000000000000..0befc0a4b3123 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PerformanceTierPropertiesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.PerformanceTierProperties; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01.PerformanceTierServiceLevelObjectives; + +class PerformanceTierPropertiesImpl extends WrapperImpl implements PerformanceTierProperties { + private final DBforMariaDBManager manager; + + PerformanceTierPropertiesImpl(PerformanceTierPropertiesInner inner, DBforMariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List serviceLevelObjectives() { + return this.inner().serviceLevelObjectives(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PerformanceTierPropertiesInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PerformanceTierPropertiesInner.java new file mode 100644 index 0000000000000..192d885252004 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/PerformanceTierPropertiesInner.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.v2018_06_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01.PerformanceTierServiceLevelObjectives; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Performance tier properties. + */ +public class PerformanceTierPropertiesInner { + /** + * ID of the performance tier. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Service level objectives associated with the performance tier. + */ + @JsonProperty(value = "serviceLevelObjectives") + private List serviceLevelObjectives; + + /** + * Get iD of the performance tier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the performance tier. + * + * @param id the id value to set + * @return the PerformanceTierPropertiesInner object itself. + */ + public PerformanceTierPropertiesInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get service level objectives associated with the performance tier. + * + * @return the serviceLevelObjectives value + */ + public List serviceLevelObjectives() { + return this.serviceLevelObjectives; + } + + /** + * Set service level objectives associated with the performance tier. + * + * @param serviceLevelObjectives the serviceLevelObjectives value to set + * @return the PerformanceTierPropertiesInner object itself. + */ + public PerformanceTierPropertiesInner withServiceLevelObjectives(List serviceLevelObjectives) { + this.serviceLevelObjectives = serviceLevelObjectives; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasImpl.java new file mode 100644 index 0000000000000..22bfd1ce3b845 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.Replicas; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerServer; + +class ReplicasImpl extends WrapperImpl implements Replicas { + private final DBforMariaDBManager manager; + + ReplicasImpl(DBforMariaDBManager manager) { + super(manager.inner().replicas()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + private ServerServerImpl wrapModel(ServerInner inner) { + return new ServerServerImpl(inner, manager()); + } + + @Override + public Observable listByServerAsync(String resourceGroupName, String serverName) { + ReplicasInner client = this.inner(); + return client.listByServerAsync(resourceGroupName, serverName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ServerServer call(ServerInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasInner.java new file mode 100644 index 0000000000000..ac99ba00bf786 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ReplicasInner.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Replicas. + */ +public class ReplicasInner { + /** The Retrofit service to perform REST calls. */ + private ReplicasService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of ReplicasInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ReplicasInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(ReplicasService.class); + this.client = client; + } + + /** + * The interface defining all the services for Replicas to be + * used by Retrofit to perform actually REST calls. + */ + interface ReplicasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.Replicas listByServer" }) + @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); + + } + + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 List<ServerInner> object if successful. + */ + public List listByServer(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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(String resourceGroupName, String serverName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByServerWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServerInner> object + */ + public Observable> listByServerAsync(String resourceGroupName, String serverName) { + return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the replicas for a given server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServerInner> object + */ + public Observable>> listByServerWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerImpl.java new file mode 100644 index 0000000000000..f8a3a0c99483e --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerImpl.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.Server; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerUpdateParameters; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerForCreate; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mariadb.v2018_06_01.Sku; +import com.microsoft.azure.management.mariadb.v2018_06_01.SslEnforcementEnum; +import com.microsoft.azure.management.mariadb.v2018_06_01.StorageProfile; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerState; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerVersion; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerPropertiesForCreate; +import rx.functions.Func1; + +class ServerImpl extends GroupableResourceCoreImpl implements Server, Server.Definition, Server.Update { + private ServerForCreate createParameter; + private ServerUpdateParameters updateParameter; + ServerImpl(String name, ServerInner inner, DBforMariaDBManager manager) { + super(name, inner, manager); + this.createParameter = new ServerForCreate(); + this.updateParameter = new ServerUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + ServersInner client = this.manager().inner().servers(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public ServerInner call(ServerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServersInner client = this.manager().inner().servers(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ServerInner call(ServerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServersInner client = this.manager().inner().servers(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new ServerForCreate(); + this.updateParameter = new ServerUpdateParameters(); + } + + @Override + public String administratorLogin() { + return this.inner().administratorLogin(); + } + + @Override + public DateTime earliestRestoreDate() { + return this.inner().earliestRestoreDate(); + } + + @Override + public String fullyQualifiedDomainName() { + return this.inner().fullyQualifiedDomainName(); + } + + @Override + public String masterServerId() { + return this.inner().masterServerId(); + } + + @Override + public Integer replicaCapacity() { + return this.inner().replicaCapacity(); + } + + @Override + public String replicationRole() { + return this.inner().replicationRole(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public SslEnforcementEnum sslEnforcement() { + return this.inner().sslEnforcement(); + } + + @Override + public StorageProfile storageProfile() { + return this.inner().storageProfile(); + } + + @Override + public ServerState userVisibleState() { + return this.inner().userVisibleState(); + } + + @Override + public ServerVersion version() { + return this.inner().version(); + } + + @Override + public ServerImpl withProperties(ServerPropertiesForCreate properties) { + this.createParameter.withProperties(properties); + return this; + } + + @Override + public ServerImpl withAdministratorLoginPassword(String administratorLoginPassword) { + this.updateParameter.withAdministratorLoginPassword(administratorLoginPassword); + return this; + } + + @Override + public ServerImpl withReplicationRole(String replicationRole) { + this.updateParameter.withReplicationRole(replicationRole); + return this; + } + + @Override + public ServerImpl withSslEnforcement(SslEnforcementEnum sslEnforcement) { + this.updateParameter.withSslEnforcement(sslEnforcement); + return this; + } + + @Override + public ServerImpl withStorageProfile(StorageProfile storageProfile) { + this.updateParameter.withStorageProfile(storageProfile); + return this; + } + + @Override + public ServerImpl withVersion(ServerVersion version) { + this.updateParameter.withVersion(version); + return this; + } + + @Override + public ServerImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerInner.java new file mode 100644 index 0000000000000..a8cd8e12d7b95 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerInner.java @@ -0,0 +1,315 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.Sku; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerVersion; +import com.microsoft.azure.management.mariadb.v2018_06_01.SslEnforcementEnum; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mariadb.v2018_06_01.StorageProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Represents a server. + */ +@JsonFlatten +public class ServerInner extends Resource { + /** + * The SKU (pricing tier) of the server. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The administrator's login name of a server. Can only be specified when + * the server is being created (and is required for creation). + */ + @JsonProperty(value = "properties.administratorLogin") + private String administratorLogin; + + /** + * Server version. Possible values include: '5.6', '5.7'. + */ + @JsonProperty(value = "properties.version") + private ServerVersion version; + + /** + * Enable ssl enforcement or not when connect to server. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.sslEnforcement") + private SslEnforcementEnum sslEnforcement; + + /** + * A state of a server that is visible to user. Possible values include: + * 'Ready', 'Dropping', 'Disabled'. + */ + @JsonProperty(value = "properties.userVisibleState") + private ServerState userVisibleState; + + /** + * The fully qualified domain name of a server. + */ + @JsonProperty(value = "properties.fullyQualifiedDomainName") + private String fullyQualifiedDomainName; + + /** + * Earliest restore point creation time (ISO8601 format). + */ + @JsonProperty(value = "properties.earliestRestoreDate") + private DateTime earliestRestoreDate; + + /** + * Storage profile of a server. + */ + @JsonProperty(value = "properties.storageProfile") + private StorageProfile storageProfile; + + /** + * The replication role of the server. + */ + @JsonProperty(value = "properties.replicationRole") + private String replicationRole; + + /** + * The master server id of a replica server. + */ + @JsonProperty(value = "properties.masterServerId") + private String masterServerId; + + /** + * The maximum number of replicas that a master server can have. + */ + @JsonProperty(value = "properties.replicaCapacity") + private Integer replicaCapacity; + + /** + * Get the SKU (pricing tier) of the server. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU (pricing tier) of the server. + * + * @param sku the sku value to set + * @return the ServerInner object itself. + */ + public ServerInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + * + * @return the administratorLogin value + */ + public String administratorLogin() { + return this.administratorLogin; + } + + /** + * Set the administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + * + * @param administratorLogin the administratorLogin value to set + * @return the ServerInner object itself. + */ + public ServerInner withAdministratorLogin(String administratorLogin) { + this.administratorLogin = administratorLogin; + return this; + } + + /** + * Get server version. Possible values include: '5.6', '5.7'. + * + * @return the version value + */ + public ServerVersion version() { + return this.version; + } + + /** + * Set server version. Possible values include: '5.6', '5.7'. + * + * @param version the version value to set + * @return the ServerInner object itself. + */ + public ServerInner withVersion(ServerVersion version) { + this.version = version; + return this; + } + + /** + * Get enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @return the sslEnforcement value + */ + public SslEnforcementEnum sslEnforcement() { + return this.sslEnforcement; + } + + /** + * Set enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled'. + * + * @param sslEnforcement the sslEnforcement value to set + * @return the ServerInner object itself. + */ + public ServerInner withSslEnforcement(SslEnforcementEnum sslEnforcement) { + this.sslEnforcement = sslEnforcement; + return this; + } + + /** + * Get a state of a server that is visible to user. Possible values include: 'Ready', 'Dropping', 'Disabled'. + * + * @return the userVisibleState value + */ + public ServerState userVisibleState() { + return this.userVisibleState; + } + + /** + * Set a state of a server that is visible to user. Possible values include: 'Ready', 'Dropping', 'Disabled'. + * + * @param userVisibleState the userVisibleState value to set + * @return the ServerInner object itself. + */ + public ServerInner withUserVisibleState(ServerState userVisibleState) { + this.userVisibleState = userVisibleState; + return this; + } + + /** + * Get the fully qualified domain name of a server. + * + * @return the fullyQualifiedDomainName value + */ + public String fullyQualifiedDomainName() { + return this.fullyQualifiedDomainName; + } + + /** + * Set the fully qualified domain name of a server. + * + * @param fullyQualifiedDomainName the fullyQualifiedDomainName value to set + * @return the ServerInner object itself. + */ + public ServerInner withFullyQualifiedDomainName(String fullyQualifiedDomainName) { + this.fullyQualifiedDomainName = fullyQualifiedDomainName; + return this; + } + + /** + * Get earliest restore point creation time (ISO8601 format). + * + * @return the earliestRestoreDate value + */ + public DateTime earliestRestoreDate() { + return this.earliestRestoreDate; + } + + /** + * Set earliest restore point creation time (ISO8601 format). + * + * @param earliestRestoreDate the earliestRestoreDate value to set + * @return the ServerInner object itself. + */ + public ServerInner withEarliestRestoreDate(DateTime earliestRestoreDate) { + this.earliestRestoreDate = earliestRestoreDate; + return this; + } + + /** + * Get storage profile of a server. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set storage profile of a server. + * + * @param storageProfile the storageProfile value to set + * @return the ServerInner object itself. + */ + public ServerInner withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the replication role of the server. + * + * @return the replicationRole value + */ + public String replicationRole() { + return this.replicationRole; + } + + /** + * Set the replication role of the server. + * + * @param replicationRole the replicationRole value to set + * @return the ServerInner object itself. + */ + public ServerInner withReplicationRole(String replicationRole) { + this.replicationRole = replicationRole; + return this; + } + + /** + * Get the master server id of a replica server. + * + * @return the masterServerId value + */ + public String masterServerId() { + return this.masterServerId; + } + + /** + * Set the master server id of a replica server. + * + * @param masterServerId the masterServerId value to set + * @return the ServerInner object itself. + */ + public ServerInner withMasterServerId(String masterServerId) { + this.masterServerId = masterServerId; + return this; + } + + /** + * Get the maximum number of replicas that a master server can have. + * + * @return the replicaCapacity value + */ + public Integer replicaCapacity() { + return this.replicaCapacity; + } + + /** + * Set the maximum number of replicas that a master server can have. + * + * @param replicaCapacity the replicaCapacity value to set + * @return the ServerInner object itself. + */ + public ServerInner withReplicaCapacity(Integer replicaCapacity) { + this.replicaCapacity = replicaCapacity; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesImpl.java new file mode 100644 index 0000000000000..922c2c2bafc2c --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicies; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicy; + +class ServerSecurityAlertPoliciesImpl extends WrapperImpl implements ServerSecurityAlertPolicies { + private final DBforMariaDBManager manager; + + ServerSecurityAlertPoliciesImpl(DBforMariaDBManager manager) { + super(manager.inner().serverSecurityAlertPolicies()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public ServerSecurityAlertPolicyImpl define(String name) { + return wrapModel(name); + } + + private ServerSecurityAlertPolicyImpl wrapModel(ServerSecurityAlertPolicyInner inner) { + return new ServerSecurityAlertPolicyImpl(inner, manager()); + } + + private ServerSecurityAlertPolicyImpl wrapModel(String name) { + return new ServerSecurityAlertPolicyImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName) { + ServerSecurityAlertPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName) + .map(new Func1() { + @Override + public ServerSecurityAlertPolicy call(ServerSecurityAlertPolicyInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesInner.java new file mode 100644 index 0000000000000..47a72d75a0ca9 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPoliciesInner.java @@ -0,0 +1,332 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +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.PUT; +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 ServerSecurityAlertPolicies. + */ +public class ServerSecurityAlertPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private ServerSecurityAlertPoliciesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of ServerSecurityAlertPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServerSecurityAlertPoliciesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(ServerSecurityAlertPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServerSecurityAlertPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ServerSecurityAlertPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("securityAlertPolicyName") String securityAlertPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("securityAlertPolicyName") String securityAlertPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServerSecurityAlertPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicies beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("serverName") String serverName, @Path("securityAlertPolicyName") String securityAlertPolicyName, @Path("subscriptionId") String subscriptionId, @Body ServerSecurityAlertPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 ServerSecurityAlertPolicyInner object if successful. + */ + public ServerSecurityAlertPolicyInner get(String resourceGroupName, String serverName) { + return getWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 getAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerSecurityAlertPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String serverName) { + return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, ServerSecurityAlertPolicyInner>() { + @Override + public ServerSecurityAlertPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a server's security alert policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerSecurityAlertPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String securityAlertPolicyName = "Default"; + return service.get(resourceGroupName, serverName, securityAlertPolicyName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @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 ServerSecurityAlertPolicyInner object if successful. + */ + public ServerSecurityAlertPolicyInner createOrUpdate(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @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, ServerSecurityAlertPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerSecurityAlertPolicyInner>() { + @Override + public ServerSecurityAlertPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String securityAlertPolicyName = "Default"; + Observable> observable = service.createOrUpdate(resourceGroupName, serverName, securityAlertPolicyName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @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 ServerSecurityAlertPolicyInner object if successful. + */ + public ServerSecurityAlertPolicyInner beginCreateOrUpdate(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @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, ServerSecurityAlertPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerSecurityAlertPolicyInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerSecurityAlertPolicyInner>() { + @Override + public ServerSecurityAlertPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a threat detection policy. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerSecurityAlertPolicyInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + final String securityAlertPolicyName = "Default"; + return service.beginCreateOrUpdate(resourceGroupName, serverName, securityAlertPolicyName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPolicyImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPolicyImpl.java new file mode 100644 index 0000000000000..e47875533f513 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPolicyImpl.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicyState; +import java.util.List; + +class ServerSecurityAlertPolicyImpl extends CreatableUpdatableImpl implements ServerSecurityAlertPolicy, ServerSecurityAlertPolicy.Definition, ServerSecurityAlertPolicy.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + + ServerSecurityAlertPolicyImpl(String name, DBforMariaDBManager manager) { + super(name, new ServerSecurityAlertPolicyInner()); + this.manager = manager; + // Set resource name + this.serverName = name; + // + } + + ServerSecurityAlertPolicyImpl(ServerSecurityAlertPolicyInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.serverName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ServerSecurityAlertPoliciesInner client = this.manager().inner().serverSecurityAlertPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServerSecurityAlertPoliciesInner client = this.manager().inner().serverSecurityAlertPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServerSecurityAlertPoliciesInner client = this.manager().inner().serverSecurityAlertPolicies(); + return client.getAsync(this.resourceGroupName, this.serverName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List disabledAlerts() { + return this.inner().disabledAlerts(); + } + + @Override + public Boolean emailAccountAdmins() { + return this.inner().emailAccountAdmins(); + } + + @Override + public List emailAddresses() { + return this.inner().emailAddresses(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer retentionDays() { + return this.inner().retentionDays(); + } + + @Override + public ServerSecurityAlertPolicyState state() { + return this.inner().state(); + } + + @Override + public String storageAccountAccessKey() { + return this.inner().storageAccountAccessKey(); + } + + @Override + public String storageEndpoint() { + return this.inner().storageEndpoint(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ServerSecurityAlertPolicyImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withState(ServerSecurityAlertPolicyState state) { + this.inner().withState(state); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withDisabledAlerts(List disabledAlerts) { + this.inner().withDisabledAlerts(disabledAlerts); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withEmailAccountAdmins(Boolean emailAccountAdmins) { + this.inner().withEmailAccountAdmins(emailAccountAdmins); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withEmailAddresses(List emailAddresses) { + this.inner().withEmailAddresses(emailAddresses); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withRetentionDays(Integer retentionDays) { + this.inner().withRetentionDays(retentionDays); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.inner().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + @Override + public ServerSecurityAlertPolicyImpl withStorageEndpoint(String storageEndpoint) { + this.inner().withStorageEndpoint(storageEndpoint); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPolicyInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPolicyInner.java new file mode 100644 index 0000000000000..0479d6083bd2c --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerSecurityAlertPolicyInner.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerSecurityAlertPolicyState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A server security alert policy. + */ +@JsonFlatten +public class ServerSecurityAlertPolicyInner extends ProxyResource { + /** + * Specifies the state of the policy, whether it is enabled or disabled. + * Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.state", required = true) + private ServerSecurityAlertPolicyState state; + + /** + * Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly. + */ + @JsonProperty(value = "properties.disabledAlerts") + private List disabledAlerts; + + /** + * Specifies an array of e-mail addresses to which the alert is sent. + */ + @JsonProperty(value = "properties.emailAddresses") + private List emailAddresses; + + /** + * Specifies that the alert is sent to the account administrators. + */ + @JsonProperty(value = "properties.emailAccountAdmins") + private Boolean emailAccountAdmins; + + /** + * Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold + * all Threat Detection audit logs. + */ + @JsonProperty(value = "properties.storageEndpoint") + private String storageEndpoint; + + /** + * Specifies the identifier key of the Threat Detection audit storage + * account. + */ + @JsonProperty(value = "properties.storageAccountAccessKey") + private String storageAccountAccessKey; + + /** + * Specifies the number of days to keep in the Threat Detection audit logs. + */ + @JsonProperty(value = "properties.retentionDays") + private Integer retentionDays; + + /** + * Get specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the state value + */ + public ServerSecurityAlertPolicyState state() { + return this.state; + } + + /** + * Set specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param state the state value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withState(ServerSecurityAlertPolicyState state) { + this.state = state; + return this; + } + + /** + * Get specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly. + * + * @return the disabledAlerts value + */ + public List disabledAlerts() { + return this.disabledAlerts; + } + + /** + * Set specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly. + * + * @param disabledAlerts the disabledAlerts value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withDisabledAlerts(List disabledAlerts) { + this.disabledAlerts = disabledAlerts; + return this; + } + + /** + * Get specifies an array of e-mail addresses to which the alert is sent. + * + * @return the emailAddresses value + */ + public List emailAddresses() { + return this.emailAddresses; + } + + /** + * Set specifies an array of e-mail addresses to which the alert is sent. + * + * @param emailAddresses the emailAddresses value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withEmailAddresses(List emailAddresses) { + this.emailAddresses = emailAddresses; + return this; + } + + /** + * Get specifies that the alert is sent to the account administrators. + * + * @return the emailAccountAdmins value + */ + public Boolean emailAccountAdmins() { + return this.emailAccountAdmins; + } + + /** + * Set specifies that the alert is sent to the account administrators. + * + * @param emailAccountAdmins the emailAccountAdmins value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withEmailAccountAdmins(Boolean emailAccountAdmins) { + this.emailAccountAdmins = emailAccountAdmins; + return this; + } + + /** + * Get specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @return the storageEndpoint value + */ + public String storageEndpoint() { + return this.storageEndpoint; + } + + /** + * Set specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @param storageEndpoint the storageEndpoint value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withStorageEndpoint(String storageEndpoint) { + this.storageEndpoint = storageEndpoint; + return this; + } + + /** + * Get specifies the identifier key of the Threat Detection audit storage account. + * + * @return the storageAccountAccessKey value + */ + public String storageAccountAccessKey() { + return this.storageAccountAccessKey; + } + + /** + * Set specifies the identifier key of the Threat Detection audit storage account. + * + * @param storageAccountAccessKey the storageAccountAccessKey value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get specifies the number of days to keep in the Threat Detection audit logs. + * + * @return the retentionDays value + */ + public Integer retentionDays() { + return this.retentionDays; + } + + /** + * Set specifies the number of days to keep in the Threat Detection audit logs. + * + * @param retentionDays the retentionDays value to set + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerServerImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerServerImpl.java new file mode 100644 index 0000000000000..e901f26f9a383 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServerServerImpl.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerServer; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mariadb.v2018_06_01.Sku; +import com.microsoft.azure.management.mariadb.v2018_06_01.SslEnforcementEnum; +import com.microsoft.azure.management.mariadb.v2018_06_01.StorageProfile; +import java.util.Map; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerState; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerVersion; + +class ServerServerImpl extends WrapperImpl implements ServerServer { + private final DBforMariaDBManager manager; + + ServerServerImpl(ServerInner inner, DBforMariaDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + + + @Override + public String administratorLogin() { + return this.inner().administratorLogin(); + } + + @Override + public DateTime earliestRestoreDate() { + return this.inner().earliestRestoreDate(); + } + + @Override + public String fullyQualifiedDomainName() { + return this.inner().fullyQualifiedDomainName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String masterServerId() { + return this.inner().masterServerId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer replicaCapacity() { + return this.inner().replicaCapacity(); + } + + @Override + public String replicationRole() { + return this.inner().replicationRole(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public SslEnforcementEnum sslEnforcement() { + return this.inner().sslEnforcement(); + } + + @Override + public StorageProfile storageProfile() { + return this.inner().storageProfile(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ServerState userVisibleState() { + return this.inner().userVisibleState(); + } + + @Override + public ServerVersion version() { + return this.inner().version(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServersImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServersImpl.java new file mode 100644 index 0000000000000..4364e42e6b616 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServersImpl.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. + * def + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.Servers; +import com.microsoft.azure.management.mariadb.v2018_06_01.Server; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class ServersImpl extends GroupableResourcesCoreImpl implements Servers { + protected ServersImpl(DBforMariaDBManager manager) { + super(manager.inner().servers(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ServersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ServersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ServersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ServersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Server call(ServerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ServersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ServersInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Server call(ServerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ServerImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable restartAsync(String resourceGroupName, String serverName) { + ServersInner client = this.inner(); + return client.restartAsync(resourceGroupName, serverName).toCompletable(); + } + + @Override + protected ServerImpl wrapModel(ServerInner inner) { + return new ServerImpl(inner.name(), inner, manager()); + } + + @Override + protected ServerImpl wrapModel(String name) { + return new ServerImpl(name, new ServerInner(), this.manager()); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServersInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServersInner.java new file mode 100644 index 0000000000000..4ed40231dde00 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/ServersInner.java @@ -0,0 +1,1023 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerForCreate; +import com.microsoft.azure.management.mariadb.v2018_06_01.ServerUpdateParameters; +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.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +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 Servers. + */ +public class ServersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ServersService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of ServersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServersInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(ServersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Servers to be + * used by Retrofit to perform actually REST calls. + */ + interface ServersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.Servers create" }) + @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.v2018_06_01.Servers beginCreate" }) + @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.v2018_06_01.Servers update" }) + @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.v2018_06_01.Servers beginUpdate" }) + @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.v2018_06_01.Servers delete" }) + @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.v2018_06_01.Servers beginDelete" }) + @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.v2018_06_01.Servers getByResourceGroup" }) + @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.v2018_06_01.Servers listByResourceGroup" }) + @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.v2018_06_01.Servers list" }) + @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.v2018_06_01.Servers 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.v2018_06_01.Servers beginRestart" }) + @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); + + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 ServerInner object if successful. + */ + public ServerInner create(String resourceGroupName, String serverName, ServerForCreate parameters) { + return createWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String serverName, ServerForCreate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String serverName, ServerForCreate parameters) { + return createWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String serverName, ServerForCreate parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 ServerInner object if successful. + */ + public ServerInner beginCreate(String resourceGroupName, String serverName, ServerForCreate parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String serverName, ServerForCreate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String serverName, ServerForCreate parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the existing server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerForCreate parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a 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 ServerInner object if successful. + */ + public ServerInner update(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().last().body(); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a 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 ServerInner object if successful. + */ + public ServerInner beginUpdate(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body(); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters), serviceCallback); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(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 server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 + */ + public void delete(String resourceGroupName, String serverName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().last().body(); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 deleteAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 + */ + public void beginDelete(String resourceGroupName, String serverName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 beginDeleteAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse 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); + } + + /** + * Gets information about a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 ServerInner object if successful. + */ + public ServerInner getByResourceGroup(String resourceGroupName, String serverName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * Gets information about a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 getByResourceGroupAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Gets information about a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String serverName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, ServerInner>() { + @Override + public ServerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServerInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(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 all the servers in a given resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * List all the servers in a given resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * List all the servers in a given resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @return the observable to the List<ServerInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List all the servers in a given resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @return the observable to the List<ServerInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(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 all the servers in a given subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * List all the servers in a given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List all the servers in a given subscription. + * + * @return the observable to the List<ServerInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List all the servers in a given subscription. + * + * @return the observable to the List<ServerInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 + */ + public void restart(String resourceGroupName, String serverName) { + restartWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().last().body(); + } + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 restartAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable restartAsync(String resourceGroupName, String serverName) { + return restartWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.restart(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 + */ + public void beginRestart(String resourceGroupName, String serverName) { + beginRestartWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body(); + } + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 beginRestartAsync(String resourceGroupName, String serverName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, serverName), serviceCallback); + } + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRestartAsync(String resourceGroupName, String serverName) { + return beginRestartWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String serverName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginRestart(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRestartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRestartDelegate(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); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRuleImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRuleImpl.java new file mode 100644 index 0000000000000..f1ed8c4346b14 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRuleImpl.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.VirtualNetworkRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.mariadb.v2018_06_01.VirtualNetworkRuleState; + +class VirtualNetworkRuleImpl extends CreatableUpdatableImpl implements VirtualNetworkRule, VirtualNetworkRule.Definition, VirtualNetworkRule.Update { + private final DBforMariaDBManager manager; + private String resourceGroupName; + private String serverName; + private String virtualNetworkRuleName; + + VirtualNetworkRuleImpl(String name, DBforMariaDBManager manager) { + super(name, new VirtualNetworkRuleInner()); + this.manager = manager; + // Set resource name + this.virtualNetworkRuleName = name; + // + } + + VirtualNetworkRuleImpl(VirtualNetworkRuleInner inner, DBforMariaDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.virtualNetworkRuleName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.serverName = IdParsingUtils.getValueFromIdByName(inner.id(), "servers"); + this.virtualNetworkRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworkRules"); + // + } + + @Override + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VirtualNetworkRulesInner client = this.manager().inner().virtualNetworkRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.virtualNetworkRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualNetworkRulesInner client = this.manager().inner().virtualNetworkRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.serverName, this.virtualNetworkRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkRulesInner client = this.manager().inner().virtualNetworkRules(); + return client.getAsync(this.resourceGroupName, this.serverName, this.virtualNetworkRuleName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean ignoreMissingVnetServiceEndpoint() { + return this.inner().ignoreMissingVnetServiceEndpoint(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public VirtualNetworkRuleState state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String virtualNetworkSubnetId() { + return this.inner().virtualNetworkSubnetId(); + } + + @Override + public VirtualNetworkRuleImpl withExistingServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + @Override + public VirtualNetworkRuleImpl withVirtualNetworkSubnetId(String virtualNetworkSubnetId) { + this.inner().withVirtualNetworkSubnetId(virtualNetworkSubnetId); + return this; + } + + @Override + public VirtualNetworkRuleImpl withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { + this.inner().withIgnoreMissingVnetServiceEndpoint(ignoreMissingVnetServiceEndpoint); + return this; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRuleInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRuleInner.java new file mode 100644 index 0000000000000..55a2898fd99b7 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRuleInner.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.management.mariadb.v2018_06_01.VirtualNetworkRuleState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A virtual network rule. + */ +@JsonFlatten +public class VirtualNetworkRuleInner extends ProxyResource { + /** + * The ARM resource id of the virtual network subnet. + */ + @JsonProperty(value = "properties.virtualNetworkSubnetId", required = true) + private String virtualNetworkSubnetId; + + /** + * Create firewall rule before the virtual network has vnet service + * endpoint enabled. + */ + @JsonProperty(value = "properties.ignoreMissingVnetServiceEndpoint") + private Boolean ignoreMissingVnetServiceEndpoint; + + /** + * Virtual Network Rule State. Possible values include: 'Initializing', + * 'InProgress', 'Ready', 'Deleting', 'Unknown'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkRuleState state; + + /** + * Get the ARM resource id of the virtual network subnet. + * + * @return the virtualNetworkSubnetId value + */ + public String virtualNetworkSubnetId() { + return this.virtualNetworkSubnetId; + } + + /** + * Set the ARM resource id of the virtual network subnet. + * + * @param virtualNetworkSubnetId the virtualNetworkSubnetId value to set + * @return the VirtualNetworkRuleInner object itself. + */ + public VirtualNetworkRuleInner withVirtualNetworkSubnetId(String virtualNetworkSubnetId) { + this.virtualNetworkSubnetId = virtualNetworkSubnetId; + return this; + } + + /** + * Get create firewall rule before the virtual network has vnet service endpoint enabled. + * + * @return the ignoreMissingVnetServiceEndpoint value + */ + public Boolean ignoreMissingVnetServiceEndpoint() { + return this.ignoreMissingVnetServiceEndpoint; + } + + /** + * Set create firewall rule before the virtual network has vnet service endpoint enabled. + * + * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set + * @return the VirtualNetworkRuleInner object itself. + */ + public VirtualNetworkRuleInner withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { + this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; + return this; + } + + /** + * Get virtual Network Rule State. Possible values include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown'. + * + * @return the state value + */ + public VirtualNetworkRuleState state() { + return this.state; + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesImpl.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesImpl.java new file mode 100644 index 0000000000000..354af027f1084 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mariadb.v2018_06_01.VirtualNetworkRules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mariadb.v2018_06_01.VirtualNetworkRule; + +class VirtualNetworkRulesImpl extends WrapperImpl implements VirtualNetworkRules { + private final DBforMariaDBManager manager; + + VirtualNetworkRulesImpl(DBforMariaDBManager manager) { + super(manager.inner().virtualNetworkRules()); + this.manager = manager; + } + + public DBforMariaDBManager manager() { + return this.manager; + } + + @Override + public VirtualNetworkRuleImpl define(String name) { + return wrapModel(name); + } + + private VirtualNetworkRuleImpl wrapModel(VirtualNetworkRuleInner inner) { + return new VirtualNetworkRuleImpl(inner, manager()); + } + + private VirtualNetworkRuleImpl wrapModel(String name) { + return new VirtualNetworkRuleImpl(name, this.manager()); + } + + @Override + public Observable listByServerAsync(final String resourceGroupName, final String serverName) { + VirtualNetworkRulesInner 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 VirtualNetworkRule call(VirtualNetworkRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + VirtualNetworkRulesInner client = this.inner(); + return client.getAsync(resourceGroupName, serverName, virtualNetworkRuleName) + .map(new Func1() { + @Override + public VirtualNetworkRule call(VirtualNetworkRuleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + VirtualNetworkRulesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, serverName, virtualNetworkRuleName).toCompletable(); + } + +} diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesInner.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesInner.java new file mode 100644 index 0000000000000..a922a1542107b --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/VirtualNetworkRulesInner.java @@ -0,0 +1,777 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import 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.HTTP; +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 VirtualNetworkRules. + */ +public class VirtualNetworkRulesInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkRulesService service; + /** The service client containing this operation class. */ + private MariaDBManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkRulesInner(Retrofit retrofit, MariaDBManagementClientImpl client) { + this.service = retrofit.create(VirtualNetworkRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkRules to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mariadb.v2018_06_01.VirtualNetworkRules get" }) + @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.v2018_06_01.VirtualNetworkRules createOrUpdate" }) + @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.v2018_06_01.VirtualNetworkRules beginCreateOrUpdate" }) + @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.v2018_06_01.VirtualNetworkRules delete" }) + @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.v2018_06_01.VirtualNetworkRules beginDelete" }) + @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.v2018_06_01.VirtualNetworkRules listByServer" }) + @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.v2018_06_01.VirtualNetworkRules listByServerNext" }) + @GET + Observable> listByServerNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @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 VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner get(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).toBlocking().single().body(); + } + + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName), serviceCallback); + } + + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable getAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + return getWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(resourceGroupName, serverName, this.client.subscriptionId(), virtualNetworkRuleName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @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 VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner createOrUpdate(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @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 virtualNetworkRuleName, VirtualNetworkRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters), serviceCallback); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, serverName, this.client.subscriptionId(), virtualNetworkRuleName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @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 VirtualNetworkRuleInner object if successful. + */ + public VirtualNetworkRuleInner beginCreateOrUpdate(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @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 virtualNetworkRuleName, VirtualNetworkRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters), serviceCallback); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).map(new Func1, VirtualNetworkRuleInner>() { + @Override + public VirtualNetworkRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an existing virtual network rule. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param parameters The requested virtual Network Rule Resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkRuleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, serverName, this.client.subscriptionId(), virtualNetworkRuleName, this.client.apiVersion(), parameters, 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(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @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 virtualNetworkRuleName) { + deleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).toBlocking().last().body(); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName), serviceCallback); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + 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 (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, serverName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @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 virtualNetworkRuleName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).toBlocking().single().body(); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName), serviceCallback); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the virtual network rule with the given name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @param virtualNetworkRuleName The name of the virtual network rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { + 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 (virtualNetworkRuleName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, serverName, virtualNetworkRuleName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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<VirtualNetworkRuleInner> 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 a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param 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 a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkRuleInner> 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 a list of virtual network rules in a server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkRuleInner> 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 a list of virtual network rules in a server. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkRuleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServerSinglePageAsync(final String resourceGroupName, final String serverName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (serverName == null) { + throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByServer(resourceGroupName, serverName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServerDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of virtual network rules in 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<VirtualNetworkRuleInner> 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 a list of virtual network rules in 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 a list of virtual network rules in 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<VirtualNetworkRuleInner> object + */ + public Observable> listByServerNextAsync(final String nextPageLink) { + return listByServerNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of virtual network rules in 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<VirtualNetworkRuleInner> 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 a list of virtual network rules in 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<VirtualNetworkRuleInner> 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/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/package-info.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/package-info.java new file mode 100644 index 0000000000000..135d7e05cb973 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the implementation classes for MariaDBManagementClient. + * MariaDB Client. + */ +package com.microsoft.azure.management.mariadb.v2018_06_01.implementation; diff --git a/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/package-info.java b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/package-info.java new file mode 100644 index 0000000000000..10b2b1dee0ce9 --- /dev/null +++ b/mariadb/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/mariadb/v2018_06_01/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the classes for MariaDBManagementClient. + * MariaDB Client. + */ +package com.microsoft.azure.management.mariadb.v2018_06_01;