diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/CHANGELOG.md b/sdk/postgresql/azure-resourcemanager-postgresql/CHANGELOG.md index 2bad3ada43c5..038cb9f99fc8 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/CHANGELOG.md +++ b/sdk/postgresql/azure-resourcemanager-postgresql/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2021-06-04) +- Azure Resource Manager PostgreSql client library for Java. This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-2021-06-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0 (2021-04-09) diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/README.md b/sdk/postgresql/azure-resourcemanager-postgresql/README.md index 5b615eaf007a..ca38b78130a0 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/README.md +++ b/sdk/postgresql/azure-resourcemanager-postgresql/README.md @@ -2,7 +2,7 @@ Azure Resource Manager PostgreSql client library for Java. -This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-2020-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-2021-06-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-postgresql - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,8 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/pom.xml b/sdk/postgresql/azure-resourcemanager-postgresql/pom.xml index 2bfb822354ec..253e96fbfc75 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/pom.xml +++ b/sdk/postgresql/azure-resourcemanager-postgresql/pom.xml @@ -1,67 +1,86 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-postgresql - 1.1.0-beta.1 - jar + com.azure.resourcemanager + azure-resourcemanager-postgresql + 1.1.0-beta.1 + jar - Microsoft Azure SDK for PostgreSql Management - This package contains Microsoft Azure SDK for PostgreSql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-2020-01-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for PostgreSql Management + This package contains Microsoft Azure SDK for PostgreSql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-2021-06-01. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.16.0 - - - com.azure - azure-core-management - 1.2.2 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.16.0 + + + com.azure + azure-core-management + 1.2.2 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/PostgreSqlManager.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/PostgreSqlManager.java index 9539bd347b92..69afb12ad379 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/PostgreSqlManager.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/PostgreSqlManager.java @@ -25,39 +25,21 @@ import com.azure.resourcemanager.postgresql.implementation.ConfigurationsImpl; import com.azure.resourcemanager.postgresql.implementation.DatabasesImpl; import com.azure.resourcemanager.postgresql.implementation.FirewallRulesImpl; -import com.azure.resourcemanager.postgresql.implementation.LocationBasedPerformanceTiersImpl; -import com.azure.resourcemanager.postgresql.implementation.LogFilesImpl; +import com.azure.resourcemanager.postgresql.implementation.GetPrivateDnsZoneSuffixesImpl; +import com.azure.resourcemanager.postgresql.implementation.LocationBasedCapabilitiesImpl; import com.azure.resourcemanager.postgresql.implementation.OperationsImpl; import com.azure.resourcemanager.postgresql.implementation.PostgreSqlManagementClientBuilder; -import com.azure.resourcemanager.postgresql.implementation.PrivateEndpointConnectionsImpl; -import com.azure.resourcemanager.postgresql.implementation.PrivateLinkResourcesImpl; -import com.azure.resourcemanager.postgresql.implementation.RecoverableServersImpl; -import com.azure.resourcemanager.postgresql.implementation.ReplicasImpl; -import com.azure.resourcemanager.postgresql.implementation.ServerAdministratorsImpl; -import com.azure.resourcemanager.postgresql.implementation.ServerBasedPerformanceTiersImpl; -import com.azure.resourcemanager.postgresql.implementation.ServerKeysImpl; -import com.azure.resourcemanager.postgresql.implementation.ServerParametersImpl; -import com.azure.resourcemanager.postgresql.implementation.ServerSecurityAlertPoliciesImpl; import com.azure.resourcemanager.postgresql.implementation.ServersImpl; -import com.azure.resourcemanager.postgresql.implementation.VirtualNetworkRulesImpl; +import com.azure.resourcemanager.postgresql.implementation.VirtualNetworkSubnetUsagesImpl; import com.azure.resourcemanager.postgresql.models.CheckNameAvailabilities; import com.azure.resourcemanager.postgresql.models.Configurations; import com.azure.resourcemanager.postgresql.models.Databases; import com.azure.resourcemanager.postgresql.models.FirewallRules; -import com.azure.resourcemanager.postgresql.models.LocationBasedPerformanceTiers; -import com.azure.resourcemanager.postgresql.models.LogFiles; +import com.azure.resourcemanager.postgresql.models.GetPrivateDnsZoneSuffixes; +import com.azure.resourcemanager.postgresql.models.LocationBasedCapabilities; import com.azure.resourcemanager.postgresql.models.Operations; -import com.azure.resourcemanager.postgresql.models.PrivateEndpointConnections; -import com.azure.resourcemanager.postgresql.models.PrivateLinkResources; -import com.azure.resourcemanager.postgresql.models.RecoverableServers; -import com.azure.resourcemanager.postgresql.models.Replicas; -import com.azure.resourcemanager.postgresql.models.ServerAdministrators; -import com.azure.resourcemanager.postgresql.models.ServerBasedPerformanceTiers; -import com.azure.resourcemanager.postgresql.models.ServerKeys; -import com.azure.resourcemanager.postgresql.models.ServerParameters; -import com.azure.resourcemanager.postgresql.models.ServerSecurityAlertPolicies; import com.azure.resourcemanager.postgresql.models.Servers; -import com.azure.resourcemanager.postgresql.models.VirtualNetworkRules; +import com.azure.resourcemanager.postgresql.models.VirtualNetworkSubnetUsages; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -72,39 +54,21 @@ public final class PostgreSqlManager { private Servers servers; - private Replicas replicas; - private FirewallRules firewallRules; - private VirtualNetworkRules virtualNetworkRules; - - private Databases databases; - private Configurations configurations; - private ServerParameters serverParameters; - - private LogFiles logFiles; - - private ServerAdministrators serverAdministrators; - - private RecoverableServers recoverableServers; - - private ServerBasedPerformanceTiers serverBasedPerformanceTiers; - - private LocationBasedPerformanceTiers locationBasedPerformanceTiers; - private CheckNameAvailabilities checkNameAvailabilities; - private Operations operations; + private LocationBasedCapabilities locationBasedCapabilities; - private ServerSecurityAlertPolicies serverSecurityAlertPolicies; + private VirtualNetworkSubnetUsages virtualNetworkSubnetUsages; - private PrivateEndpointConnections privateEndpointConnections; + private Operations operations; - private PrivateLinkResources privateLinkResources; + private Databases databases; - private ServerKeys serverKeys; + private GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes; private final PostgreSqlManagementClient clientObject; @@ -230,7 +194,7 @@ public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile p .append("-") .append("com.azure.resourcemanager.postgresql") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -277,14 +241,6 @@ public Servers servers() { return servers; } - /** @return Resource collection API of Replicas. */ - public Replicas replicas() { - if (this.replicas == null) { - this.replicas = new ReplicasImpl(clientObject.getReplicas(), this); - } - return replicas; - } - /** @return Resource collection API of FirewallRules. */ public FirewallRules firewallRules() { if (this.firewallRules == null) { @@ -293,22 +249,6 @@ public FirewallRules firewallRules() { return firewallRules; } - /** @return Resource collection API of VirtualNetworkRules. */ - public VirtualNetworkRules virtualNetworkRules() { - if (this.virtualNetworkRules == null) { - this.virtualNetworkRules = new VirtualNetworkRulesImpl(clientObject.getVirtualNetworkRules(), this); - } - return virtualNetworkRules; - } - - /** @return Resource collection API of Databases. */ - public Databases databases() { - if (this.databases == null) { - this.databases = new DatabasesImpl(clientObject.getDatabases(), this); - } - return databases; - } - /** @return Resource collection API of Configurations. */ public Configurations configurations() { if (this.configurations == null) { @@ -317,56 +257,6 @@ public Configurations configurations() { return configurations; } - /** @return Resource collection API of ServerParameters. */ - public ServerParameters serverParameters() { - if (this.serverParameters == null) { - this.serverParameters = new ServerParametersImpl(clientObject.getServerParameters(), this); - } - return serverParameters; - } - - /** @return Resource collection API of LogFiles. */ - public LogFiles logFiles() { - if (this.logFiles == null) { - this.logFiles = new LogFilesImpl(clientObject.getLogFiles(), this); - } - return logFiles; - } - - /** @return Resource collection API of ServerAdministrators. */ - public ServerAdministrators serverAdministrators() { - if (this.serverAdministrators == null) { - this.serverAdministrators = new ServerAdministratorsImpl(clientObject.getServerAdministrators(), this); - } - return serverAdministrators; - } - - /** @return Resource collection API of RecoverableServers. */ - public RecoverableServers recoverableServers() { - if (this.recoverableServers == null) { - this.recoverableServers = new RecoverableServersImpl(clientObject.getRecoverableServers(), this); - } - return recoverableServers; - } - - /** @return Resource collection API of ServerBasedPerformanceTiers. */ - public ServerBasedPerformanceTiers serverBasedPerformanceTiers() { - if (this.serverBasedPerformanceTiers == null) { - this.serverBasedPerformanceTiers = - new ServerBasedPerformanceTiersImpl(clientObject.getServerBasedPerformanceTiers(), this); - } - return serverBasedPerformanceTiers; - } - - /** @return Resource collection API of LocationBasedPerformanceTiers. */ - public LocationBasedPerformanceTiers locationBasedPerformanceTiers() { - if (this.locationBasedPerformanceTiers == null) { - this.locationBasedPerformanceTiers = - new LocationBasedPerformanceTiersImpl(clientObject.getLocationBasedPerformanceTiers(), this); - } - return locationBasedPerformanceTiers; - } - /** @return Resource collection API of CheckNameAvailabilities. */ public CheckNameAvailabilities checkNameAvailabilities() { if (this.checkNameAvailabilities == null) { @@ -376,46 +266,47 @@ public CheckNameAvailabilities checkNameAvailabilities() { return checkNameAvailabilities; } - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + /** @return Resource collection API of LocationBasedCapabilities. */ + public LocationBasedCapabilities locationBasedCapabilities() { + if (this.locationBasedCapabilities == null) { + this.locationBasedCapabilities = + new LocationBasedCapabilitiesImpl(clientObject.getLocationBasedCapabilities(), this); } - return operations; + return locationBasedCapabilities; } - /** @return Resource collection API of ServerSecurityAlertPolicies. */ - public ServerSecurityAlertPolicies serverSecurityAlertPolicies() { - if (this.serverSecurityAlertPolicies == null) { - this.serverSecurityAlertPolicies = - new ServerSecurityAlertPoliciesImpl(clientObject.getServerSecurityAlertPolicies(), this); + /** @return Resource collection API of VirtualNetworkSubnetUsages. */ + public VirtualNetworkSubnetUsages virtualNetworkSubnetUsages() { + if (this.virtualNetworkSubnetUsages == null) { + this.virtualNetworkSubnetUsages = + new VirtualNetworkSubnetUsagesImpl(clientObject.getVirtualNetworkSubnetUsages(), this); } - return serverSecurityAlertPolicies; + return virtualNetworkSubnetUsages; } - /** @return Resource collection API of PrivateEndpointConnections. */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections = - new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return privateEndpointConnections; + return operations; } - /** @return Resource collection API of PrivateLinkResources. */ - public PrivateLinkResources privateLinkResources() { - if (this.privateLinkResources == null) { - this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + /** @return Resource collection API of Databases. */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(clientObject.getDatabases(), this); } - return privateLinkResources; + return databases; } - /** @return Resource collection API of ServerKeys. */ - public ServerKeys serverKeys() { - if (this.serverKeys == null) { - this.serverKeys = new ServerKeysImpl(clientObject.getServerKeys(), this); + /** @return Resource collection API of GetPrivateDnsZoneSuffixes. */ + public GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes() { + if (this.getPrivateDnsZoneSuffixes == null) { + this.getPrivateDnsZoneSuffixes = + new GetPrivateDnsZoneSuffixesImpl(clientObject.getGetPrivateDnsZoneSuffixes(), this); } - return serverKeys; + return getPrivateDnsZoneSuffixes; } /** diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ConfigurationsClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ConfigurationsClient.java index 56890225c56c..e466d4eba1b6 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ConfigurationsClient.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ConfigurationsClient.java @@ -15,6 +15,63 @@ /** An instance of this class provides access to all the operations defined in ConfigurationsClient. */ public interface ConfigurationsClient { + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * List all the configurations in a given server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a configuration of server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationInner get(String resourceGroupName, String serverName, String configurationName); + + /** + * Gets information about a configuration of server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a configuration of server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serverName, String configurationName, Context context); + /** * Updates a configuration of a server. * @@ -28,7 +85,7 @@ public interface ConfigurationsClient { * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConfigurationInner> beginCreateOrUpdate( + SyncPoller, ConfigurationInner> beginUpdate( String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters); /** @@ -45,7 +102,7 @@ SyncPoller, ConfigurationInner> beginCreateOrUpda * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConfigurationInner> beginCreateOrUpdate( + SyncPoller, ConfigurationInner> beginUpdate( String resourceGroupName, String serverName, String configurationName, @@ -65,7 +122,7 @@ SyncPoller, ConfigurationInner> beginCreateOrUpda * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner createOrUpdate( + ConfigurationInner update( String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters); /** @@ -82,7 +139,7 @@ ConfigurationInner createOrUpdate( * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner createOrUpdate( + ConfigurationInner update( String resourceGroupName, String serverName, String configurationName, @@ -90,59 +147,76 @@ ConfigurationInner createOrUpdate( Context context); /** - * Gets information about a configuration of server. + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a configuration of server. + * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationInner get(String resourceGroupName, String serverName, String configurationName); + SyncPoller, ConfigurationInner> beginPut( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters); /** - * Gets information about a configuration of server. + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a configuration of server. + * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, String configurationName, Context context); + SyncPoller, ConfigurationInner> beginPut( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context); /** - * List all the configurations in a given server. + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. + * @return represents a Configuration. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationInner put( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters); /** - * List all the configurations in a given server. + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. + * @return represents a Configuration. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationInner put( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/DatabasesClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/DatabasesClient.java index 63de99a3a435..0e9976a01ebc 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/DatabasesClient.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/DatabasesClient.java @@ -28,7 +28,7 @@ public interface DatabasesClient { * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DatabaseInner> beginCreateOrUpdate( + SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters); /** @@ -45,7 +45,7 @@ SyncPoller, DatabaseInner> beginCreateOrUpdate( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, DatabaseInner> beginCreateOrUpdate( + SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context); /** @@ -61,8 +61,7 @@ SyncPoller, DatabaseInner> beginCreateOrUpdate( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseInner createOrUpdate( - String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters); + DatabaseInner create(String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters); /** * Creates a new database or updates an existing database. @@ -78,7 +77,7 @@ DatabaseInner createOrUpdate( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseInner createOrUpdate( + DatabaseInner create( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context); /** diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/FirewallRulesClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/FirewallRulesClient.java index 0d61b232b077..abfeebab733f 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/FirewallRulesClient.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/FirewallRulesClient.java @@ -90,7 +90,7 @@ FirewallRuleInner createOrUpdate( Context context); /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -105,7 +105,7 @@ SyncPoller, Void> beginDelete( String resourceGroupName, String serverName, String firewallRuleName); /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -121,7 +121,7 @@ SyncPoller, Void> beginDelete( String resourceGroupName, String serverName, String firewallRuleName, Context context); /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -134,7 +134,7 @@ SyncPoller, Void> beginDelete( void delete(String resourceGroupName, String serverName, String firewallRuleName); /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -148,7 +148,7 @@ SyncPoller, Void> beginDelete( void delete(String resourceGroupName, String serverName, String firewallRuleName, Context context); /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -156,13 +156,13 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) FirewallRuleInner get(String resourceGroupName, String serverName, String firewallRuleName); /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -171,14 +171,14 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( String resourceGroupName, String serverName, String firewallRuleName, Context context); /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -191,7 +191,7 @@ Response getWithResponse( PagedIterable listByServer(String resourceGroupName, String serverName); /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/RecoverableServersClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/GetPrivateDnsZoneSuffixesClient.java similarity index 55% rename from sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/RecoverableServersClient.java rename to sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/GetPrivateDnsZoneSuffixesClient.java index 6df0c58db1e3..ebca51b7f46a 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/RecoverableServersClient.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/GetPrivateDnsZoneSuffixesClient.java @@ -8,35 +8,28 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.RecoverableServerResourceInner; -/** An instance of this class provides access to all the operations defined in RecoverableServersClient. */ -public interface RecoverableServersClient { +/** An instance of this class provides access to all the operations defined in GetPrivateDnsZoneSuffixesClient. */ +public interface GetPrivateDnsZoneSuffixesClient { /** - * Gets a recoverable PostgreSQL Server. + * Get private DNS zone suffix in the cloud. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recoverable PostgreSQL Server. + * @return private DNS zone suffix in the cloud. */ @ServiceMethod(returns = ReturnType.SINGLE) - RecoverableServerResourceInner get(String resourceGroupName, String serverName); + String execute(); /** - * Gets a recoverable PostgreSQL Server. + * Get private DNS zone suffix in the cloud. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recoverable PostgreSQL Server. + * @return private DNS zone suffix in the cloud. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, Context context); + Response executeWithResponse(Context context); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/LocationBasedPerformanceTiersClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/LocationBasedCapabilitiesClient.java similarity index 68% rename from sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/LocationBasedPerformanceTiersClient.java rename to sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/LocationBasedCapabilitiesClient.java index 6fd31abd4e3c..21f10c32198d 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/LocationBasedPerformanceTiersClient.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/LocationBasedCapabilitiesClient.java @@ -8,32 +8,32 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner; +import com.azure.resourcemanager.postgresql.fluent.models.CapabilityPropertiesInner; -/** An instance of this class provides access to all the operations defined in LocationBasedPerformanceTiersClient. */ -public interface LocationBasedPerformanceTiersClient { +/** An instance of this class provides access to all the operations defined in LocationBasedCapabilitiesClient. */ +public interface LocationBasedCapabilitiesClient { /** - * List all the performance tiers at specified location in a given subscription. + * Get capabilities at specified location in a given subscription. * * @param locationName The name of the location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. + * @return capabilities at specified location in a given subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName); + PagedIterable execute(String locationName); /** - * List all the performance tiers at specified location in a given subscription. + * Get capabilities at specified location in a given subscription. * * @param locationName The name of the location. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. + * @return capabilities at specified location in a given subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, Context context); + PagedIterable execute(String locationName, Context context); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/LogFilesClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/LogFilesClient.java deleted file mode 100644 index 3e44299a7a46..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/LogFilesClient.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.LogFileInner; - -/** An instance of this class provides access to all the operations defined in LogFilesClient. */ -public interface LogFilesClient { - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PostgreSqlManagementClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PostgreSqlManagementClient.java index 3d7521329e2d..0033b7e1673a 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PostgreSqlManagementClient.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PostgreSqlManagementClient.java @@ -23,6 +23,13 @@ public interface PostgreSqlManagementClient { */ String getEndpoint(); + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + /** * Gets The HTTP pipeline to send requests through. * @@ -44,13 +51,6 @@ public interface PostgreSqlManagementClient { */ ServersClient getServers(); - /** - * Gets the ReplicasClient object to access its operations. - * - * @return the ReplicasClient object. - */ - ReplicasClient getReplicas(); - /** * Gets the FirewallRulesClient object to access its operations. * @@ -58,20 +58,6 @@ public interface PostgreSqlManagementClient { */ FirewallRulesClient getFirewallRules(); - /** - * Gets the VirtualNetworkRulesClient object to access its operations. - * - * @return the VirtualNetworkRulesClient object. - */ - VirtualNetworkRulesClient getVirtualNetworkRules(); - - /** - * Gets the DatabasesClient object to access its operations. - * - * @return the DatabasesClient object. - */ - DatabasesClient getDatabases(); - /** * Gets the ConfigurationsClient object to access its operations. * @@ -79,48 +65,6 @@ public interface PostgreSqlManagementClient { */ ConfigurationsClient getConfigurations(); - /** - * Gets the ServerParametersClient object to access its operations. - * - * @return the ServerParametersClient object. - */ - ServerParametersClient getServerParameters(); - - /** - * Gets the LogFilesClient object to access its operations. - * - * @return the LogFilesClient object. - */ - LogFilesClient getLogFiles(); - - /** - * Gets the ServerAdministratorsClient object to access its operations. - * - * @return the ServerAdministratorsClient object. - */ - ServerAdministratorsClient getServerAdministrators(); - - /** - * Gets the RecoverableServersClient object to access its operations. - * - * @return the RecoverableServersClient object. - */ - RecoverableServersClient getRecoverableServers(); - - /** - * Gets the ServerBasedPerformanceTiersClient object to access its operations. - * - * @return the ServerBasedPerformanceTiersClient object. - */ - ServerBasedPerformanceTiersClient getServerBasedPerformanceTiers(); - - /** - * Gets the LocationBasedPerformanceTiersClient object to access its operations. - * - * @return the LocationBasedPerformanceTiersClient object. - */ - LocationBasedPerformanceTiersClient getLocationBasedPerformanceTiers(); - /** * Gets the CheckNameAvailabilitiesClient object to access its operations. * @@ -129,37 +73,37 @@ public interface PostgreSqlManagementClient { CheckNameAvailabilitiesClient getCheckNameAvailabilities(); /** - * Gets the OperationsClient object to access its operations. + * Gets the LocationBasedCapabilitiesClient object to access its operations. * - * @return the OperationsClient object. + * @return the LocationBasedCapabilitiesClient object. */ - OperationsClient getOperations(); + LocationBasedCapabilitiesClient getLocationBasedCapabilities(); /** - * Gets the ServerSecurityAlertPoliciesClient object to access its operations. + * Gets the VirtualNetworkSubnetUsagesClient object to access its operations. * - * @return the ServerSecurityAlertPoliciesClient object. + * @return the VirtualNetworkSubnetUsagesClient object. */ - ServerSecurityAlertPoliciesClient getServerSecurityAlertPolicies(); + VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages(); /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the PrivateEndpointConnectionsClient object. + * @return the OperationsClient object. */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + OperationsClient getOperations(); /** - * Gets the PrivateLinkResourcesClient object to access its operations. + * Gets the DatabasesClient object to access its operations. * - * @return the PrivateLinkResourcesClient object. + * @return the DatabasesClient object. */ - PrivateLinkResourcesClient getPrivateLinkResources(); + DatabasesClient getDatabases(); /** - * Gets the ServerKeysClient object to access its operations. + * Gets the GetPrivateDnsZoneSuffixesClient object to access its operations. * - * @return the ServerKeysClient object. + * @return the GetPrivateDnsZoneSuffixesClient object. */ - ServerKeysClient getServerKeys(); + GetPrivateDnsZoneSuffixesClient getGetPrivateDnsZoneSuffixes(); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PrivateEndpointConnectionsClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index d07da5347aef..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.postgresql.models.TagsObject; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public interface PrivateEndpointConnectionsClient { - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String serverName, String privateEndpointConnectionName); - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters); - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String privateEndpointConnectionName); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PrivateEndpointConnectionInner> beginUpdateTags( - String resourceGroupName, String serverName, String privateEndpointConnectionName, TagsObject parameters); - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, PrivateEndpointConnectionInner> beginUpdateTags( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - TagsObject parameters, - Context context); - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner updateTags( - String resourceGroupName, String serverName, String privateEndpointConnectionName, TagsObject parameters); - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner updateTags( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - TagsObject parameters, - Context context); - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer( - String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PrivateLinkResourcesClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PrivateLinkResourcesClient.java deleted file mode 100644 index c2855b504bb4..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/PrivateLinkResourcesClient.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateLinkResourceInner; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public interface PrivateLinkResourcesClient { - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); - - /** - * Gets a private link resource for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner get(String resourceGroupName, String serverName, String groupName); - - /** - * Gets a private link resource for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, String groupName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ReplicasClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ReplicasClient.java deleted file mode 100644 index 0899459cb2a3..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ReplicasClient.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.ServerInner; - -/** An instance of this class provides access to all the operations defined in ReplicasClient. */ -public interface ReplicasClient { - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerAdministratorsClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerAdministratorsClient.java deleted file mode 100644 index 29e757a11c1b..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerAdministratorsClient.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.models.ServerAdministratorResourceInner; - -/** An instance of this class provides access to all the operations defined in ServerAdministratorsClient. */ -public interface ServerAdministratorsClient { - /** - * Gets information about a AAD server administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a AAD server administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerAdministratorResourceInner get(String resourceGroupName, String serverName); - - /** - * Gets information about a AAD server administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a AAD server administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, Context context); - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServerAdministratorResourceInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties); - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServerAdministratorResourceInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties, Context context); - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerAdministratorResourceInner createOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties); - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerAdministratorResourceInner createOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties, Context context); - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String serverName); - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String serverName, Context context); - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName); - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName, Context context); - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName); - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerBasedPerformanceTiersClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerBasedPerformanceTiersClient.java deleted file mode 100644 index f6fc274c05d8..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerBasedPerformanceTiersClient.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner; - -/** An instance of this class provides access to all the operations defined in ServerBasedPerformanceTiersClient. */ -public interface ServerBasedPerformanceTiersClient { - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerKeysClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerKeysClient.java deleted file mode 100644 index a6219b03909d..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerKeysClient.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.models.ServerKeyInner; - -/** An instance of this class provides access to all the operations defined in ServerKeysClient. */ -public interface ServerKeysClient { - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName); - - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serverName, Context context); - - /** - * Gets a PostgreSQL Server key. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerKeyInner get(String resourceGroupName, String serverName, String keyName); - - /** - * Gets a PostgreSQL Server key. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, String keyName, Context context); - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServerKeyInner> beginCreateOrUpdate( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters); - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServerKeyInner> beginCreateOrUpdate( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters, Context context); - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerKeyInner createOrUpdate( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters); - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerKeyInner createOrUpdate( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters, Context context); - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String serverName, String keyName, String resourceGroupName); - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String serverName, String keyName, String resourceGroupName, Context context); - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String serverName, String keyName, String resourceGroupName); - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String serverName, String keyName, String resourceGroupName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerParametersClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerParametersClient.java deleted file mode 100644 index 9bac4f2ae16f..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerParametersClient.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationListResultInner; - -/** An instance of this class provides access to all the operations defined in ServerParametersClient. */ -public interface ServerParametersClient { - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConfigurationListResultInner> beginListUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value); - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ConfigurationListResultInner> beginListUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value, Context context); - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationListResultInner listUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value); - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationListResultInner listUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerSecurityAlertPoliciesClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerSecurityAlertPoliciesClient.java deleted file mode 100644 index bf08fe1260d3..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServerSecurityAlertPoliciesClient.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.models.ServerSecurityAlertPolicyInner; -import com.azure.resourcemanager.postgresql.models.SecurityAlertPolicyName; - -/** An instance of this class provides access to all the operations defined in ServerSecurityAlertPoliciesClient. */ -public interface ServerSecurityAlertPoliciesClient { - /** - * Get a server's security alert policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerSecurityAlertPolicyInner get( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName); - - /** - * Get a server's security alert policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName, Context context); - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServerSecurityAlertPolicyInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters); - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, ServerSecurityAlertPolicyInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters, - Context context); - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerSecurityAlertPolicyInner createOrUpdate( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters); - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerSecurityAlertPolicyInner createOrUpdate( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters, - Context context); - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer( - String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServersClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServersClient.java index 76c89873fb5a..72fe81046aa0 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServersClient.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/ServersClient.java @@ -12,13 +12,13 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.postgresql.fluent.models.ServerInner; -import com.azure.resourcemanager.postgresql.models.ServerForCreate; -import com.azure.resourcemanager.postgresql.models.ServerUpdateParameters; +import com.azure.resourcemanager.postgresql.models.RestartParameter; +import com.azure.resourcemanager.postgresql.models.ServerForUpdate; /** An instance of this class provides access to all the operations defined in ServersClient. */ public interface ServersClient { /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -30,10 +30,10 @@ public interface ServersClient { */ @ServiceMethod(returns = ReturnType.SINGLE) SyncPoller, ServerInner> beginCreate( - String resourceGroupName, String serverName, ServerForCreate parameters); + String resourceGroupName, String serverName, ServerInner parameters); /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -46,10 +46,10 @@ SyncPoller, ServerInner> beginCreate( */ @ServiceMethod(returns = ReturnType.SINGLE) SyncPoller, ServerInner> beginCreate( - String resourceGroupName, String serverName, ServerForCreate parameters, Context context); + String resourceGroupName, String serverName, ServerInner parameters, Context context); /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -60,10 +60,10 @@ SyncPoller, ServerInner> beginCreate( * @return represents a server. */ @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner create(String resourceGroupName, String serverName, ServerForCreate parameters); + ServerInner create(String resourceGroupName, String serverName, ServerInner parameters); /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -75,7 +75,7 @@ SyncPoller, ServerInner> beginCreate( * @return represents a server. */ @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner create(String resourceGroupName, String serverName, ServerForCreate parameters, Context context); + ServerInner create(String resourceGroupName, String serverName, ServerInner parameters, Context context); /** * Updates an existing server. The request body can contain one to many of the properties present in the normal @@ -91,7 +91,7 @@ SyncPoller, ServerInner> beginCreate( */ @ServiceMethod(returns = ReturnType.SINGLE) SyncPoller, ServerInner> beginUpdate( - String resourceGroupName, String serverName, ServerUpdateParameters parameters); + String resourceGroupName, String serverName, ServerForUpdate parameters); /** * Updates an existing server. The request body can contain one to many of the properties present in the normal @@ -108,7 +108,7 @@ SyncPoller, ServerInner> beginUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) SyncPoller, ServerInner> beginUpdate( - String resourceGroupName, String serverName, ServerUpdateParameters parameters, Context context); + String resourceGroupName, String serverName, ServerForUpdate parameters, Context context); /** * Updates an existing server. The request body can contain one to many of the properties present in the normal @@ -123,7 +123,7 @@ SyncPoller, ServerInner> beginUpdate( * @return represents a server. */ @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner update(String resourceGroupName, String serverName, ServerUpdateParameters parameters); + ServerInner update(String resourceGroupName, String serverName, ServerForUpdate parameters); /** * Updates an existing server. The request body can contain one to many of the properties present in the normal @@ -139,7 +139,7 @@ SyncPoller, ServerInner> beginUpdate( * @return represents a server. */ @ServiceMethod(returns = ReturnType.SINGLE) - ServerInner update(String resourceGroupName, String serverName, ServerUpdateParameters parameters, Context context); + ServerInner update(String resourceGroupName, String serverName, ServerForUpdate parameters, Context context); /** * Deletes a server. @@ -272,19 +272,22 @@ SyncPoller, ServerInner> beginUpdate( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart(String resourceGroupName, String serverName); + SyncPoller, Void> beginRestart( + String resourceGroupName, String serverName, RestartParameter parameters); /** * Restarts a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -292,7 +295,21 @@ SyncPoller, ServerInner> beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart(String resourceGroupName, String serverName, Context context); + SyncPoller, Void> beginRestart( + String resourceGroupName, String serverName, RestartParameter parameters, Context context); + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String serverName, RestartParameter parameters); /** * Restarts a server. @@ -311,11 +328,116 @@ SyncPoller, ServerInner> beginUpdate( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String serverName, RestartParameter parameters, Context context); + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String resourceGroupName, String serverName); + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String resourceGroupName, String serverName, Context context); + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String serverName); + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String serverName, Context context); + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop(String resourceGroupName, String serverName); + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop(String resourceGroupName, String serverName, Context context); + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String serverName); + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String serverName, Context context); + void stop(String resourceGroupName, String serverName, Context context); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/VirtualNetworkRulesClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/VirtualNetworkRulesClient.java deleted file mode 100644 index 891d1044acf2..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/VirtualNetworkRulesClient.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkRuleInner; - -/** An instance of this class provides access to all the operations defined in VirtualNetworkRulesClient. */ -public interface VirtualNetworkRulesClient { - /** - * Gets a virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkRuleInner get(String resourceGroupName, String serverName, String virtualNetworkRuleName); - - /** - * Gets a virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context); - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkRuleInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters); - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, VirtualNetworkRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters, - Context context); - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkRuleInner createOrUpdate( - String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters); - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkRuleInner createOrUpdate( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters, - Context context); - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String virtualNetworkRuleName); - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context); - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName, String virtualNetworkRuleName); - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context); - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/VirtualNetworkSubnetUsagesClient.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/VirtualNetworkSubnetUsagesClient.java new file mode 100644 index 000000000000..deb4fe652ff6 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/VirtualNetworkSubnetUsagesClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkSubnetUsageResultInner; +import com.azure.resourcemanager.postgresql.models.VirtualNetworkSubnetUsageParameter; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkSubnetUsagesClient. */ +public interface VirtualNetworkSubnetUsagesClient { + /** + * Get virtual network subnet usage for a given vNet resource id. + * + * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual network subnet usage for a given vNet resource id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkSubnetUsageResultInner execute(String locationName, VirtualNetworkSubnetUsageParameter parameters); + + /** + * Get virtual network subnet usage for a given vNet resource id. + * + * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual network subnet usage for a given vNet resource id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response executeWithResponse( + String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context); +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/CapabilityPropertiesInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/CapabilityPropertiesInner.java new file mode 100644 index 000000000000..fcc2fad3c970 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/CapabilityPropertiesInner.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresql.models.ServerEditionCapability; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Location capabilities. */ +@Immutable +public final class CapabilityPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapabilityPropertiesInner.class); + + /* + * zone name + */ + @JsonProperty(value = "zone", access = JsonProperty.Access.WRITE_ONLY) + private String zone; + + /* + * The supportedFlexibleServerEditions property. + */ + @JsonProperty(value = "supportedFlexibleServerEditions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedFlexibleServerEditions; + + /** + * Get the zone property: zone name. + * + * @return the zone value. + */ + public String zone() { + return this.zone; + } + + /** + * Get the supportedFlexibleServerEditions property: The supportedFlexibleServerEditions property. + * + * @return the supportedFlexibleServerEditions value. + */ + public List supportedFlexibleServerEditions() { + return this.supportedFlexibleServerEditions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedFlexibleServerEditions() != null) { + supportedFlexibleServerEditions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ConfigurationInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ConfigurationInner.java index 6144c5ee6766..30660e145df3 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ConfigurationInner.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ConfigurationInner.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresql.models.ConfigurationDataType; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,6 +19,12 @@ public class ConfigurationInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationInner.class); + /* + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /* * Value of the configuration. */ @@ -39,7 +47,7 @@ public class ConfigurationInner extends ProxyResource { * Data type of the configuration. */ @JsonProperty(value = "properties.dataType", access = JsonProperty.Access.WRITE_ONLY) - private String dataType; + private ConfigurationDataType dataType; /* * Allowed values of the configuration. @@ -53,6 +61,15 @@ public class ConfigurationInner extends ProxyResource { @JsonProperty(value = "properties.source") private String source; + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the value property: Value of the configuration. * @@ -96,7 +113,7 @@ public String defaultValue() { * * @return the dataType value. */ - public String dataType() { + public ConfigurationDataType dataType() { return this.dataType; } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ConfigurationListResultInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ConfigurationListResultInner.java deleted file mode 100644 index 9d51951ef866..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ConfigurationListResultInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of server configurations. */ -@Fluent -public final class ConfigurationListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationListResultInner.class); - - /* - * The list of server configurations. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of server configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of server configurations. - * - * @param value the value value to set. - * @return the ConfigurationListResultInner object itself. - */ - public ConfigurationListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/DatabaseInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/DatabaseInner.java index a9845a9961da..87e13a8327f6 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/DatabaseInner.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/DatabaseInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,6 +18,12 @@ public class DatabaseInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseInner.class); + /* + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /* * The charset of the database. */ @@ -29,6 +36,15 @@ public class DatabaseInner extends ProxyResource { @JsonProperty(value = "properties.collation") private String collation; + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the charset property: The charset of the database. * diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/FirewallRuleInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/FirewallRuleInner.java index dbf01aea8ab6..61d847af6bcc 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/FirewallRuleInner.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/FirewallRuleInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -17,6 +18,12 @@ public class FirewallRuleInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRuleInner.class); + /* + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /* * The start IP address of the server firewall rule. Must be IPv4 format. */ @@ -29,6 +36,15 @@ public class FirewallRuleInner extends ProxyResource { @JsonProperty(value = "properties.endIpAddress", required = true) private String endIpAddress; + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 format. * diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/LogFileInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/LogFileInner.java deleted file mode 100644 index 8e4e22fa0e44..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/LogFileInner.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Represents a log file. */ -@JsonFlatten -@Fluent -public class LogFileInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogFileInner.class); - - /* - * 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 OffsetDateTime createdTime; - - /* - * Last modified timestamp of the log file. - */ - @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; - - /* - * Type of the log file. - */ - @JsonProperty(value = "properties.type") - private String typePropertiesType; - - /* - * The url to download the log file from. - */ - @JsonProperty(value = "properties.url") - private String url; - - /** - * Get the sizeInKB property: Size of the log file. - * - * @return the sizeInKB value. - */ - public Long sizeInKB() { - return this.sizeInKB; - } - - /** - * Set the sizeInKB property: 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 the createdTime property: Creation timestamp of the log file. - * - * @return the createdTime value. - */ - public OffsetDateTime createdTime() { - return this.createdTime; - } - - /** - * Get the lastModifiedTime property: Last modified timestamp of the log file. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; - } - - /** - * Get the typePropertiesType property: Type of the log file. - * - * @return the typePropertiesType value. - */ - public String typePropertiesType() { - return this.typePropertiesType; - } - - /** - * Set the typePropertiesType property: Type of the log file. - * - * @param typePropertiesType the typePropertiesType value to set. - * @return the LogFileInner object itself. - */ - public LogFileInner withTypePropertiesType(String typePropertiesType) { - this.typePropertiesType = typePropertiesType; - return this; - } - - /** - * Get the url property: The url to download the log file from. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: The url to download the log file from. - * - * @param url the url value to set. - * @return the LogFileInner object itself. - */ - public LogFileInner withUrl(String url) { - this.url = url; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/NameAvailabilityInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/NameAvailabilityInner.java index d91dc0f36d78..62188db7fe7e 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/NameAvailabilityInner.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/NameAvailabilityInner.java @@ -27,10 +27,16 @@ public final class NameAvailabilityInner { private Boolean nameAvailable; /* - * Reason for name being unavailable. + * name of the PostgreSQL server. */ - @JsonProperty(value = "reason") - private String reason; + @JsonProperty(value = "name") + private String name; + + /* + * type of the server + */ + @JsonProperty(value = "type") + private String type; /** * Get the message property: Error Message. @@ -73,22 +79,42 @@ public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { } /** - * Get the reason property: Reason for name being unavailable. + * Get the name property: name of the PostgreSQL server. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: name of the PostgreSQL server. + * + * @param name the name value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: type of the server. * - * @return the reason value. + * @return the type value. */ - public String reason() { - return this.reason; + public String type() { + return this.type; } /** - * Set the reason property: Reason for name being unavailable. + * Set the type property: type of the server. * - * @param reason the reason value to set. + * @param type the type value to set. * @return the NameAvailabilityInner object itself. */ - public NameAvailabilityInner withReason(String reason) { - this.reason = reason; + public NameAvailabilityInner withType(String type) { + this.type = type; return this; } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/OperationListResultInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/OperationListResultInner.java index 5c71f0055ef7..9e8030491e7b 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/OperationListResultInner.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/OperationListResultInner.java @@ -17,13 +17,20 @@ public final class OperationListResultInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResultInner.class); /* - * The list of resource provider operations. + * Collection of available operation details */ @JsonProperty(value = "value") private List value; + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + /** - * Get the value property: The list of resource provider operations. + * Get the value property: Collection of available operation details. * * @return the value value. */ @@ -32,7 +39,7 @@ public List value() { } /** - * Set the value property: The list of resource provider operations. + * Set the value property: Collection of available operation details. * * @param value the value value to set. * @return the OperationListResultInner object itself. @@ -42,6 +49,28 @@ public OperationListResultInner withValue(List value) { return this; } + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResultInner object itself. + */ + public OperationListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/PerformanceTierPropertiesInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/PerformanceTierPropertiesInner.java deleted file mode 100644 index 1725a09e0d8d..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/PerformanceTierPropertiesInner.java +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.models.PerformanceTierServiceLevelObjectives; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Performance tier properties. */ -@Fluent -public final class PerformanceTierPropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PerformanceTierPropertiesInner.class); - - /* - * ID of the performance tier. - */ - @JsonProperty(value = "id") - private String id; - - /* - * 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 = "minLargeStorageMB") - private Integer minLargeStorageMB; - - /* - * Max storage allowed for a server. - */ - @JsonProperty(value = "maxLargeStorageMB") - private Integer maxLargeStorageMB; - - /* - * Max storage allowed for a server. - */ - @JsonProperty(value = "minStorageMB") - private Integer minStorageMB; - - /* - * Service level objectives associated with the performance tier - */ - @JsonProperty(value = "serviceLevelObjectives") - private List serviceLevelObjectives; - - /** - * Get the id property: ID of the performance tier. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: 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 the maxBackupRetentionDays property: Maximum Backup retention in days for the performance tier edition. - * - * @return the maxBackupRetentionDays value. - */ - public Integer maxBackupRetentionDays() { - return this.maxBackupRetentionDays; - } - - /** - * Set the maxBackupRetentionDays property: Maximum Backup retention in days for the performance tier edition. - * - * @param maxBackupRetentionDays the maxBackupRetentionDays value to set. - * @return the PerformanceTierPropertiesInner object itself. - */ - public PerformanceTierPropertiesInner withMaxBackupRetentionDays(Integer maxBackupRetentionDays) { - this.maxBackupRetentionDays = maxBackupRetentionDays; - return this; - } - - /** - * Get the minBackupRetentionDays property: Minimum Backup retention in days for the performance tier edition. - * - * @return the minBackupRetentionDays value. - */ - public Integer minBackupRetentionDays() { - return this.minBackupRetentionDays; - } - - /** - * Set the minBackupRetentionDays property: Minimum Backup retention in days for the performance tier edition. - * - * @param minBackupRetentionDays the minBackupRetentionDays value to set. - * @return the PerformanceTierPropertiesInner object itself. - */ - public PerformanceTierPropertiesInner withMinBackupRetentionDays(Integer minBackupRetentionDays) { - this.minBackupRetentionDays = minBackupRetentionDays; - return this; - } - - /** - * Get the maxStorageMB property: Max storage allowed for a server. - * - * @return the maxStorageMB value. - */ - public Integer maxStorageMB() { - return this.maxStorageMB; - } - - /** - * Set the maxStorageMB property: Max storage allowed for a server. - * - * @param maxStorageMB the maxStorageMB value to set. - * @return the PerformanceTierPropertiesInner object itself. - */ - public PerformanceTierPropertiesInner withMaxStorageMB(Integer maxStorageMB) { - this.maxStorageMB = maxStorageMB; - return this; - } - - /** - * Get the minLargeStorageMB property: Max storage allowed for a server. - * - * @return the minLargeStorageMB value. - */ - public Integer minLargeStorageMB() { - return this.minLargeStorageMB; - } - - /** - * Set the minLargeStorageMB property: Max storage allowed for a server. - * - * @param minLargeStorageMB the minLargeStorageMB value to set. - * @return the PerformanceTierPropertiesInner object itself. - */ - public PerformanceTierPropertiesInner withMinLargeStorageMB(Integer minLargeStorageMB) { - this.minLargeStorageMB = minLargeStorageMB; - return this; - } - - /** - * Get the maxLargeStorageMB property: Max storage allowed for a server. - * - * @return the maxLargeStorageMB value. - */ - public Integer maxLargeStorageMB() { - return this.maxLargeStorageMB; - } - - /** - * Set the maxLargeStorageMB property: Max storage allowed for a server. - * - * @param maxLargeStorageMB the maxLargeStorageMB value to set. - * @return the PerformanceTierPropertiesInner object itself. - */ - public PerformanceTierPropertiesInner withMaxLargeStorageMB(Integer maxLargeStorageMB) { - this.maxLargeStorageMB = maxLargeStorageMB; - return this; - } - - /** - * Get the minStorageMB property: Max storage allowed for a server. - * - * @return the minStorageMB value. - */ - public Integer minStorageMB() { - return this.minStorageMB; - } - - /** - * Set the minStorageMB property: Max storage allowed for a server. - * - * @param minStorageMB the minStorageMB value to set. - * @return the PerformanceTierPropertiesInner object itself. - */ - public PerformanceTierPropertiesInner withMinStorageMB(Integer minStorageMB) { - this.minStorageMB = minStorageMB; - return this; - } - - /** - * Get the serviceLevelObjectives property: Service level objectives associated with the performance tier. - * - * @return the serviceLevelObjectives value. - */ - public List serviceLevelObjectives() { - return this.serviceLevelObjectives; - } - - /** - * Set the serviceLevelObjectives property: 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceLevelObjectives() != null) { - serviceLevelObjectives().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/PrivateEndpointConnectionInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index 0d6e626cc50a..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.models.PrivateEndpointProperty; -import com.azure.resourcemanager.postgresql.models.PrivateLinkServiceConnectionStateProperty; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A private endpoint connection. */ -@JsonFlatten -@Fluent -public class PrivateEndpointConnectionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); - - /* - * Private endpoint which the connection belongs to. - */ - @JsonProperty(value = "properties.privateEndpoint") - private PrivateEndpointProperty privateEndpoint; - - /* - * Connection state of the private endpoint connection. - */ - @JsonProperty(value = "properties.privateLinkServiceConnectionState") - private PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState; - - /* - * State of the private endpoint connection. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the privateEndpoint property: Private endpoint which the connection belongs to. - * - * @return the privateEndpoint value. - */ - public PrivateEndpointProperty privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: Private endpoint which the connection belongs to. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpointProperty privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: State of the private endpoint connection. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/PrivateLinkResourceInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/PrivateLinkResourceInner.java deleted file mode 100644 index 0d77c8c48ffc..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/PrivateLinkResourceInner.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.models.PrivateLinkResourceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A private link resource. */ -@Immutable -public final class PrivateLinkResourceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); - - /* - * The private link resource group id. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private PrivateLinkResourceProperties properties; - - /** - * Get the properties property: The private link resource group id. - * - * @return the properties value. - */ - public PrivateLinkResourceProperties properties() { - return this.properties; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/RecoverableServerResourceInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/RecoverableServerResourceInner.java deleted file mode 100644 index 9051a6767f6b..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/RecoverableServerResourceInner.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A recoverable server resource. */ -@JsonFlatten -@Immutable -public class RecoverableServerResourceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoverableServerResourceInner.class); - - /* - * The last available backup date time. - */ - @JsonProperty(value = "properties.lastAvailableBackupDateTime", access = JsonProperty.Access.WRITE_ONLY) - private String lastAvailableBackupDateTime; - - /* - * The service level objective - */ - @JsonProperty(value = "properties.serviceLevelObjective", access = JsonProperty.Access.WRITE_ONLY) - private String serviceLevelObjective; - - /* - * Edition of the performance tier. - */ - @JsonProperty(value = "properties.edition", access = JsonProperty.Access.WRITE_ONLY) - private String edition; - - /* - * vCore associated with the service level objective - */ - @JsonProperty(value = "properties.vCore", access = JsonProperty.Access.WRITE_ONLY) - private Integer vCore; - - /* - * Hardware generation associated with the service level objective - */ - @JsonProperty(value = "properties.hardwareGeneration", access = JsonProperty.Access.WRITE_ONLY) - private String hardwareGeneration; - - /* - * The PostgreSQL version - */ - @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /** - * Get the lastAvailableBackupDateTime property: The last available backup date time. - * - * @return the lastAvailableBackupDateTime value. - */ - public String lastAvailableBackupDateTime() { - return this.lastAvailableBackupDateTime; - } - - /** - * Get the serviceLevelObjective property: The service level objective. - * - * @return the serviceLevelObjective value. - */ - public String serviceLevelObjective() { - return this.serviceLevelObjective; - } - - /** - * Get the edition property: Edition of the performance tier. - * - * @return the edition value. - */ - public String edition() { - return this.edition; - } - - /** - * Get the vCore property: vCore associated with the service level objective. - * - * @return the vCore value. - */ - public Integer vCore() { - return this.vCore; - } - - /** - * Get the hardwareGeneration property: Hardware generation associated with the service level objective. - * - * @return the hardwareGeneration value. - */ - public String hardwareGeneration() { - return this.hardwareGeneration; - } - - /** - * Get the version property: The PostgreSQL version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerAdministratorResourceInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerAdministratorResourceInner.java deleted file mode 100644 index 634da3525aa6..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerAdministratorResourceInner.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.models.AdministratorType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.UUID; - -/** Represents a and external administrator to be created. */ -@JsonFlatten -@Fluent -public class ServerAdministratorResourceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerAdministratorResourceInner.class); - - /* - * The type of administrator. - */ - @JsonProperty(value = "properties.administratorType") - private AdministratorType administratorType; - - /* - * The server administrator login account name. - */ - @JsonProperty(value = "properties.login") - private String login; - - /* - * The server administrator Sid (Secure ID). - */ - @JsonProperty(value = "properties.sid") - private UUID sid; - - /* - * The server Active Directory Administrator tenant id. - */ - @JsonProperty(value = "properties.tenantId") - private UUID tenantId; - - /** - * Get the administratorType property: The type of administrator. - * - * @return the administratorType value. - */ - public AdministratorType administratorType() { - return this.administratorType; - } - - /** - * Set the administratorType property: The type of administrator. - * - * @param administratorType the administratorType value to set. - * @return the ServerAdministratorResourceInner object itself. - */ - public ServerAdministratorResourceInner withAdministratorType(AdministratorType administratorType) { - this.administratorType = administratorType; - return this; - } - - /** - * Get the login property: The server administrator login account name. - * - * @return the login value. - */ - public String login() { - return this.login; - } - - /** - * Set the login property: The server administrator login account name. - * - * @param login the login value to set. - * @return the ServerAdministratorResourceInner object itself. - */ - public ServerAdministratorResourceInner withLogin(String login) { - this.login = login; - return this; - } - - /** - * Get the sid property: The server administrator Sid (Secure ID). - * - * @return the sid value. - */ - public UUID sid() { - return this.sid; - } - - /** - * Set the sid property: The server administrator Sid (Secure ID). - * - * @param sid the sid value to set. - * @return the ServerAdministratorResourceInner object itself. - */ - public ServerAdministratorResourceInner withSid(UUID sid) { - this.sid = sid; - return this; - } - - /** - * Get the tenantId property: The server Active Directory Administrator tenant id. - * - * @return the tenantId value. - */ - public UUID tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The server Active Directory Administrator tenant id. - * - * @param tenantId the tenantId value to set. - * @return the ServerAdministratorResourceInner object itself. - */ - public ServerAdministratorResourceInner withTenantId(UUID tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerInner.java index 257652261d85..c87f6ccdf411 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerInner.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerInner.java @@ -7,21 +7,21 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.models.InfrastructureEncryption; -import com.azure.resourcemanager.postgresql.models.MinimalTlsVersionEnum; -import com.azure.resourcemanager.postgresql.models.PublicNetworkAccessEnum; -import com.azure.resourcemanager.postgresql.models.ResourceIdentity; -import com.azure.resourcemanager.postgresql.models.ServerPrivateEndpointConnection; +import com.azure.resourcemanager.postgresql.models.Backup; +import com.azure.resourcemanager.postgresql.models.CreateMode; +import com.azure.resourcemanager.postgresql.models.HighAvailability; +import com.azure.resourcemanager.postgresql.models.Identity; +import com.azure.resourcemanager.postgresql.models.MaintenanceWindow; +import com.azure.resourcemanager.postgresql.models.Network; import com.azure.resourcemanager.postgresql.models.ServerState; import com.azure.resourcemanager.postgresql.models.ServerVersion; import com.azure.resourcemanager.postgresql.models.Sku; -import com.azure.resourcemanager.postgresql.models.SslEnforcementEnum; -import com.azure.resourcemanager.postgresql.models.StorageProfile; +import com.azure.resourcemanager.postgresql.models.Storage; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -import java.util.List; import java.util.Map; /** Represents a server. */ @@ -34,7 +34,7 @@ public class ServerInner extends Resource { * The Azure Active Directory identity of the server. */ @JsonProperty(value = "identity") - private ResourceIdentity identity; + private Identity identity; /* * The SKU (pricing tier) of the server. @@ -42,6 +42,12 @@ public class ServerInner extends Resource { @JsonProperty(value = "sku") private Sku sku; + /* + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /* * The administrator's login name of a server. Can only be specified when * the server is being created (and is required for creation). @@ -50,97 +56,103 @@ public class ServerInner extends Resource { private String administratorLogin; /* - * Server version. + * The administrator login password (required for server creation). + */ + @JsonProperty(value = "properties.administratorLoginPassword") + private String administratorLoginPassword; + + /* + * PostgreSQL Server version. */ @JsonProperty(value = "properties.version") private ServerVersion version; /* - * Enable ssl enforcement or not when connect to server. + * The minor version of the server. */ - @JsonProperty(value = "properties.sslEnforcement") - private SslEnforcementEnum sslEnforcement; + @JsonProperty(value = "properties.minorVersion", access = JsonProperty.Access.WRITE_ONLY) + private String minorVersion; /* - * Enforce a minimal Tls version for the server. + * A state of a server that is visible to user. */ - @JsonProperty(value = "properties.minimalTlsVersion") - private MinimalTlsVersionEnum minimalTlsVersion; + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private ServerState state; /* - * Status showing whether the server data encryption is enabled with - * customer-managed keys. + * The fully qualified domain name of a server. */ - @JsonProperty(value = "properties.byokEnforcement", access = JsonProperty.Access.WRITE_ONLY) - private String byokEnforcement; + @JsonProperty(value = "properties.fullyQualifiedDomainName", access = JsonProperty.Access.WRITE_ONLY) + private String fullyQualifiedDomainName; /* - * Status showing whether the server enabled infrastructure encryption. + * Storage properties of a server. */ - @JsonProperty(value = "properties.infrastructureEncryption") - private InfrastructureEncryption infrastructureEncryption; + @JsonProperty(value = "properties.storage") + private Storage storage; /* - * A state of a server that is visible to user. + * Backup properties of a server. */ - @JsonProperty(value = "properties.userVisibleState") - private ServerState userVisibleState; + @JsonProperty(value = "properties.backup") + private Backup backup; /* - * The fully qualified domain name of a server. + * Network properties of a server. */ - @JsonProperty(value = "properties.fullyQualifiedDomainName") - private String fullyQualifiedDomainName; + @JsonProperty(value = "properties.network") + private Network network; /* - * Earliest restore point creation time (ISO8601 format) + * High availability properties of a server. */ - @JsonProperty(value = "properties.earliestRestoreDate") - private OffsetDateTime earliestRestoreDate; + @JsonProperty(value = "properties.highAvailability") + private HighAvailability highAvailability; /* - * Storage profile of a server. + * Maintenance window properties of a server. */ - @JsonProperty(value = "properties.storageProfile") - private StorageProfile storageProfile; + @JsonProperty(value = "properties.maintenanceWindow") + private MaintenanceWindow maintenanceWindow; /* - * The replication role of the server. + * The source server resource ID to restore from. It's required when + * 'createMode' is 'PointInTimeRestore'. */ - @JsonProperty(value = "properties.replicationRole") - private String replicationRole; + @JsonProperty(value = "properties.sourceServerResourceId") + private String sourceServerResourceId; /* - * The master server id of a replica server. + * Restore point creation time (ISO8601 format), specifying the time to + * restore from. It's required when 'createMode' is 'PointInTimeRestore'. */ - @JsonProperty(value = "properties.masterServerId") - private String masterServerId; + @JsonProperty(value = "properties.pointInTimeUTC") + private OffsetDateTime pointInTimeUtc; /* - * The maximum number of replicas that a master server can have. + * availability zone information of the server. */ - @JsonProperty(value = "properties.replicaCapacity") - private Integer replicaCapacity; + @JsonProperty(value = "properties.availabilityZone") + private String availabilityZone; /* - * Whether or not public network access is allowed for this server. Value - * is optional but if passed in, must be 'Enabled' or 'Disabled' + * The mode to create a new PostgreSQL server. */ - @JsonProperty(value = "properties.publicNetworkAccess") - private PublicNetworkAccessEnum publicNetworkAccess; + @JsonProperty(value = "properties.createMode") + private CreateMode createMode; /* - * List of private endpoint connections on a server + * Application-specific metadata in the form of key-value pairs. */ - @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; + @JsonProperty(value = "properties.tags") + private Map tagsPropertiesTags; /** * Get the identity property: The Azure Active Directory identity of the server. * * @return the identity value. */ - public ResourceIdentity identity() { + public Identity identity() { return this.identity; } @@ -150,7 +162,7 @@ public ResourceIdentity identity() { * @param identity the identity value to set. * @return the ServerInner object itself. */ - public ServerInner withIdentity(ResourceIdentity identity) { + public ServerInner withIdentity(Identity identity) { this.identity = identity; return this; } @@ -175,6 +187,15 @@ public ServerInner withSku(Sku sku) { return this; } + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the administratorLogin property: The administrator's login name of a server. Can only be specified when the * server is being created (and is required for creation). @@ -198,264 +219,274 @@ public ServerInner withAdministratorLogin(String administratorLogin) { } /** - * Get the version property: Server version. + * Get the administratorLoginPassword property: The administrator login password (required for server creation). * - * @return the version value. + * @return the administratorLoginPassword value. */ - public ServerVersion version() { - return this.version; + public String administratorLoginPassword() { + return this.administratorLoginPassword; } /** - * Set the version property: Server version. + * Set the administratorLoginPassword property: The administrator login password (required for server creation). * - * @param version the version value to set. + * @param administratorLoginPassword the administratorLoginPassword value to set. * @return the ServerInner object itself. */ - public ServerInner withVersion(ServerVersion version) { - this.version = version; + public ServerInner withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; return this; } /** - * Get the sslEnforcement property: Enable ssl enforcement or not when connect to server. + * Get the version property: PostgreSQL Server version. * - * @return the sslEnforcement value. + * @return the version value. */ - public SslEnforcementEnum sslEnforcement() { - return this.sslEnforcement; + public ServerVersion version() { + return this.version; } /** - * Set the sslEnforcement property: Enable ssl enforcement or not when connect to server. + * Set the version property: PostgreSQL Server version. * - * @param sslEnforcement the sslEnforcement value to set. + * @param version the version value to set. * @return the ServerInner object itself. */ - public ServerInner withSslEnforcement(SslEnforcementEnum sslEnforcement) { - this.sslEnforcement = sslEnforcement; + public ServerInner withVersion(ServerVersion version) { + this.version = version; return this; } /** - * Get the minimalTlsVersion property: Enforce a minimal Tls version for the server. + * Get the minorVersion property: The minor version of the server. * - * @return the minimalTlsVersion value. + * @return the minorVersion value. */ - public MinimalTlsVersionEnum minimalTlsVersion() { - return this.minimalTlsVersion; + public String minorVersion() { + return this.minorVersion; } /** - * Set the minimalTlsVersion property: Enforce a minimal Tls version for the server. + * Get the state property: A state of a server that is visible to user. * - * @param minimalTlsVersion the minimalTlsVersion value to set. - * @return the ServerInner object itself. + * @return the state value. */ - public ServerInner withMinimalTlsVersion(MinimalTlsVersionEnum minimalTlsVersion) { - this.minimalTlsVersion = minimalTlsVersion; - return this; + public ServerState state() { + return this.state; } /** - * Get the byokEnforcement property: Status showing whether the server data encryption is enabled with - * customer-managed keys. + * Get the fullyQualifiedDomainName property: The fully qualified domain name of a server. * - * @return the byokEnforcement value. + * @return the fullyQualifiedDomainName value. */ - public String byokEnforcement() { - return this.byokEnforcement; + public String fullyQualifiedDomainName() { + return this.fullyQualifiedDomainName; } /** - * Get the infrastructureEncryption property: Status showing whether the server enabled infrastructure encryption. + * Get the storage property: Storage properties of a server. * - * @return the infrastructureEncryption value. + * @return the storage value. */ - public InfrastructureEncryption infrastructureEncryption() { - return this.infrastructureEncryption; + public Storage storage() { + return this.storage; } /** - * Set the infrastructureEncryption property: Status showing whether the server enabled infrastructure encryption. + * Set the storage property: Storage properties of a server. * - * @param infrastructureEncryption the infrastructureEncryption value to set. + * @param storage the storage value to set. * @return the ServerInner object itself. */ - public ServerInner withInfrastructureEncryption(InfrastructureEncryption infrastructureEncryption) { - this.infrastructureEncryption = infrastructureEncryption; + public ServerInner withStorage(Storage storage) { + this.storage = storage; return this; } /** - * Get the userVisibleState property: A state of a server that is visible to user. + * Get the backup property: Backup properties of a server. * - * @return the userVisibleState value. + * @return the backup value. */ - public ServerState userVisibleState() { - return this.userVisibleState; + public Backup backup() { + return this.backup; } /** - * Set the userVisibleState property: A state of a server that is visible to user. + * Set the backup property: Backup properties of a server. * - * @param userVisibleState the userVisibleState value to set. + * @param backup the backup value to set. * @return the ServerInner object itself. */ - public ServerInner withUserVisibleState(ServerState userVisibleState) { - this.userVisibleState = userVisibleState; + public ServerInner withBackup(Backup backup) { + this.backup = backup; return this; } /** - * Get the fullyQualifiedDomainName property: The fully qualified domain name of a server. + * Get the network property: Network properties of a server. * - * @return the fullyQualifiedDomainName value. + * @return the network value. */ - public String fullyQualifiedDomainName() { - return this.fullyQualifiedDomainName; + public Network network() { + return this.network; } /** - * Set the fullyQualifiedDomainName property: The fully qualified domain name of a server. + * Set the network property: Network properties of a server. * - * @param fullyQualifiedDomainName the fullyQualifiedDomainName value to set. + * @param network the network value to set. * @return the ServerInner object itself. */ - public ServerInner withFullyQualifiedDomainName(String fullyQualifiedDomainName) { - this.fullyQualifiedDomainName = fullyQualifiedDomainName; + public ServerInner withNetwork(Network network) { + this.network = network; return this; } /** - * Get the earliestRestoreDate property: Earliest restore point creation time (ISO8601 format). + * Get the highAvailability property: High availability properties of a server. * - * @return the earliestRestoreDate value. + * @return the highAvailability value. */ - public OffsetDateTime earliestRestoreDate() { - return this.earliestRestoreDate; + public HighAvailability highAvailability() { + return this.highAvailability; } /** - * Set the earliestRestoreDate property: Earliest restore point creation time (ISO8601 format). + * Set the highAvailability property: High availability properties of a server. * - * @param earliestRestoreDate the earliestRestoreDate value to set. + * @param highAvailability the highAvailability value to set. * @return the ServerInner object itself. */ - public ServerInner withEarliestRestoreDate(OffsetDateTime earliestRestoreDate) { - this.earliestRestoreDate = earliestRestoreDate; + public ServerInner withHighAvailability(HighAvailability highAvailability) { + this.highAvailability = highAvailability; return this; } /** - * Get the storageProfile property: Storage profile of a server. + * Get the maintenanceWindow property: Maintenance window properties of a server. * - * @return the storageProfile value. + * @return the maintenanceWindow value. */ - public StorageProfile storageProfile() { - return this.storageProfile; + public MaintenanceWindow maintenanceWindow() { + return this.maintenanceWindow; } /** - * Set the storageProfile property: Storage profile of a server. + * Set the maintenanceWindow property: Maintenance window properties of a server. * - * @param storageProfile the storageProfile value to set. + * @param maintenanceWindow the maintenanceWindow value to set. * @return the ServerInner object itself. */ - public ServerInner withStorageProfile(StorageProfile storageProfile) { - this.storageProfile = storageProfile; + public ServerInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { + this.maintenanceWindow = maintenanceWindow; return this; } /** - * Get the replicationRole property: The replication role of the server. + * Get the sourceServerResourceId property: The source server resource ID to restore from. It's required when + * 'createMode' is 'PointInTimeRestore'. * - * @return the replicationRole value. + * @return the sourceServerResourceId value. */ - public String replicationRole() { - return this.replicationRole; + public String sourceServerResourceId() { + return this.sourceServerResourceId; } /** - * Set the replicationRole property: The replication role of the server. + * Set the sourceServerResourceId property: The source server resource ID to restore from. It's required when + * 'createMode' is 'PointInTimeRestore'. * - * @param replicationRole the replicationRole value to set. + * @param sourceServerResourceId the sourceServerResourceId value to set. * @return the ServerInner object itself. */ - public ServerInner withReplicationRole(String replicationRole) { - this.replicationRole = replicationRole; + public ServerInner withSourceServerResourceId(String sourceServerResourceId) { + this.sourceServerResourceId = sourceServerResourceId; return this; } /** - * Get the masterServerId property: The master server id of a replica server. + * Get the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore + * from. It's required when 'createMode' is 'PointInTimeRestore'. * - * @return the masterServerId value. + * @return the pointInTimeUtc value. */ - public String masterServerId() { - return this.masterServerId; + public OffsetDateTime pointInTimeUtc() { + return this.pointInTimeUtc; } /** - * Set the masterServerId property: The master server id of a replica server. + * Set the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore + * from. It's required when 'createMode' is 'PointInTimeRestore'. * - * @param masterServerId the masterServerId value to set. + * @param pointInTimeUtc the pointInTimeUtc value to set. * @return the ServerInner object itself. */ - public ServerInner withMasterServerId(String masterServerId) { - this.masterServerId = masterServerId; + public ServerInner withPointInTimeUtc(OffsetDateTime pointInTimeUtc) { + this.pointInTimeUtc = pointInTimeUtc; return this; } /** - * Get the replicaCapacity property: The maximum number of replicas that a master server can have. + * Get the availabilityZone property: availability zone information of the server. * - * @return the replicaCapacity value. + * @return the availabilityZone value. */ - public Integer replicaCapacity() { - return this.replicaCapacity; + public String availabilityZone() { + return this.availabilityZone; } /** - * Set the replicaCapacity property: The maximum number of replicas that a master server can have. + * Set the availabilityZone property: availability zone information of the server. * - * @param replicaCapacity the replicaCapacity value to set. + * @param availabilityZone the availabilityZone value to set. * @return the ServerInner object itself. */ - public ServerInner withReplicaCapacity(Integer replicaCapacity) { - this.replicaCapacity = replicaCapacity; + public ServerInner withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; return this; } /** - * Get the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * optional but if passed in, must be 'Enabled' or 'Disabled'. + * Get the createMode property: The mode to create a new PostgreSQL server. * - * @return the publicNetworkAccess value. + * @return the createMode value. */ - public PublicNetworkAccessEnum publicNetworkAccess() { - return this.publicNetworkAccess; + public CreateMode createMode() { + return this.createMode; } /** - * Set the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * optional but if passed in, must be 'Enabled' or 'Disabled'. + * Set the createMode property: The mode to create a new PostgreSQL server. * - * @param publicNetworkAccess the publicNetworkAccess value to set. + * @param createMode the createMode value to set. * @return the ServerInner object itself. */ - public ServerInner withPublicNetworkAccess(PublicNetworkAccessEnum publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; + public ServerInner withCreateMode(CreateMode createMode) { + this.createMode = createMode; return this; } /** - * Get the privateEndpointConnections property: List of private endpoint connections on a server. + * Get the tagsPropertiesTags property: Application-specific metadata in the form of key-value pairs. + * + * @return the tagsPropertiesTags value. + */ + public Map tagsPropertiesTags() { + return this.tagsPropertiesTags; + } + + /** + * Set the tagsPropertiesTags property: Application-specific metadata in the form of key-value pairs. * - * @return the privateEndpointConnections value. + * @param tagsPropertiesTags the tagsPropertiesTags value to set. + * @return the ServerInner object itself. */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; + public ServerInner withTagsPropertiesTags(Map tagsPropertiesTags) { + this.tagsPropertiesTags = tagsPropertiesTags; + return this; } /** {@inheritDoc} */ @@ -484,11 +515,20 @@ public void validate() { if (sku() != null) { sku().validate(); } - if (storageProfile() != null) { - storageProfile().validate(); + if (storage() != null) { + storage().validate(); + } + if (backup() != null) { + backup().validate(); + } + if (network() != null) { + network().validate(); + } + if (highAvailability() != null) { + highAvailability().validate(); } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); + if (maintenanceWindow() != null) { + maintenanceWindow().validate(); } } } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerKeyInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerKeyInner.java deleted file mode 100644 index d6dfab65ab03..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerKeyInner.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.models.ServerKeyType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A PostgreSQL Server key. */ -@JsonFlatten -@Fluent -public class ServerKeyInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerKeyInner.class); - - /* - * Kind of encryption protector used to protect the key. - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /* - * The key type like 'AzureKeyVault'. - */ - @JsonProperty(value = "properties.serverKeyType") - private ServerKeyType serverKeyType; - - /* - * The URI of the key. - */ - @JsonProperty(value = "properties.uri") - private String uri; - - /* - * The key creation date. - */ - @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationDate; - - /** - * Get the kind property: Kind of encryption protector used to protect the key. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the serverKeyType property: The key type like 'AzureKeyVault'. - * - * @return the serverKeyType value. - */ - public ServerKeyType serverKeyType() { - return this.serverKeyType; - } - - /** - * Set the serverKeyType property: The key type like 'AzureKeyVault'. - * - * @param serverKeyType the serverKeyType value to set. - * @return the ServerKeyInner object itself. - */ - public ServerKeyInner withServerKeyType(ServerKeyType serverKeyType) { - this.serverKeyType = serverKeyType; - return this; - } - - /** - * Get the uri property: The URI of the key. - * - * @return the uri value. - */ - public String uri() { - return this.uri; - } - - /** - * Set the uri property: The URI of the key. - * - * @param uri the uri value to set. - * @return the ServerKeyInner object itself. - */ - public ServerKeyInner withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * Get the creationDate property: The key creation date. - * - * @return the creationDate value. - */ - public OffsetDateTime creationDate() { - return this.creationDate; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerSecurityAlertPolicyInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerSecurityAlertPolicyInner.java deleted file mode 100644 index 8d0c48b2bb87..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/ServerSecurityAlertPolicyInner.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.models.ServerSecurityAlertPolicyState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A server security alert policy. */ -@JsonFlatten -@Fluent -public class ServerSecurityAlertPolicyInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerSecurityAlertPolicyInner.class); - - /* - * Specifies the state of the policy, whether it is enabled or disabled. - */ - @JsonProperty(value = "properties.state") - 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 the state property: Specifies the state of the policy, whether it is enabled or disabled. - * - * @return the state value. - */ - public ServerSecurityAlertPolicyState state() { - return this.state; - } - - /** - * Set the state property: Specifies the state of the policy, whether it is enabled or disabled. - * - * @param state the state value to set. - * @return the ServerSecurityAlertPolicyInner object itself. - */ - public ServerSecurityAlertPolicyInner withState(ServerSecurityAlertPolicyState state) { - this.state = state; - return this; - } - - /** - * Get the disabledAlerts property: 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 the disabledAlerts property: 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 the emailAddresses property: Specifies an array of e-mail addresses to which the alert is sent. - * - * @return the emailAddresses value. - */ - public List emailAddresses() { - return this.emailAddresses; - } - - /** - * Set the emailAddresses property: 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 the emailAccountAdmins property: Specifies that the alert is sent to the account administrators. - * - * @return the emailAccountAdmins value. - */ - public Boolean emailAccountAdmins() { - return this.emailAccountAdmins; - } - - /** - * Set the emailAccountAdmins property: 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 the storageEndpoint property: 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 the storageEndpoint property: 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 the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection audit storage - * account. - * - * @return the storageAccountAccessKey value. - */ - public String storageAccountAccessKey() { - return this.storageAccountAccessKey; - } - - /** - * Set the storageAccountAccessKey property: 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 the retentionDays property: Specifies the number of days to keep in the Threat Detection audit logs. - * - * @return the retentionDays value. - */ - public Integer retentionDays() { - return this.retentionDays; - } - - /** - * Set the retentionDays property: 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/VirtualNetworkRuleInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/VirtualNetworkRuleInner.java deleted file mode 100644 index bb35751de614..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/VirtualNetworkRuleInner.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.models.VirtualNetworkRuleState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A virtual network rule. */ -@JsonFlatten -@Fluent -public class VirtualNetworkRuleInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRuleInner.class); - - /* - * The ARM resource id of the virtual network subnet. - */ - @JsonProperty(value = "properties.virtualNetworkSubnetId") - 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 - */ - @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) - private VirtualNetworkRuleState state; - - /** - * Get the virtualNetworkSubnetId property: The ARM resource id of the virtual network subnet. - * - * @return the virtualNetworkSubnetId value. - */ - public String virtualNetworkSubnetId() { - return this.virtualNetworkSubnetId; - } - - /** - * Set the virtualNetworkSubnetId property: 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 the ignoreMissingVnetServiceEndpoint property: Create firewall rule before the virtual network has vnet - * service endpoint enabled. - * - * @return the ignoreMissingVnetServiceEndpoint value. - */ - public Boolean ignoreMissingVnetServiceEndpoint() { - return this.ignoreMissingVnetServiceEndpoint; - } - - /** - * Set the ignoreMissingVnetServiceEndpoint property: 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 the state property: Virtual Network Rule State. - * - * @return the state value. - */ - public VirtualNetworkRuleState state() { - return this.state; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/VirtualNetworkSubnetUsageResultInner.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/VirtualNetworkSubnetUsageResultInner.java new file mode 100644 index 000000000000..e1d0793f9092 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/fluent/models/VirtualNetworkSubnetUsageResultInner.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresql.models.DelegatedSubnetUsage; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Virtual network subnet usage data. */ +@Immutable +public final class VirtualNetworkSubnetUsageResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkSubnetUsageResultInner.class); + + /* + * The delegatedSubnetsUsage property. + */ + @JsonProperty(value = "delegatedSubnetsUsage", access = JsonProperty.Access.WRITE_ONLY) + private List delegatedSubnetsUsage; + + /** + * Get the delegatedSubnetsUsage property: The delegatedSubnetsUsage property. + * + * @return the delegatedSubnetsUsage value. + */ + public List delegatedSubnetsUsage() { + return this.delegatedSubnetsUsage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (delegatedSubnetsUsage() != null) { + delegatedSubnetsUsage().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/CapabilityPropertiesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/CapabilityPropertiesImpl.java new file mode 100644 index 000000000000..80dc3c89156c --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/CapabilityPropertiesImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.implementation; + +import com.azure.resourcemanager.postgresql.fluent.models.CapabilityPropertiesInner; +import com.azure.resourcemanager.postgresql.models.CapabilityProperties; +import com.azure.resourcemanager.postgresql.models.ServerEditionCapability; +import java.util.Collections; +import java.util.List; + +public final class CapabilityPropertiesImpl implements CapabilityProperties { + private CapabilityPropertiesInner innerObject; + + private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; + + CapabilityPropertiesImpl( + CapabilityPropertiesInner innerObject, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String zone() { + return this.innerModel().zone(); + } + + public List supportedFlexibleServerEditions() { + List inner = this.innerModel().supportedFlexibleServerEditions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CapabilityPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/CheckNameAvailabilitiesClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/CheckNameAvailabilitiesClientImpl.java index 4efbaad126eb..6f403c3eb7d5 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/CheckNameAvailabilitiesClientImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/CheckNameAvailabilitiesClientImpl.java @@ -58,7 +58,7 @@ public final class CheckNameAvailabilitiesClientImpl implements CheckNameAvailab @ServiceInterface(name = "PostgreSqlManagement") private interface CheckNameAvailabilitiesService { @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSQL/checkNameAvailability") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSql/checkNameAvailability") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> execute( @@ -101,7 +101,6 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -109,7 +108,7 @@ private Mono> executeWithResponseAsync( service .execute( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), nameAvailabilityRequest, accept, @@ -149,13 +148,12 @@ private Mono> executeWithResponseAsync( } else { nameAvailabilityRequest.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .execute( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), nameAvailabilityRequest, accept, diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationImpl.java index beeee8868b35..b17ed60fe2a1 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationImpl.java @@ -4,9 +4,11 @@ package com.azure.resourcemanager.postgresql.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationInner; import com.azure.resourcemanager.postgresql.models.Configuration; +import com.azure.resourcemanager.postgresql.models.ConfigurationDataType; public final class ConfigurationImpl implements Configuration, Configuration.Definition, Configuration.Update { private ConfigurationInner innerObject; @@ -25,6 +27,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String value() { return this.innerModel().value(); } @@ -37,7 +43,7 @@ public String defaultValue() { return this.innerModel().defaultValue(); } - public String dataType() { + public ConfigurationDataType dataType() { return this.innerModel().dataType(); } @@ -63,7 +69,7 @@ private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { private String configurationName; - public ConfigurationImpl withExistingServer(String resourceGroupName, String serverName) { + public ConfigurationImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { this.resourceGroupName = resourceGroupName; this.serverName = serverName; return this; @@ -74,7 +80,7 @@ public Configuration create() { serviceManager .serviceClient() .getConfigurations() - .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); + .put(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); return this; } @@ -83,7 +89,7 @@ public Configuration create(Context context) { serviceManager .serviceClient() .getConfigurations() - .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), context); + .put(resourceGroupName, serverName, configurationName, this.innerModel(), context); return this; } @@ -102,7 +108,7 @@ public Configuration apply() { serviceManager .serviceClient() .getConfigurations() - .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); + .update(resourceGroupName, serverName, configurationName, this.innerModel(), Context.NONE); return this; } @@ -111,7 +117,7 @@ public Configuration apply(Context context) { serviceManager .serviceClient() .getConfigurations() - .createOrUpdate(resourceGroupName, serverName, configurationName, this.innerModel(), context); + .update(resourceGroupName, serverName, configurationName, this.innerModel(), context); return this; } @@ -120,7 +126,7 @@ public Configuration apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "servers"); + this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); this.configurationName = Utils.getValueFromIdByName(innerObject.id(), "configurations"); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationListResultImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationListResultImpl.java deleted file mode 100644 index 611e72323e0c..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationListResultImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationListResultInner; -import com.azure.resourcemanager.postgresql.models.Configuration; -import com.azure.resourcemanager.postgresql.models.ConfigurationListResult; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class ConfigurationListResultImpl implements ConfigurationListResult { - private ConfigurationListResultInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - ConfigurationListResultImpl( - ConfigurationListResultInner innerObject, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new ConfigurationImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public ConfigurationListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationsClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationsClientImpl.java index ed144ca55b0e..664cd8f6a7dd 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationsClientImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationsClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; @@ -33,7 +34,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.postgresql.fluent.ConfigurationsClient; import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationListResultInner; +import com.azure.resourcemanager.postgresql.models.ConfigurationListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,26 +68,24 @@ public final class ConfigurationsClientImpl implements ConfigurationsClient { @ServiceInterface(name = "PostgreSqlManagement") private interface ConfigurationsService { @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/configurations/{configurationName}") - @ExpectedResponses({200, 202}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/configurations") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( + Mono> listByServer( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @PathParam("configurationName") String configurationName, - @BodyParam("application/json") ConfigurationInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/configurations/{configurationName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/configurations/{configurationName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -100,36 +99,63 @@ Mono> get( Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/configurations") - @ExpectedResponses({200}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/configurations/{configurationName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @PathParam("configurationName") String configurationName, + @BodyParam("application/json") ConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/configurations/{configurationName}") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( + Mono>> put( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @PathParam("configurationName") String configurationName, + @BodyParam("application/json") ConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Updates a configuration of a server. + * List all the configurations in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. + * @return a list of server configurations. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + private Mono> listByServerSinglePageAsync( + String resourceGroupName, String serverName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -149,54 +175,45 @@ private Mono>> createOrUpdateWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createOrUpdate( + .listByServer( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, - configurationName, - parameters, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a configuration of a server. + * List all the configurations in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. + * @return a list of server configurations. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context) { + private Mono> listByServerSinglePageAsync( + String resourceGroupName, String serverName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -216,209 +233,94 @@ private Mono>> createOrUpdateWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( + .listByServer( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, - configurationName, - parameters, accept, - context); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ConfigurationInner.class, ConfigurationInner.class, Context.NONE); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ConfigurationInner.class, ConfigurationInner.class, context); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters).getSyncPoller(); - } - - /** - * Updates a configuration of a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context) - .getSyncPoller(); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Updates a configuration of a server. + * List all the configurations in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. + * @return a list of server configurations. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); } /** - * Updates a configuration of a server. + * List all the configurations in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. + * @return a list of server configurations. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync( + String resourceGroupName, String serverName, Context context) { + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePageAsync(nextLink, context)); } /** - * Updates a configuration of a server. + * List all the configurations in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. + * @return a list of server configurations. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationInner createOrUpdate( - String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); } /** - * Updates a configuration of a server. + * List all the configurations in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param configurationName The name of the server configuration. - * @param parameters The required parameters for updating a server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a Configuration. + * @return a list of server configurations. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationInner createOrUpdate( - String resourceGroupName, - String serverName, - String configurationName, - ConfigurationInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer( + String resourceGroupName, String serverName, Context context) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); } /** @@ -458,7 +360,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -466,7 +367,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -514,13 +415,12 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -588,18 +488,20 @@ public Response getWithResponse( } /** - * List all the configurations in a given server. + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. + * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -619,41 +521,53 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByServer( + .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, + configurationName, + parameters, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all the configurations in a given server. + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. + * @return represents a Configuration. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName, Context context) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -673,85 +587,580 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByServer( + .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, + configurationName, + parameters, accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + context); } /** - * List all the configurations in a given server. + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. + * @return represents a Configuration. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConfigurationInner> beginUpdateAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConfigurationInner.class, ConfigurationInner.class, Context.NONE); } /** - * List all the configurations in a given server. + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. + * @return represents a Configuration. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync( - String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConfigurationInner> beginUpdateAsync( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serverName, configurationName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConfigurationInner.class, ConfigurationInner.class, context); } /** - * List all the configurations in a given server. + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. + * @return represents a Configuration. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConfigurationInner> beginUpdate( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return beginUpdateAsync(resourceGroupName, serverName, configurationName, parameters).getSyncPoller(); } /** - * List all the configurations in a given server. + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConfigurationInner> beginUpdate( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context).getSyncPoller(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return beginUpdateAsync(resourceGroupName, serverName, configurationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serverName, configurationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationInner update( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return updateAsync(resourceGroupName, serverName, configurationName, parameters).block(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationInner update( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + return updateAsync(resourceGroupName, serverName, configurationName, parameters, context).block(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putWithResponseAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + configurationName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putWithResponseAsync( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + configurationName, + parameters, + accept, + context); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConfigurationInner> beginPutAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + Mono>> mono = + putWithResponseAsync(resourceGroupName, serverName, configurationName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConfigurationInner.class, ConfigurationInner.class, Context.NONE); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConfigurationInner> beginPutAsync( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + putWithResponseAsync(resourceGroupName, serverName, configurationName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConfigurationInner.class, ConfigurationInner.class, context); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConfigurationInner> beginPut( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return beginPutAsync(resourceGroupName, serverName, configurationName, parameters).getSyncPoller(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConfigurationInner> beginPut( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + return beginPutAsync(resourceGroupName, serverName, configurationName, parameters, context).getSyncPoller(); + } + + /** + * Updates a configuration of a server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return beginPutAsync(resourceGroupName, serverName, configurationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + return beginPutAsync(resourceGroupName, serverName, configurationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationInner put( + String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) { + return putAsync(resourceGroupName, serverName, configurationName, parameters).block(); + } + + /** + * Updates a configuration of a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationInner put( + String resourceGroupName, + String serverName, + String configurationName, + ConfigurationInner parameters, + Context context) { + return putAsync(resourceGroupName, serverName, configurationName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of server configurations. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer( - String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationsImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationsImpl.java index d82df707d45c..3b6149a154b9 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationsImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ConfigurationsImpl.java @@ -28,6 +28,17 @@ public ConfigurationsImpl( this.serviceManager = serviceManager; } + public PagedIterable listByServer(String resourceGroupName, String serverName) { + PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); + return Utils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { + PagedIterable inner = + this.serviceClient().listByServer(resourceGroupName, serverName, context); + return Utils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); + } + public Configuration get(String resourceGroupName, String serverName, String configurationName) { ConfigurationInner inner = this.serviceClient().get(resourceGroupName, serverName, configurationName); if (inner != null) { @@ -52,17 +63,6 @@ public Response getWithResponse( } } - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager())); - } - public Configuration getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -72,12 +72,13 @@ public Configuration getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String configurationName = Utils.getValueFromIdByName(id, "configurations"); if (configurationName == null) { @@ -99,12 +100,13 @@ public Response getByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String configurationName = Utils.getValueFromIdByName(id, "configurations"); if (configurationName == null) { diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabaseImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabaseImpl.java index eb018f74a97e..34a869deea11 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabaseImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabaseImpl.java @@ -4,15 +4,21 @@ package com.azure.resourcemanager.postgresql.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.postgresql.fluent.models.DatabaseInner; import com.azure.resourcemanager.postgresql.models.Database; -public final class DatabaseImpl implements Database, Database.Definition, Database.Update { +public final class DatabaseImpl implements Database, Database.Definition { private DatabaseInner innerObject; private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; + DatabaseImpl(DatabaseInner innerObject, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + public String id() { return this.innerModel().id(); } @@ -25,6 +31,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String charset() { return this.innerModel().charset(); } @@ -47,7 +57,7 @@ private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { private String databaseName; - public DatabaseImpl withExistingServer(String resourceGroupName, String serverName) { + public DatabaseImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { this.resourceGroupName = resourceGroupName; this.serverName = serverName; return this; @@ -58,7 +68,7 @@ public Database create() { serviceManager .serviceClient() .getDatabases() - .createOrUpdate(resourceGroupName, serverName, databaseName, this.innerModel(), Context.NONE); + .create(resourceGroupName, serverName, databaseName, this.innerModel(), Context.NONE); return this; } @@ -67,7 +77,7 @@ public Database create(Context context) { serviceManager .serviceClient() .getDatabases() - .createOrUpdate(resourceGroupName, serverName, databaseName, this.innerModel(), context); + .create(resourceGroupName, serverName, databaseName, this.innerModel(), context); return this; } @@ -77,36 +87,6 @@ public Database create(Context context) { this.databaseName = name; } - public DatabaseImpl update() { - return this; - } - - public Database apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDatabases() - .createOrUpdate(resourceGroupName, serverName, databaseName, this.innerModel(), Context.NONE); - return this; - } - - public Database apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDatabases() - .createOrUpdate(resourceGroupName, serverName, databaseName, this.innerModel(), context); - return this; - } - - DatabaseImpl(DatabaseInner innerObject, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "servers"); - this.databaseName = Utils.getValueFromIdByName(innerObject.id(), "databases"); - } - public Database refresh() { this.innerObject = serviceManager diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabasesClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabasesClientImpl.java index f6df68301f09..3ea851a00f92 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabasesClientImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabasesClientImpl.java @@ -69,11 +69,11 @@ public final class DatabasesClientImpl implements DatabasesClient { private interface DatabasesService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/databases/{databaseName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/databases/{databaseName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( + Mono>> create( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -86,8 +86,8 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/databases/{databaseName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/databases/{databaseName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -102,8 +102,8 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/databases/{databaseName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/databases/{databaseName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -118,8 +118,8 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/databases") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/databases") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServer( @@ -130,6 +130,16 @@ Mono> listByServer( @PathParam("serverName") String serverName, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -145,7 +155,7 @@ Mono> listByServer( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( + private Mono>> createWithResponseAsync( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { if (this.client.getEndpoint() == null) { return Mono @@ -174,15 +184,14 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createOrUpdate( + .create( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -207,7 +216,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( + private Mono>> createWithResponseAsync( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -236,13 +245,12 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( + .create( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -265,10 +273,10 @@ private Mono>> createOrUpdateWithResponseAsync( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DatabaseInner> beginCreateOrUpdateAsync( + private PollerFlux, DatabaseInner> beginCreateAsync( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, databaseName, parameters); + createWithResponseAsync(resourceGroupName, serverName, databaseName, parameters); return this .client .getLroResult( @@ -289,11 +297,11 @@ private PollerFlux, DatabaseInner> beginCreateOrUpdate * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, DatabaseInner> beginCreateOrUpdateAsync( + private PollerFlux, DatabaseInner> beginCreateAsync( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, databaseName, parameters, context); + createWithResponseAsync(resourceGroupName, serverName, databaseName, parameters, context); return this .client .getLroResult( @@ -313,9 +321,9 @@ private PollerFlux, DatabaseInner> beginCreateOrUpdate * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DatabaseInner> beginCreateOrUpdate( + public SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).getSyncPoller(); + return beginCreateAsync(resourceGroupName, serverName, databaseName, parameters).getSyncPoller(); } /** @@ -332,10 +340,9 @@ public SyncPoller, DatabaseInner> beginCreateOrUpdate( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, DatabaseInner> beginCreateOrUpdate( + public SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters, context) - .getSyncPoller(); + return beginCreateAsync(resourceGroupName, serverName, databaseName, parameters, context).getSyncPoller(); } /** @@ -351,9 +358,9 @@ public SyncPoller, DatabaseInner> beginCreateOrUpdate( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( + private Mono createAsync( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters) + return beginCreateAsync(resourceGroupName, serverName, databaseName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -372,9 +379,9 @@ private Mono createOrUpdateAsync( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( + private Mono createAsync( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters, context) + return beginCreateAsync(resourceGroupName, serverName, databaseName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -392,9 +399,9 @@ private Mono createOrUpdateAsync( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseInner createOrUpdate( + public DatabaseInner create( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).block(); + return createAsync(resourceGroupName, serverName, databaseName, parameters).block(); } /** @@ -411,9 +418,9 @@ public DatabaseInner createOrUpdate( * @return represents a Database. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseInner createOrUpdate( + public DatabaseInner create( String resourceGroupName, String serverName, String databaseName, DatabaseInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters, context).block(); + return createAsync(resourceGroupName, serverName, databaseName, parameters, context).block(); } /** @@ -452,7 +459,6 @@ private Mono>> deleteWithResponseAsync( if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -460,7 +466,7 @@ private Mono>> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -507,13 +513,12 @@ private Mono>> deleteWithResponseAsync( if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -704,7 +709,6 @@ private Mono> getWithResponseAsync( if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -712,7 +716,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -759,13 +763,12 @@ private Mono> getWithResponseAsync( if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -864,7 +867,6 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -872,7 +874,7 @@ private Mono> listByServerSinglePageAsync( service .listByServer( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -881,7 +883,12 @@ private Mono> listByServerSinglePageAsync( .>map( res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -918,13 +925,12 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -933,7 +939,12 @@ private Mono> listByServerSinglePageAsync( .map( res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** @@ -948,7 +959,9 @@ private Mono> listByServerSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName)); + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); } /** @@ -964,7 +977,9 @@ private PagedFlux listByServerAsync(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByServerAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context)); + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePageAsync(nextLink, context)); } /** @@ -997,4 +1012,75 @@ public PagedIterable listByServer(String resourceGroupName, Strin public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a List of databases. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a List of databases. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabasesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabasesImpl.java index 1e56186f9cbf..3512abdf71e8 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabasesImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/DatabasesImpl.java @@ -79,12 +79,13 @@ public Database getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String databaseName = Utils.getValueFromIdByName(id, "databases"); if (databaseName == null) { @@ -105,12 +106,13 @@ public Response getByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String databaseName = Utils.getValueFromIdByName(id, "databases"); if (databaseName == null) { @@ -131,12 +133,13 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String databaseName = Utils.getValueFromIdByName(id, "databases"); if (databaseName == null) { @@ -157,12 +160,13 @@ public void deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String databaseName = Utils.getValueFromIdByName(id, "databases"); if (databaseName == null) { diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRuleImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRuleImpl.java index 7f600a9cbc37..eafb495518fe 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRuleImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRuleImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.postgresql.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.postgresql.fluent.models.FirewallRuleInner; import com.azure.resourcemanager.postgresql.models.FirewallRule; @@ -25,6 +26,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String startIpAddress() { return this.innerModel().startIpAddress(); } @@ -47,7 +52,7 @@ private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { private String firewallRuleName; - public FirewallRuleImpl withExistingServer(String resourceGroupName, String serverName) { + public FirewallRuleImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { this.resourceGroupName = resourceGroupName; this.serverName = serverName; return this; @@ -104,7 +109,7 @@ public FirewallRule apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "servers"); + this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); this.firewallRuleName = Utils.getValueFromIdByName(innerObject.id(), "firewallRules"); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRulesClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRulesClientImpl.java index a416ae07c627..15bc688c0ae3 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRulesClientImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRulesClientImpl.java @@ -69,8 +69,8 @@ public final class FirewallRulesClientImpl implements FirewallRulesClient { private interface FirewallRulesService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/firewallRules/{firewallRuleName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -86,8 +86,8 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/firewallRules/{firewallRuleName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -102,8 +102,8 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/firewallRules/{firewallRuleName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/firewallRules/{firewallRuleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -118,8 +118,8 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/firewallRules") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/firewallRules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByServer( @@ -130,6 +130,16 @@ Mono> listByServer( @PathParam("serverName") String serverName, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -175,7 +185,6 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -183,7 +192,7 @@ private Mono>> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -242,13 +251,12 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -439,7 +447,7 @@ public FirewallRuleInner createOrUpdate( } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -475,7 +483,6 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -483,7 +490,7 @@ private Mono>> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -494,7 +501,7 @@ private Mono>> deleteWithResponseAsync( } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -531,13 +538,12 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -547,7 +553,7 @@ private Mono>> deleteWithResponseAsync( } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -568,7 +574,7 @@ private PollerFlux, Void> beginDeleteAsync( } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -591,7 +597,7 @@ private PollerFlux, Void> beginDeleteAsync( } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -608,7 +614,7 @@ public SyncPoller, Void> beginDelete( } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -626,7 +632,7 @@ public SyncPoller, Void> beginDelete( } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -644,7 +650,7 @@ private Mono deleteAsync(String resourceGroupName, String serverName, Stri } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -664,7 +670,7 @@ private Mono deleteAsync( } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -679,7 +685,7 @@ public void delete(String resourceGroupName, String serverName, String firewallR } /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -695,7 +701,7 @@ public void delete(String resourceGroupName, String serverName, String firewallR } /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -703,7 +709,7 @@ public void delete(String resourceGroupName, String serverName, String firewallR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -731,7 +737,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -739,7 +744,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -750,7 +755,7 @@ private Mono> getWithResponseAsync( } /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -759,7 +764,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -787,13 +792,12 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -803,7 +807,7 @@ private Mono> getWithResponseAsync( } /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -811,7 +815,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String serverName, String firewallRuleName) { @@ -827,7 +831,7 @@ private Mono getAsync(String resourceGroupName, String server } /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -835,7 +839,7 @@ private Mono getAsync(String resourceGroupName, String server * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) public FirewallRuleInner get(String resourceGroupName, String serverName, String firewallRuleName) { @@ -843,7 +847,7 @@ public FirewallRuleInner get(String resourceGroupName, String serverName, String } /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -852,7 +856,7 @@ public FirewallRuleInner get(String resourceGroupName, String serverName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -861,7 +865,7 @@ public Response getWithResponse( } /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -892,7 +896,6 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -900,7 +903,7 @@ private Mono> listByServerSinglePageAsync( service .listByServer( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -909,12 +912,17 @@ private Mono> listByServerSinglePageAsync( .>map( res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -946,13 +954,12 @@ private Mono> listByServerSinglePageAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByServer( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -961,11 +968,16 @@ private Mono> listByServerSinglePageAsync( .map( res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -976,11 +988,13 @@ private Mono> listByServerSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName)); + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); } /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -993,11 +1007,13 @@ private PagedFlux listByServerAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByServerAsync( String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context)); + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePageAsync(nextLink, context)); } /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -1012,7 +1028,7 @@ public PagedIterable listByServer(String resourceGroupName, S } /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -1026,4 +1042,75 @@ public PagedIterable listByServer(String resourceGroupName, S public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServerNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRulesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRulesImpl.java index 121bd5895a15..7ca3c2a685d4 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRulesImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/FirewallRulesImpl.java @@ -80,12 +80,13 @@ public FirewallRule getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); if (firewallRuleName == null) { @@ -106,12 +107,13 @@ public Response getByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); if (firewallRuleName == null) { @@ -132,12 +134,13 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); if (firewallRuleName == null) { @@ -158,12 +161,13 @@ public void deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); if (firewallRuleName == null) { diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/GetPrivateDnsZoneSuffixesClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/GetPrivateDnsZoneSuffixesClientImpl.java new file mode 100644 index 000000000000..1b8aa9c4bc94 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/GetPrivateDnsZoneSuffixesClientImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresql.fluent.GetPrivateDnsZoneSuffixesClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GetPrivateDnsZoneSuffixesClient. */ +public final class GetPrivateDnsZoneSuffixesClientImpl implements GetPrivateDnsZoneSuffixesClient { + private final ClientLogger logger = new ClientLogger(GetPrivateDnsZoneSuffixesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GetPrivateDnsZoneSuffixesService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of GetPrivateDnsZoneSuffixesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GetPrivateDnsZoneSuffixesClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy + .create( + GetPrivateDnsZoneSuffixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientGetPrivateDnsZoneSuffixes to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + private interface GetPrivateDnsZoneSuffixesService { + @Headers({"Content-Type: application/json"}) + @Post("/providers/Microsoft.DBForPostgreSql/getPrivateDnsZoneSuffix") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> execute( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get private DNS zone suffix in the cloud. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private DNS zone suffix in the cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.execute(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get private DNS zone suffix in the cloud. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private DNS zone suffix in the cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.execute(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + } + + /** + * Get private DNS zone suffix in the cloud. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private DNS zone suffix in the cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeAsync() { + return executeWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get private DNS zone suffix in the cloud. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private DNS zone suffix in the cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String execute() { + return executeAsync().block(); + } + + /** + * Get private DNS zone suffix in the cloud. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private DNS zone suffix in the cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response executeWithResponse(Context context) { + return executeWithResponseAsync(context).block(); + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/GetPrivateDnsZoneSuffixesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/GetPrivateDnsZoneSuffixesImpl.java new file mode 100644 index 000000000000..6d30af787a84 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/GetPrivateDnsZoneSuffixesImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresql.fluent.GetPrivateDnsZoneSuffixesClient; +import com.azure.resourcemanager.postgresql.models.GetPrivateDnsZoneSuffixes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GetPrivateDnsZoneSuffixesImpl implements GetPrivateDnsZoneSuffixes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetPrivateDnsZoneSuffixesImpl.class); + + private final GetPrivateDnsZoneSuffixesClient innerClient; + + private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; + + public GetPrivateDnsZoneSuffixesImpl( + GetPrivateDnsZoneSuffixesClient innerClient, + com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public String execute() { + return this.serviceClient().execute(); + } + + public Response executeWithResponse(Context context) { + return this.serviceClient().executeWithResponse(context); + } + + private GetPrivateDnsZoneSuffixesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedCapabilitiesClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedCapabilitiesClientImpl.java new file mode 100644 index 000000000000..5dc3f3489738 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedCapabilitiesClientImpl.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresql.fluent.LocationBasedCapabilitiesClient; +import com.azure.resourcemanager.postgresql.fluent.models.CapabilityPropertiesInner; +import com.azure.resourcemanager.postgresql.models.CapabilitiesListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocationBasedCapabilitiesClient. */ +public final class LocationBasedCapabilitiesClientImpl implements LocationBasedCapabilitiesClient { + private final ClientLogger logger = new ClientLogger(LocationBasedCapabilitiesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LocationBasedCapabilitiesService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of LocationBasedCapabilitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationBasedCapabilitiesClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy + .create( + LocationBasedCapabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientLocationBasedCapabilities to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + private interface LocationBasedCapabilitiesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSql/locations/{locationName}/capabilities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> execute( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> executeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeSinglePageAsync(String locationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .execute( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + locationName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeSinglePageAsync( + String locationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .execute( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + locationName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux executeAsync(String locationName) { + return new PagedFlux<>( + () -> executeSinglePageAsync(locationName), nextLink -> executeNextSinglePageAsync(nextLink)); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux executeAsync(String locationName, Context context) { + return new PagedFlux<>( + () -> executeSinglePageAsync(locationName, context), + nextLink -> executeNextSinglePageAsync(nextLink, context)); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable execute(String locationName) { + return new PagedIterable<>(executeAsync(locationName)); + } + + /** + * Get capabilities at specified location in a given subscription. + * + * @param locationName The name of the location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capabilities at specified location in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable execute(String locationName, Context context) { + return new PagedIterable<>(executeAsync(locationName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location capability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.executeNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return location capability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> executeNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .executeNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedCapabilitiesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedCapabilitiesImpl.java new file mode 100644 index 000000000000..57631906db09 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedCapabilitiesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresql.fluent.LocationBasedCapabilitiesClient; +import com.azure.resourcemanager.postgresql.fluent.models.CapabilityPropertiesInner; +import com.azure.resourcemanager.postgresql.models.CapabilityProperties; +import com.azure.resourcemanager.postgresql.models.LocationBasedCapabilities; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LocationBasedCapabilitiesImpl implements LocationBasedCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationBasedCapabilitiesImpl.class); + + private final LocationBasedCapabilitiesClient innerClient; + + private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; + + public LocationBasedCapabilitiesImpl( + LocationBasedCapabilitiesClient innerClient, + com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable execute(String locationName) { + PagedIterable inner = this.serviceClient().execute(locationName); + return Utils.mapPage(inner, inner1 -> new CapabilityPropertiesImpl(inner1, this.manager())); + } + + public PagedIterable execute(String locationName, Context context) { + PagedIterable inner = this.serviceClient().execute(locationName, context); + return Utils.mapPage(inner, inner1 -> new CapabilityPropertiesImpl(inner1, this.manager())); + } + + private LocationBasedCapabilitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedPerformanceTiersImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedPerformanceTiersImpl.java deleted file mode 100644 index 6f6ce118d31e..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedPerformanceTiersImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.LocationBasedPerformanceTiersClient; -import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner; -import com.azure.resourcemanager.postgresql.models.LocationBasedPerformanceTiers; -import com.azure.resourcemanager.postgresql.models.PerformanceTierProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class LocationBasedPerformanceTiersImpl implements LocationBasedPerformanceTiers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationBasedPerformanceTiersImpl.class); - - private final LocationBasedPerformanceTiersClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public LocationBasedPerformanceTiersImpl( - LocationBasedPerformanceTiersClient innerClient, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String locationName) { - PagedIterable inner = this.serviceClient().list(locationName); - return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable list(String locationName, Context context) { - PagedIterable inner = this.serviceClient().list(locationName, context); - return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager())); - } - - private LocationBasedPerformanceTiersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LogFileImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LogFileImpl.java deleted file mode 100644 index 870d9d8a787a..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LogFileImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.resourcemanager.postgresql.fluent.models.LogFileInner; -import com.azure.resourcemanager.postgresql.models.LogFile; -import java.time.OffsetDateTime; - -public final class LogFileImpl implements LogFile { - private LogFileInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - LogFileImpl(LogFileInner innerObject, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Long sizeInKB() { - return this.innerModel().sizeInKB(); - } - - public OffsetDateTime createdTime() { - return this.innerModel().createdTime(); - } - - public OffsetDateTime lastModifiedTime() { - return this.innerModel().lastModifiedTime(); - } - - public String typePropertiesType() { - return this.innerModel().typePropertiesType(); - } - - public String url() { - return this.innerModel().url(); - } - - public LogFileInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LogFilesClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LogFilesClientImpl.java deleted file mode 100644 index c5921cda4c0c..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LogFilesClientImpl.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.LogFilesClient; -import com.azure.resourcemanager.postgresql.fluent.models.LogFileInner; -import com.azure.resourcemanager.postgresql.models.LogFileListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LogFilesClient. */ -public final class LogFilesClientImpl implements LogFilesClient { - private final ClientLogger logger = new ClientLogger(LogFilesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final LogFilesService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of LogFilesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LogFilesClientImpl(PostgreSqlManagementClientImpl client) { - this.service = RestProxy.create(LogFilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientLogFiles to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface LogFilesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/logFiles") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByServer( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName)); - } - - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context)); - } - - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); - } - - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LogFilesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LogFilesImpl.java deleted file mode 100644 index 48498ef6ed3b..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LogFilesImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.LogFilesClient; -import com.azure.resourcemanager.postgresql.fluent.models.LogFileInner; -import com.azure.resourcemanager.postgresql.models.LogFile; -import com.azure.resourcemanager.postgresql.models.LogFiles; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class LogFilesImpl implements LogFiles { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogFilesImpl.class); - - private final LogFilesClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public LogFilesImpl( - LogFilesClient innerClient, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager())); - } - - private LogFilesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/NameAvailabilityImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/NameAvailabilityImpl.java index 525c113c829e..8394690d735d 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/NameAvailabilityImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/NameAvailabilityImpl.java @@ -26,8 +26,12 @@ public Boolean nameAvailable() { return this.innerModel().nameAvailable(); } - public String reason() { - return this.innerModel().reason(); + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); } public NameAvailabilityInner innerModel() { diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/OperationListResultImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/OperationListResultImpl.java index 3d57222d752d..ad5a651b1933 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/OperationListResultImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/OperationListResultImpl.java @@ -30,6 +30,10 @@ public List value() { } } + public String nextLink() { + return this.innerModel().nextLink(); + } + public OperationListResultInner innerModel() { return this.innerObject; } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/OperationsClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/OperationsClientImpl.java index 4693fb7c2755..3e4c3d0226ac 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/OperationsClientImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/OperationsClientImpl.java @@ -54,7 +54,7 @@ public final class OperationsClientImpl implements OperationsClient { @ServiceInterface(name = "PostgreSqlManagement") private interface OperationsService { @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.DBForPostgreSQL/operations") + @Get("/providers/Microsoft.DBForPostgreSql/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -79,10 +79,10 @@ private Mono> listWithResponseAsync() { new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -103,10 +103,9 @@ private Mono> listWithResponseAsync(Context c new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); } /** diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PerformanceTierPropertiesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PerformanceTierPropertiesImpl.java deleted file mode 100644 index 2abfca28305d..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PerformanceTierPropertiesImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner; -import com.azure.resourcemanager.postgresql.models.PerformanceTierProperties; -import com.azure.resourcemanager.postgresql.models.PerformanceTierServiceLevelObjectives; -import java.util.Collections; -import java.util.List; - -public final class PerformanceTierPropertiesImpl implements PerformanceTierProperties { - private PerformanceTierPropertiesInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - PerformanceTierPropertiesImpl( - PerformanceTierPropertiesInner innerObject, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public Integer maxBackupRetentionDays() { - return this.innerModel().maxBackupRetentionDays(); - } - - public Integer minBackupRetentionDays() { - return this.innerModel().minBackupRetentionDays(); - } - - public Integer maxStorageMB() { - return this.innerModel().maxStorageMB(); - } - - public Integer minLargeStorageMB() { - return this.innerModel().minLargeStorageMB(); - } - - public Integer maxLargeStorageMB() { - return this.innerModel().maxLargeStorageMB(); - } - - public Integer minStorageMB() { - return this.innerModel().minStorageMB(); - } - - public List serviceLevelObjectives() { - List inner = this.innerModel().serviceLevelObjectives(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public PerformanceTierPropertiesInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PostgreSqlManagementClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PostgreSqlManagementClientImpl.java index 68117cdfee4d..4cb361f507f2 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PostgreSqlManagementClientImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PostgreSqlManagementClientImpl.java @@ -25,21 +25,12 @@ import com.azure.resourcemanager.postgresql.fluent.ConfigurationsClient; import com.azure.resourcemanager.postgresql.fluent.DatabasesClient; import com.azure.resourcemanager.postgresql.fluent.FirewallRulesClient; -import com.azure.resourcemanager.postgresql.fluent.LocationBasedPerformanceTiersClient; -import com.azure.resourcemanager.postgresql.fluent.LogFilesClient; +import com.azure.resourcemanager.postgresql.fluent.GetPrivateDnsZoneSuffixesClient; +import com.azure.resourcemanager.postgresql.fluent.LocationBasedCapabilitiesClient; import com.azure.resourcemanager.postgresql.fluent.OperationsClient; import com.azure.resourcemanager.postgresql.fluent.PostgreSqlManagementClient; -import com.azure.resourcemanager.postgresql.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.postgresql.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.postgresql.fluent.RecoverableServersClient; -import com.azure.resourcemanager.postgresql.fluent.ReplicasClient; -import com.azure.resourcemanager.postgresql.fluent.ServerAdministratorsClient; -import com.azure.resourcemanager.postgresql.fluent.ServerBasedPerformanceTiersClient; -import com.azure.resourcemanager.postgresql.fluent.ServerKeysClient; -import com.azure.resourcemanager.postgresql.fluent.ServerParametersClient; -import com.azure.resourcemanager.postgresql.fluent.ServerSecurityAlertPoliciesClient; import com.azure.resourcemanager.postgresql.fluent.ServersClient; -import com.azure.resourcemanager.postgresql.fluent.VirtualNetworkRulesClient; +import com.azure.resourcemanager.postgresql.fluent.VirtualNetworkSubnetUsagesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -79,6 +70,18 @@ public String getEndpoint() { return this.endpoint; } + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** The HTTP pipeline to send requests through. */ private final HttpPipeline httpPipeline; @@ -127,18 +130,6 @@ public ServersClient getServers() { return this.servers; } - /** The ReplicasClient object to access its operations. */ - private final ReplicasClient replicas; - - /** - * Gets the ReplicasClient object to access its operations. - * - * @return the ReplicasClient object. - */ - public ReplicasClient getReplicas() { - return this.replicas; - } - /** The FirewallRulesClient object to access its operations. */ private final FirewallRulesClient firewallRules; @@ -151,30 +142,6 @@ public FirewallRulesClient getFirewallRules() { return this.firewallRules; } - /** The VirtualNetworkRulesClient object to access its operations. */ - private final VirtualNetworkRulesClient virtualNetworkRules; - - /** - * Gets the VirtualNetworkRulesClient object to access its operations. - * - * @return the VirtualNetworkRulesClient object. - */ - public VirtualNetworkRulesClient getVirtualNetworkRules() { - return this.virtualNetworkRules; - } - - /** The DatabasesClient object to access its operations. */ - private final DatabasesClient databases; - - /** - * Gets the DatabasesClient object to access its operations. - * - * @return the DatabasesClient object. - */ - public DatabasesClient getDatabases() { - return this.databases; - } - /** The ConfigurationsClient object to access its operations. */ private final ConfigurationsClient configurations; @@ -187,78 +154,6 @@ public ConfigurationsClient getConfigurations() { return this.configurations; } - /** The ServerParametersClient object to access its operations. */ - private final ServerParametersClient serverParameters; - - /** - * Gets the ServerParametersClient object to access its operations. - * - * @return the ServerParametersClient object. - */ - public ServerParametersClient getServerParameters() { - return this.serverParameters; - } - - /** The LogFilesClient object to access its operations. */ - private final LogFilesClient logFiles; - - /** - * Gets the LogFilesClient object to access its operations. - * - * @return the LogFilesClient object. - */ - public LogFilesClient getLogFiles() { - return this.logFiles; - } - - /** The ServerAdministratorsClient object to access its operations. */ - private final ServerAdministratorsClient serverAdministrators; - - /** - * Gets the ServerAdministratorsClient object to access its operations. - * - * @return the ServerAdministratorsClient object. - */ - public ServerAdministratorsClient getServerAdministrators() { - return this.serverAdministrators; - } - - /** The RecoverableServersClient object to access its operations. */ - private final RecoverableServersClient recoverableServers; - - /** - * Gets the RecoverableServersClient object to access its operations. - * - * @return the RecoverableServersClient object. - */ - public RecoverableServersClient getRecoverableServers() { - return this.recoverableServers; - } - - /** The ServerBasedPerformanceTiersClient object to access its operations. */ - private final ServerBasedPerformanceTiersClient serverBasedPerformanceTiers; - - /** - * Gets the ServerBasedPerformanceTiersClient object to access its operations. - * - * @return the ServerBasedPerformanceTiersClient object. - */ - public ServerBasedPerformanceTiersClient getServerBasedPerformanceTiers() { - return this.serverBasedPerformanceTiers; - } - - /** The LocationBasedPerformanceTiersClient object to access its operations. */ - private final LocationBasedPerformanceTiersClient locationBasedPerformanceTiers; - - /** - * Gets the LocationBasedPerformanceTiersClient object to access its operations. - * - * @return the LocationBasedPerformanceTiersClient object. - */ - public LocationBasedPerformanceTiersClient getLocationBasedPerformanceTiers() { - return this.locationBasedPerformanceTiers; - } - /** The CheckNameAvailabilitiesClient object to access its operations. */ private final CheckNameAvailabilitiesClient checkNameAvailabilities; @@ -271,64 +166,64 @@ public CheckNameAvailabilitiesClient getCheckNameAvailabilities() { return this.checkNameAvailabilities; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The LocationBasedCapabilitiesClient object to access its operations. */ + private final LocationBasedCapabilitiesClient locationBasedCapabilities; /** - * Gets the OperationsClient object to access its operations. + * Gets the LocationBasedCapabilitiesClient object to access its operations. * - * @return the OperationsClient object. + * @return the LocationBasedCapabilitiesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public LocationBasedCapabilitiesClient getLocationBasedCapabilities() { + return this.locationBasedCapabilities; } - /** The ServerSecurityAlertPoliciesClient object to access its operations. */ - private final ServerSecurityAlertPoliciesClient serverSecurityAlertPolicies; + /** The VirtualNetworkSubnetUsagesClient object to access its operations. */ + private final VirtualNetworkSubnetUsagesClient virtualNetworkSubnetUsages; /** - * Gets the ServerSecurityAlertPoliciesClient object to access its operations. + * Gets the VirtualNetworkSubnetUsagesClient object to access its operations. * - * @return the ServerSecurityAlertPoliciesClient object. + * @return the VirtualNetworkSubnetUsagesClient object. */ - public ServerSecurityAlertPoliciesClient getServerSecurityAlertPolicies() { - return this.serverSecurityAlertPolicies; + public VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages() { + return this.virtualNetworkSubnetUsages; } - /** The PrivateEndpointConnectionsClient object to access its operations. */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the PrivateEndpointConnectionsClient object. + * @return the OperationsClient object. */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; + public OperationsClient getOperations() { + return this.operations; } - /** The PrivateLinkResourcesClient object to access its operations. */ - private final PrivateLinkResourcesClient privateLinkResources; + /** The DatabasesClient object to access its operations. */ + private final DatabasesClient databases; /** - * Gets the PrivateLinkResourcesClient object to access its operations. + * Gets the DatabasesClient object to access its operations. * - * @return the PrivateLinkResourcesClient object. + * @return the DatabasesClient object. */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; + public DatabasesClient getDatabases() { + return this.databases; } - /** The ServerKeysClient object to access its operations. */ - private final ServerKeysClient serverKeys; + /** The GetPrivateDnsZoneSuffixesClient object to access its operations. */ + private final GetPrivateDnsZoneSuffixesClient getPrivateDnsZoneSuffixes; /** - * Gets the ServerKeysClient object to access its operations. + * Gets the GetPrivateDnsZoneSuffixesClient object to access its operations. * - * @return the ServerKeysClient object. + * @return the GetPrivateDnsZoneSuffixesClient object. */ - public ServerKeysClient getServerKeys() { - return this.serverKeys; + public GetPrivateDnsZoneSuffixesClient getGetPrivateDnsZoneSuffixes() { + return this.getPrivateDnsZoneSuffixes; } /** @@ -353,24 +248,16 @@ public ServerKeysClient getServerKeys() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = "2021-06-01"; this.servers = new ServersClientImpl(this); - this.replicas = new ReplicasClientImpl(this); this.firewallRules = new FirewallRulesClientImpl(this); - this.virtualNetworkRules = new VirtualNetworkRulesClientImpl(this); - this.databases = new DatabasesClientImpl(this); this.configurations = new ConfigurationsClientImpl(this); - this.serverParameters = new ServerParametersClientImpl(this); - this.logFiles = new LogFilesClientImpl(this); - this.serverAdministrators = new ServerAdministratorsClientImpl(this); - this.recoverableServers = new RecoverableServersClientImpl(this); - this.serverBasedPerformanceTiers = new ServerBasedPerformanceTiersClientImpl(this); - this.locationBasedPerformanceTiers = new LocationBasedPerformanceTiersClientImpl(this); this.checkNameAvailabilities = new CheckNameAvailabilitiesClientImpl(this); + this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); + this.virtualNetworkSubnetUsages = new VirtualNetworkSubnetUsagesClientImpl(this); this.operations = new OperationsClientImpl(this); - this.serverSecurityAlertPolicies = new ServerSecurityAlertPoliciesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.serverKeys = new ServerKeysClientImpl(this); + this.databases = new DatabasesClientImpl(this); + this.getPrivateDnsZoneSuffixes = new GetPrivateDnsZoneSuffixesClientImpl(this); } /** diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateEndpointConnectionImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateEndpointConnectionImpl.java deleted file mode 100644 index dc821ad3f8f6..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateEndpointConnectionImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.postgresql.models.PrivateEndpointConnection; -import com.azure.resourcemanager.postgresql.models.PrivateEndpointProperty; -import com.azure.resourcemanager.postgresql.models.PrivateLinkServiceConnectionStateProperty; -import com.azure.resourcemanager.postgresql.models.TagsObject; -import java.util.Map; - -public final class PrivateEndpointConnectionImpl - implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { - private PrivateEndpointConnectionInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public PrivateEndpointProperty privateEndpoint() { - return this.innerModel().privateEndpoint(); - } - - public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { - return this.innerModel().privateLinkServiceConnectionState(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public PrivateEndpointConnectionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private String privateEndpointConnectionName; - - private TagsObject updateParameters; - - public PrivateEndpointConnectionImpl withExistingServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public PrivateEndpointConnection create() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate( - resourceGroupName, serverName, privateEndpointConnectionName, this.innerModel(), Context.NONE); - return this; - } - - public PrivateEndpointConnection create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate( - resourceGroupName, serverName, privateEndpointConnectionName, this.innerModel(), context); - return this; - } - - PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = new PrivateEndpointConnectionInner(); - this.serviceManager = serviceManager; - this.privateEndpointConnectionName = name; - } - - public PrivateEndpointConnectionImpl update() { - this.updateParameters = new TagsObject(); - return this; - } - - public PrivateEndpointConnection apply() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .updateTags( - resourceGroupName, serverName, privateEndpointConnectionName, updateParameters, Context.NONE); - return this; - } - - public PrivateEndpointConnection apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .updateTags(resourceGroupName, serverName, privateEndpointConnectionName, updateParameters, context); - return this; - } - - PrivateEndpointConnectionImpl( - PrivateEndpointConnectionInner innerObject, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "servers"); - this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); - } - - public PrivateEndpointConnection refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE) - .getValue(); - return this; - } - - public PrivateEndpointConnection refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, context) - .getValue(); - return this; - } - - public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpointProperty privateEndpoint) { - this.innerModel().withPrivateEndpoint(privateEndpoint); - return this; - } - - public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { - this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); - return this; - } - - public PrivateEndpointConnectionImpl withTags(Map tags) { - this.updateParameters.withTags(tags); - return this; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index b9e543b6f539..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,1513 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.postgresql.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.postgresql.models.TagsObject; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateEndpointConnectionsService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(PostgreSqlManagementClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientPrivateEndpointConnections to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PrivateEndpointConnectionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTags( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") TagsObject parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/privateEndpointConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String serverName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, serverName, privateEndpointConnectionName).block(); - } - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, context).block(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serverName, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serverName, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - Context.NONE); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, serverName, privateEndpointConnectionName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - context); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters) - .getSyncPoller(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters).block(); - } - - /** - * Approve or reject a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters A private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) - .block(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - serverName, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - serverName, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, serverName, privateEndpointConnectionName).getSyncPoller(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, serverName, privateEndpointConnectionName, context).getSyncPoller(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, serverName, privateEndpointConnectionName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, serverName, privateEndpointConnectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName) { - deleteAsync(resourceGroupName, serverName, privateEndpointConnectionName).block(); - } - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { - deleteAsync(resourceGroupName, serverName, privateEndpointConnectionName, context).block(); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName, TagsObject parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateTags( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - privateEndpointConnectionName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTagsWithResponseAsync( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - TagsObject parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateTags( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - privateEndpointConnectionName, - parameters, - accept, - context); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PrivateEndpointConnectionInner> beginUpdateTagsAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName, TagsObject parameters) { - Mono>> mono = - updateTagsWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - Context.NONE); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, PrivateEndpointConnectionInner> beginUpdateTagsAsync( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - TagsObject parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateTagsWithResponseAsync( - resourceGroupName, serverName, privateEndpointConnectionName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - context); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PrivateEndpointConnectionInner> beginUpdateTags( - String resourceGroupName, String serverName, String privateEndpointConnectionName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters) - .getSyncPoller(); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, PrivateEndpointConnectionInner> beginUpdateTags( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - TagsObject parameters, - Context context) { - return beginUpdateTagsAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, String serverName, String privateEndpointConnectionName, TagsObject parameters) { - return beginUpdateTagsAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTagsAsync( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - TagsObject parameters, - Context context) { - return beginUpdateTagsAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner updateTags( - String resourceGroupName, String serverName, String privateEndpointConnectionName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters).block(); - } - - /** - * Updates private endpoint connection with the specified tags. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param parameters Parameters supplied to the Update private endpoint connection Tags operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner updateTags( - String resourceGroupName, - String serverName, - String privateEndpointConnectionName, - TagsObject parameters, - Context context) { - return updateTagsAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters, context) - .block(); - } - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByServer( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync( - String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); - } - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer( - String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateEndpointConnectionsImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateEndpointConnectionsImpl.java deleted file mode 100644 index a0487b937fde..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateEndpointConnectionsImpl.java +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.postgresql.models.PrivateEndpointConnection; -import com.azure.resourcemanager.postgresql.models.PrivateEndpointConnections; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); - - private final PrivateEndpointConnectionsClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public PrivateEndpointConnectionsImpl( - PrivateEndpointConnectionsClient innerClient, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PrivateEndpointConnection get( - String resourceGroupName, String serverName, String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner = - this.serviceClient().get(resourceGroupName, serverName, privateEndpointConnectionName); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName) { - this.serviceClient().delete(resourceGroupName, serverName, privateEndpointConnectionName); - } - - public void delete( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { - this.serviceClient().delete(resourceGroupName, serverName, privateEndpointConnectionName, context); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - - public PagedIterable listByServer( - String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - - public PrivateEndpointConnection getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); - } - return this - .getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); - } - return this.getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); - } - this.delete(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); - } - this.delete(resourceGroupName, serverName, privateEndpointConnectionName, context); - } - - private PrivateEndpointConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } - - public PrivateEndpointConnectionImpl define(String name) { - return new PrivateEndpointConnectionImpl(name, this.manager()); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourceImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourceImpl.java deleted file mode 100644 index 070fe45c19cb..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.resourcemanager.postgresql.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.postgresql.models.PrivateLinkResource; -import com.azure.resourcemanager.postgresql.models.PrivateLinkResourceProperties; - -public final class PrivateLinkResourceImpl implements PrivateLinkResource { - private PrivateLinkResourceInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - PrivateLinkResourceImpl( - PrivateLinkResourceInner innerObject, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public PrivateLinkResourceProperties properties() { - return this.innerModel().properties(); - } - - public PrivateLinkResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourcesClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourcesClientImpl.java deleted file mode 100644 index c8c62566f47e..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourcesClientImpl.java +++ /dev/null @@ -1,522 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.postgresql.models.PrivateLinkResourceListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ -public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PrivateLinkResourcesService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of PrivateLinkResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkResourcesClientImpl(PostgreSqlManagementClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientPrivateLinkResources to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/privateLinkResources") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/privateLinkResources/{groupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("groupName") String groupName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByServer( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync( - String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); - } - - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer( - String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } - - /** - * Gets a private link resource for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String groupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - groupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a private link resource for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String groupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - groupName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context); - } - - /** - * Gets a private link resource for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, String groupName) { - return getWithResponseAsync(resourceGroupName, serverName, groupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a private link resource for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner get(String resourceGroupName, String serverName, String groupName) { - return getAsync(resourceGroupName, serverName, groupName).block(); - } - - /** - * Gets a private link resource for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource for PostgreSQL server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, String groupName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, groupName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourcesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourcesImpl.java deleted file mode 100644 index f61ffab1624e..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/PrivateLinkResourcesImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.postgresql.models.PrivateLinkResource; -import com.azure.resourcemanager.postgresql.models.PrivateLinkResources; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class PrivateLinkResourcesImpl implements PrivateLinkResources { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); - - private final PrivateLinkResourcesClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public PrivateLinkResourcesImpl( - PrivateLinkResourcesClient innerClient, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByServer( - String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); - } - - public PrivateLinkResource get(String resourceGroupName, String serverName, String groupName) { - PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, serverName, groupName); - if (inner != null) { - return new PrivateLinkResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String serverName, String groupName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, groupName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PrivateLinkResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private PrivateLinkResourcesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/RecoverableServerResourceImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/RecoverableServerResourceImpl.java deleted file mode 100644 index 705b492a439a..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/RecoverableServerResourceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.resourcemanager.postgresql.fluent.models.RecoverableServerResourceInner; -import com.azure.resourcemanager.postgresql.models.RecoverableServerResource; - -public final class RecoverableServerResourceImpl implements RecoverableServerResource { - private RecoverableServerResourceInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - RecoverableServerResourceImpl( - RecoverableServerResourceInner innerObject, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String lastAvailableBackupDateTime() { - return this.innerModel().lastAvailableBackupDateTime(); - } - - public String serviceLevelObjective() { - return this.innerModel().serviceLevelObjective(); - } - - public String edition() { - return this.innerModel().edition(); - } - - public Integer vCore() { - return this.innerModel().vCore(); - } - - public String hardwareGeneration() { - return this.innerModel().hardwareGeneration(); - } - - public String version() { - return this.innerModel().version(); - } - - public RecoverableServerResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/RecoverableServersClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/RecoverableServersClientImpl.java deleted file mode 100644 index 01d1ca24b9cb..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/RecoverableServersClientImpl.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.RecoverableServersClient; -import com.azure.resourcemanager.postgresql.fluent.models.RecoverableServerResourceInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RecoverableServersClient. */ -public final class RecoverableServersClientImpl implements RecoverableServersClient { - private final ClientLogger logger = new ClientLogger(RecoverableServersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RecoverableServersService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of RecoverableServersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RecoverableServersClientImpl(PostgreSqlManagementClientImpl client) { - this.service = - RestProxy.create(RecoverableServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientRecoverableServers to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface RecoverableServersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/recoverableServers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a recoverable PostgreSQL Server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recoverable PostgreSQL Server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a recoverable PostgreSQL Server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recoverable PostgreSQL Server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context); - } - - /** - * Gets a recoverable PostgreSQL Server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recoverable PostgreSQL Server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName) { - return getWithResponseAsync(resourceGroupName, serverName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a recoverable PostgreSQL Server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recoverable PostgreSQL Server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecoverableServerResourceInner get(String resourceGroupName, String serverName) { - return getAsync(resourceGroupName, serverName).block(); - } - - /** - * Gets a recoverable PostgreSQL Server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recoverable PostgreSQL Server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, context).block(); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/RecoverableServersImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/RecoverableServersImpl.java deleted file mode 100644 index 32ec80fd9ae8..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/RecoverableServersImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.RecoverableServersClient; -import com.azure.resourcemanager.postgresql.fluent.models.RecoverableServerResourceInner; -import com.azure.resourcemanager.postgresql.models.RecoverableServerResource; -import com.azure.resourcemanager.postgresql.models.RecoverableServers; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class RecoverableServersImpl implements RecoverableServers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoverableServersImpl.class); - - private final RecoverableServersClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public RecoverableServersImpl( - RecoverableServersClient innerClient, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public RecoverableServerResource get(String resourceGroupName, String serverName) { - RecoverableServerResourceInner inner = this.serviceClient().get(resourceGroupName, serverName); - if (inner != null) { - return new RecoverableServerResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String serverName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RecoverableServerResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private RecoverableServersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ReplicasClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ReplicasClientImpl.java deleted file mode 100644 index 6d08fcc87642..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ReplicasClientImpl.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.ReplicasClient; -import com.azure.resourcemanager.postgresql.fluent.models.ServerInner; -import com.azure.resourcemanager.postgresql.models.ServerListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ReplicasClient. */ -public final class ReplicasClientImpl implements ReplicasClient { - private final ClientLogger logger = new ClientLogger(ReplicasClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ReplicasService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of ReplicasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ReplicasClientImpl(PostgreSqlManagementClientImpl client) { - this.service = RestProxy.create(ReplicasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientReplicas to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface ReplicasService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/replicas") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByServer( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName)); - } - - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listByServerSinglePageAsync(resourceGroupName, serverName, context)); - } - - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); - } - - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ReplicasImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ReplicasImpl.java deleted file mode 100644 index f16a3878b5f9..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ReplicasImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.ReplicasClient; -import com.azure.resourcemanager.postgresql.fluent.models.ServerInner; -import com.azure.resourcemanager.postgresql.models.Replicas; -import com.azure.resourcemanager.postgresql.models.Server; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ReplicasImpl implements Replicas { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicasImpl.class); - - private final ReplicasClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public ReplicasImpl( - ReplicasClient innerClient, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); - } - - private ReplicasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerAdministratorResourceImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerAdministratorResourceImpl.java deleted file mode 100644 index e25842bcb3fa..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerAdministratorResourceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.resourcemanager.postgresql.fluent.models.ServerAdministratorResourceInner; -import com.azure.resourcemanager.postgresql.models.AdministratorType; -import com.azure.resourcemanager.postgresql.models.ServerAdministratorResource; -import java.util.UUID; - -public final class ServerAdministratorResourceImpl implements ServerAdministratorResource { - private ServerAdministratorResourceInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - ServerAdministratorResourceImpl( - ServerAdministratorResourceInner innerObject, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public AdministratorType administratorType() { - return this.innerModel().administratorType(); - } - - public String login() { - return this.innerModel().login(); - } - - public UUID sid() { - return this.innerModel().sid(); - } - - public UUID tenantId() { - return this.innerModel().tenantId(); - } - - public ServerAdministratorResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerAdministratorsClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerAdministratorsClientImpl.java deleted file mode 100644 index ec1b383bc7c1..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerAdministratorsClientImpl.java +++ /dev/null @@ -1,965 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.ServerAdministratorsClient; -import com.azure.resourcemanager.postgresql.fluent.models.ServerAdministratorResourceInner; -import com.azure.resourcemanager.postgresql.models.ServerAdministratorResourceListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServerAdministratorsClient. */ -public final class ServerAdministratorsClientImpl implements ServerAdministratorsClient { - private final ClientLogger logger = new ClientLogger(ServerAdministratorsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ServerAdministratorsService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of ServerAdministratorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServerAdministratorsClientImpl(PostgreSqlManagementClientImpl client) { - this.service = - RestProxy - .create(ServerAdministratorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientServerAdministrators to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface ServerAdministratorsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/administrators/activeDirectory") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/administrators/activeDirectory") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @BodyParam("application/json") ServerAdministratorResourceInner properties, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/administrators/activeDirectory") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/administrators") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets information about a AAD server administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a AAD server administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets information about a AAD server administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a AAD server administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context); - } - - /** - * Gets information about a AAD server administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a AAD server administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName) { - return getWithResponseAsync(resourceGroupName, serverName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets information about a AAD server administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a AAD server administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerAdministratorResourceInner get(String resourceGroupName, String serverName) { - return getAsync(resourceGroupName, serverName).block(); - } - - /** - * Gets information about a AAD server administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a AAD server administrator. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, context).block(); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - properties, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - properties, - accept, - context); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ServerAdministratorResourceInner> - beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, properties); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServerAdministratorResourceInner.class, - ServerAdministratorResourceInner.class, - Context.NONE); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ServerAdministratorResourceInner> - beginCreateOrUpdateAsync( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, properties, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServerAdministratorResourceInner.class, - ServerAdministratorResourceInner.class, - context); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServerAdministratorResourceInner> - beginCreateOrUpdate(String resourceGroupName, String serverName, ServerAdministratorResourceInner properties) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, properties).getSyncPoller(); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServerAdministratorResourceInner> - beginCreateOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, properties, context).getSyncPoller(); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, properties) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, properties, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerAdministratorResourceInner createOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties) { - return createOrUpdateAsync(resourceGroupName, serverName, properties).block(); - } - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerAdministratorResourceInner createOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties, Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, properties, context).block(); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serverName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, serverName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serverName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, serverName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String serverName) { - return beginDeleteAsync(resourceGroupName, serverName).getSyncPoller(); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, Context context) { - return beginDeleteAsync(resourceGroupName, serverName, context).getSyncPoller(); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName) { - return beginDeleteAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName, Context context) { - return beginDeleteAsync(resourceGroupName, serverName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName) { - deleteAsync(resourceGroupName, serverName).block(); - } - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, Context context) { - deleteAsync(resourceGroupName, serverName, context).block(); - } - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName)); - } - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName, context)); - } - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName)); - } - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName, context)); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerAdministratorsImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerAdministratorsImpl.java deleted file mode 100644 index 4f8e445518f0..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerAdministratorsImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.ServerAdministratorsClient; -import com.azure.resourcemanager.postgresql.fluent.models.ServerAdministratorResourceInner; -import com.azure.resourcemanager.postgresql.models.ServerAdministratorResource; -import com.azure.resourcemanager.postgresql.models.ServerAdministrators; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ServerAdministratorsImpl implements ServerAdministrators { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerAdministratorsImpl.class); - - private final ServerAdministratorsClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public ServerAdministratorsImpl( - ServerAdministratorsClient innerClient, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public ServerAdministratorResource get(String resourceGroupName, String serverName) { - ServerAdministratorResourceInner inner = this.serviceClient().get(resourceGroupName, serverName); - if (inner != null) { - return new ServerAdministratorResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String serverName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ServerAdministratorResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServerAdministratorResource createOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties) { - ServerAdministratorResourceInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, serverName, properties); - if (inner != null) { - return new ServerAdministratorResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public ServerAdministratorResource createOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties, Context context) { - ServerAdministratorResourceInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, serverName, properties, context); - if (inner != null) { - return new ServerAdministratorResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String serverName) { - this.serviceClient().delete(resourceGroupName, serverName); - } - - public void delete(String resourceGroupName, String serverName, Context context) { - this.serviceClient().delete(resourceGroupName, serverName, context); - } - - public PagedIterable list(String resourceGroupName, String serverName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new ServerAdministratorResourceImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new ServerAdministratorResourceImpl(inner1, this.manager())); - } - - private ServerAdministratorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerBasedPerformanceTiersClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerBasedPerformanceTiersClientImpl.java deleted file mode 100644 index 72905f82294d..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerBasedPerformanceTiersClientImpl.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.ServerBasedPerformanceTiersClient; -import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner; -import com.azure.resourcemanager.postgresql.models.PerformanceTierListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServerBasedPerformanceTiersClient. */ -public final class ServerBasedPerformanceTiersClientImpl implements ServerBasedPerformanceTiersClient { - private final ClientLogger logger = new ClientLogger(ServerBasedPerformanceTiersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ServerBasedPerformanceTiersService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of ServerBasedPerformanceTiersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServerBasedPerformanceTiersClientImpl(PostgreSqlManagementClientImpl client) { - this.service = - RestProxy - .create( - ServerBasedPerformanceTiersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientServerBasedPerformanceTiers to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface ServerBasedPerformanceTiersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/performanceTiers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName)); - } - - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serverName, context)); - } - - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName)); - } - - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName, context)); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerBasedPerformanceTiersImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerBasedPerformanceTiersImpl.java deleted file mode 100644 index 2b03969ccb24..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerBasedPerformanceTiersImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.ServerBasedPerformanceTiersClient; -import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner; -import com.azure.resourcemanager.postgresql.models.PerformanceTierProperties; -import com.azure.resourcemanager.postgresql.models.ServerBasedPerformanceTiers; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ServerBasedPerformanceTiersImpl implements ServerBasedPerformanceTiers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerBasedPerformanceTiersImpl.class); - - private final ServerBasedPerformanceTiersClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public ServerBasedPerformanceTiersImpl( - ServerBasedPerformanceTiersClient innerClient, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager())); - } - - private ServerBasedPerformanceTiersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerImpl.java index a0dca750ee6e..ba952c178b7d 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerImpl.java @@ -5,25 +5,25 @@ package com.azure.resourcemanager.postgresql.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.postgresql.fluent.models.ServerInner; -import com.azure.resourcemanager.postgresql.models.InfrastructureEncryption; -import com.azure.resourcemanager.postgresql.models.MinimalTlsVersionEnum; -import com.azure.resourcemanager.postgresql.models.PublicNetworkAccessEnum; -import com.azure.resourcemanager.postgresql.models.ResourceIdentity; +import com.azure.resourcemanager.postgresql.models.Backup; +import com.azure.resourcemanager.postgresql.models.CreateMode; +import com.azure.resourcemanager.postgresql.models.CreateModeForUpdate; +import com.azure.resourcemanager.postgresql.models.HighAvailability; +import com.azure.resourcemanager.postgresql.models.Identity; +import com.azure.resourcemanager.postgresql.models.MaintenanceWindow; +import com.azure.resourcemanager.postgresql.models.Network; +import com.azure.resourcemanager.postgresql.models.RestartParameter; import com.azure.resourcemanager.postgresql.models.Server; -import com.azure.resourcemanager.postgresql.models.ServerForCreate; -import com.azure.resourcemanager.postgresql.models.ServerPrivateEndpointConnection; -import com.azure.resourcemanager.postgresql.models.ServerPropertiesForCreate; +import com.azure.resourcemanager.postgresql.models.ServerForUpdate; import com.azure.resourcemanager.postgresql.models.ServerState; -import com.azure.resourcemanager.postgresql.models.ServerUpdateParameters; import com.azure.resourcemanager.postgresql.models.ServerVersion; import com.azure.resourcemanager.postgresql.models.Sku; -import com.azure.resourcemanager.postgresql.models.SslEnforcementEnum; -import com.azure.resourcemanager.postgresql.models.StorageProfile; +import com.azure.resourcemanager.postgresql.models.Storage; import java.time.OffsetDateTime; import java.util.Collections; -import java.util.List; import java.util.Map; public final class ServerImpl implements Server, Server.Definition, Server.Update { @@ -56,7 +56,7 @@ public Map tags() { } } - public ResourceIdentity identity() { + public Identity identity() { return this.innerModel().identity(); } @@ -64,68 +64,76 @@ public Sku sku() { return this.innerModel().sku(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String administratorLogin() { return this.innerModel().administratorLogin(); } + public String administratorLoginPassword() { + return this.innerModel().administratorLoginPassword(); + } + public ServerVersion version() { return this.innerModel().version(); } - public SslEnforcementEnum sslEnforcement() { - return this.innerModel().sslEnforcement(); + public String minorVersion() { + return this.innerModel().minorVersion(); } - public MinimalTlsVersionEnum minimalTlsVersion() { - return this.innerModel().minimalTlsVersion(); + public ServerState state() { + return this.innerModel().state(); } - public String byokEnforcement() { - return this.innerModel().byokEnforcement(); + public String fullyQualifiedDomainName() { + return this.innerModel().fullyQualifiedDomainName(); } - public InfrastructureEncryption infrastructureEncryption() { - return this.innerModel().infrastructureEncryption(); + public Storage storage() { + return this.innerModel().storage(); } - public ServerState userVisibleState() { - return this.innerModel().userVisibleState(); + public Backup backup() { + return this.innerModel().backup(); } - public String fullyQualifiedDomainName() { - return this.innerModel().fullyQualifiedDomainName(); + public Network network() { + return this.innerModel().network(); } - public OffsetDateTime earliestRestoreDate() { - return this.innerModel().earliestRestoreDate(); + public HighAvailability highAvailability() { + return this.innerModel().highAvailability(); } - public StorageProfile storageProfile() { - return this.innerModel().storageProfile(); + public MaintenanceWindow maintenanceWindow() { + return this.innerModel().maintenanceWindow(); } - public String replicationRole() { - return this.innerModel().replicationRole(); + public String sourceServerResourceId() { + return this.innerModel().sourceServerResourceId(); } - public String masterServerId() { - return this.innerModel().masterServerId(); + public OffsetDateTime pointInTimeUtc() { + return this.innerModel().pointInTimeUtc(); } - public Integer replicaCapacity() { - return this.innerModel().replicaCapacity(); + public String availabilityZone() { + return this.innerModel().availabilityZone(); } - public PublicNetworkAccessEnum publicNetworkAccess() { - return this.innerModel().publicNetworkAccess(); + public CreateMode createMode() { + return this.innerModel().createMode(); } - public List privateEndpointConnections() { - List inner = this.innerModel().privateEndpointConnections(); + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableMap(inner); } else { - return Collections.emptyList(); + return Collections.emptyMap(); } } @@ -149,9 +157,7 @@ private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { private String serverName; - private ServerForCreate createParameters; - - private ServerUpdateParameters updateParameters; + private ServerForUpdate updateParameters; public ServerImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -163,7 +169,7 @@ public Server create() { serviceManager .serviceClient() .getServers() - .create(resourceGroupName, serverName, createParameters, Context.NONE); + .create(resourceGroupName, serverName, this.innerModel(), Context.NONE); return this; } @@ -172,7 +178,7 @@ public Server create(Context context) { serviceManager .serviceClient() .getServers() - .create(resourceGroupName, serverName, createParameters, context); + .create(resourceGroupName, serverName, this.innerModel(), context); return this; } @@ -180,11 +186,10 @@ public Server create(Context context) { this.innerObject = new ServerInner(); this.serviceManager = serviceManager; this.serverName = name; - this.createParameters = new ServerForCreate(); } public ServerImpl update() { - this.updateParameters = new ServerUpdateParameters(); + this.updateParameters = new ServerForUpdate(); return this; } @@ -210,7 +215,7 @@ public Server apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "servers"); + this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); } public Server refresh() { @@ -233,83 +238,156 @@ public Server refresh(Context context) { return this; } + public void restart(RestartParameter parameters) { + serviceManager.servers().restart(resourceGroupName, serverName, parameters); + } + + public void restart() { + serviceManager.servers().restart(resourceGroupName, serverName); + } + + public void restart(RestartParameter parameters, Context context) { + serviceManager.servers().restart(resourceGroupName, serverName, parameters, context); + } + + public void start() { + serviceManager.servers().start(resourceGroupName, serverName); + } + + public void start(Context context) { + serviceManager.servers().start(resourceGroupName, serverName, context); + } + + public void stop() { + serviceManager.servers().stop(resourceGroupName, serverName); + } + + public void stop(Context context) { + serviceManager.servers().stop(resourceGroupName, serverName, context); + } + public ServerImpl withRegion(Region location) { - this.createParameters.withLocation(location.toString()); + this.innerModel().withLocation(location.toString()); return this; } public ServerImpl withRegion(String location) { - this.createParameters.withLocation(location); + this.innerModel().withLocation(location); return this; } - public ServerImpl withProperties(ServerPropertiesForCreate properties) { - this.createParameters.withProperties(properties); + public ServerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ServerImpl withIdentity(Identity identity) { + this.innerModel().withIdentity(identity); return this; } - public ServerImpl withTags(Map tags) { + public ServerImpl withSku(Sku sku) { if (isInCreateMode()) { - this.createParameters.withTags(tags); + this.innerModel().withSku(sku); return this; } else { - this.updateParameters.withTags(tags); + this.updateParameters.withSku(sku); return this; } } - public ServerImpl withIdentity(ResourceIdentity identity) { + public ServerImpl withAdministratorLogin(String administratorLogin) { + this.innerModel().withAdministratorLogin(administratorLogin); + return this; + } + + public ServerImpl withAdministratorLoginPassword(String administratorLoginPassword) { if (isInCreateMode()) { - this.createParameters.withIdentity(identity); + this.innerModel().withAdministratorLoginPassword(administratorLoginPassword); return this; } else { - this.updateParameters.withIdentity(identity); + this.updateParameters.withAdministratorLoginPassword(administratorLoginPassword); return this; } } - public ServerImpl withSku(Sku sku) { + public ServerImpl withVersion(ServerVersion version) { + this.innerModel().withVersion(version); + return this; + } + + public ServerImpl withStorage(Storage storage) { if (isInCreateMode()) { - this.createParameters.withSku(sku); + this.innerModel().withStorage(storage); return this; } else { - this.updateParameters.withSku(sku); + this.updateParameters.withStorage(storage); return this; } } - public ServerImpl withStorageProfile(StorageProfile storageProfile) { - this.updateParameters.withStorageProfile(storageProfile); + public ServerImpl withBackup(Backup backup) { + if (isInCreateMode()) { + this.innerModel().withBackup(backup); + return this; + } else { + this.updateParameters.withBackup(backup); + return this; + } + } + + public ServerImpl withNetwork(Network network) { + this.innerModel().withNetwork(network); return this; } - public ServerImpl withAdministratorLoginPassword(String administratorLoginPassword) { - this.updateParameters.withAdministratorLoginPassword(administratorLoginPassword); + public ServerImpl withHighAvailability(HighAvailability highAvailability) { + if (isInCreateMode()) { + this.innerModel().withHighAvailability(highAvailability); + return this; + } else { + this.updateParameters.withHighAvailability(highAvailability); + return this; + } + } + + public ServerImpl withSourceServerResourceId(String sourceServerResourceId) { + this.innerModel().withSourceServerResourceId(sourceServerResourceId); return this; } - public ServerImpl withVersion(ServerVersion version) { - this.updateParameters.withVersion(version); + public ServerImpl withPointInTimeUtc(OffsetDateTime pointInTimeUtc) { + this.innerModel().withPointInTimeUtc(pointInTimeUtc); + return this; + } + + public ServerImpl withAvailabilityZone(String availabilityZone) { + this.innerModel().withAvailabilityZone(availabilityZone); return this; } - public ServerImpl withSslEnforcement(SslEnforcementEnum sslEnforcement) { - this.updateParameters.withSslEnforcement(sslEnforcement); + public ServerImpl withCreateMode(CreateMode createMode) { + this.innerModel().withCreateMode(createMode); return this; } - public ServerImpl withMinimalTlsVersion(MinimalTlsVersionEnum minimalTlsVersion) { - this.updateParameters.withMinimalTlsVersion(minimalTlsVersion); + public ServerImpl withTagsPropertiesTags(Map tagsPropertiesTags) { + this.innerModel().withTagsPropertiesTags(tagsPropertiesTags); return this; } - public ServerImpl withPublicNetworkAccess(PublicNetworkAccessEnum publicNetworkAccess) { - this.updateParameters.withPublicNetworkAccess(publicNetworkAccess); + public ServerImpl withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { + this.updateParameters.withMaintenanceWindow(maintenanceWindow); return this; } - public ServerImpl withReplicationRole(String replicationRole) { - this.updateParameters.withReplicationRole(replicationRole); + public ServerImpl withCreateMode(CreateModeForUpdate createMode) { + this.updateParameters.withCreateMode(createMode); return this; } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerKeyImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerKeyImpl.java deleted file mode 100644 index eaabdd239aa8..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerKeyImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.ServerKeyInner; -import com.azure.resourcemanager.postgresql.models.ServerKey; -import com.azure.resourcemanager.postgresql.models.ServerKeyType; -import java.time.OffsetDateTime; - -public final class ServerKeyImpl implements ServerKey, ServerKey.Definition, ServerKey.Update { - private ServerKeyInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public ServerKeyType serverKeyType() { - return this.innerModel().serverKeyType(); - } - - public String uri() { - return this.innerModel().uri(); - } - - public OffsetDateTime creationDate() { - return this.innerModel().creationDate(); - } - - public ServerKeyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } - - private String serverName; - - private String keyName; - - private String resourceGroupName; - - public ServerKeyImpl withExistingServer(String serverName, String resourceGroupName) { - this.serverName = serverName; - this.resourceGroupName = resourceGroupName; - return this; - } - - public ServerKey create() { - this.innerObject = - serviceManager - .serviceClient() - .getServerKeys() - .createOrUpdate(serverName, keyName, resourceGroupName, this.innerModel(), Context.NONE); - return this; - } - - public ServerKey create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getServerKeys() - .createOrUpdate(serverName, keyName, resourceGroupName, this.innerModel(), context); - return this; - } - - ServerKeyImpl(String name, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = new ServerKeyInner(); - this.serviceManager = serviceManager; - this.keyName = name; - } - - public ServerKeyImpl update() { - return this; - } - - public ServerKey apply() { - this.innerObject = - serviceManager - .serviceClient() - .getServerKeys() - .createOrUpdate(serverName, keyName, resourceGroupName, this.innerModel(), Context.NONE); - return this; - } - - public ServerKey apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getServerKeys() - .createOrUpdate(serverName, keyName, resourceGroupName, this.innerModel(), context); - return this; - } - - ServerKeyImpl(ServerKeyInner innerObject, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "servers"); - this.keyName = Utils.getValueFromIdByName(innerObject.id(), "keys"); - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - } - - public ServerKey refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getServerKeys() - .getWithResponse(resourceGroupName, serverName, keyName, Context.NONE) - .getValue(); - return this; - } - - public ServerKey refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getServerKeys() - .getWithResponse(resourceGroupName, serverName, keyName, context) - .getValue(); - return this; - } - - public ServerKeyImpl withServerKeyType(ServerKeyType serverKeyType) { - this.innerModel().withServerKeyType(serverKeyType); - return this; - } - - public ServerKeyImpl withUri(String uri) { - this.innerModel().withUri(uri); - return this; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerKeysClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerKeysClientImpl.java deleted file mode 100644 index 9374f57881da..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerKeysClientImpl.java +++ /dev/null @@ -1,1091 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.ServerKeysClient; -import com.azure.resourcemanager.postgresql.fluent.models.ServerKeyInner; -import com.azure.resourcemanager.postgresql.models.ServerKeyListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServerKeysClient. */ -public final class ServerKeysClientImpl implements ServerKeysClient { - private final ClientLogger logger = new ClientLogger(ServerKeysClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ServerKeysService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of ServerKeysClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServerKeysClientImpl(PostgreSqlManagementClientImpl client) { - this.service = - RestProxy.create(ServerKeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientServerKeys to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface ServerKeysService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/keys") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/keys/{keyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("keyName") String keyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/keys/{keyName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("serverName") String serverName, - @PathParam("keyName") String keyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @BodyParam("application/json") ServerKeyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/keys/{keyName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("serverName") String serverName, - @PathParam("keyName") String keyName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, serverName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName)); - } - - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serverName, context)); - } - - /** - * Gets a PostgreSQL Server key. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String keyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - keyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a PostgreSQL Server key. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String keyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - keyName, - apiVersion, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Gets a PostgreSQL Server key. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String serverName, String keyName) { - return getWithResponseAsync(resourceGroupName, serverName, keyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a PostgreSQL Server key. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerKeyInner get(String resourceGroupName, String serverName, String keyName) { - return getAsync(resourceGroupName, serverName, keyName).block(); - } - - /** - * Gets a PostgreSQL Server key. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, String keyName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, keyName, context).block(); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - serverName, - keyName, - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - serverName, - keyName, - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - parameters, - accept, - context); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ServerKeyInner> beginCreateOrUpdateAsync( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(serverName, keyName, resourceGroupName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ServerKeyInner.class, ServerKeyInner.class, Context.NONE); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ServerKeyInner> beginCreateOrUpdateAsync( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(serverName, keyName, resourceGroupName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ServerKeyInner.class, ServerKeyInner.class, context); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServerKeyInner> beginCreateOrUpdate( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters) { - return beginCreateOrUpdateAsync(serverName, keyName, resourceGroupName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServerKeyInner> beginCreateOrUpdate( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters, Context context) { - return beginCreateOrUpdateAsync(serverName, keyName, resourceGroupName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters) { - return beginCreateOrUpdateAsync(serverName, keyName, resourceGroupName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters, Context context) { - return beginCreateOrUpdateAsync(serverName, keyName, resourceGroupName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerKeyInner createOrUpdate( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters) { - return createOrUpdateAsync(serverName, keyName, resourceGroupName, parameters).block(); - } - - /** - * Creates or updates a PostgreSQL Server key. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be operated on (updated or created). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters The requested PostgreSQL Server key resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerKeyInner createOrUpdate( - String serverName, String keyName, String resourceGroupName, ServerKeyInner parameters, Context context) { - return createOrUpdateAsync(serverName, keyName, resourceGroupName, parameters, context).block(); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String serverName, String keyName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - serverName, - keyName, - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String serverName, String keyName, String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (keyName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - serverName, - keyName, - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String serverName, String keyName, String resourceGroupName) { - Mono>> mono = deleteWithResponseAsync(serverName, keyName, resourceGroupName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String serverName, String keyName, String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(serverName, keyName, resourceGroupName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String serverName, String keyName, String resourceGroupName) { - return beginDeleteAsync(serverName, keyName, resourceGroupName).getSyncPoller(); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String serverName, String keyName, String resourceGroupName, Context context) { - return beginDeleteAsync(serverName, keyName, resourceGroupName, context).getSyncPoller(); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String serverName, String keyName, String resourceGroupName) { - return beginDeleteAsync(serverName, keyName, resourceGroupName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String serverName, String keyName, String resourceGroupName, Context context) { - return beginDeleteAsync(serverName, keyName, resourceGroupName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String serverName, String keyName, String resourceGroupName) { - deleteAsync(serverName, keyName, resourceGroupName).block(); - } - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String serverName, String keyName, String resourceGroupName, Context context) { - deleteAsync(serverName, keyName, resourceGroupName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of PostgreSQL Server keys. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of PostgreSQL Server keys. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerKeysImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerKeysImpl.java deleted file mode 100644 index 6bd01f9ed122..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerKeysImpl.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.ServerKeysClient; -import com.azure.resourcemanager.postgresql.fluent.models.ServerKeyInner; -import com.azure.resourcemanager.postgresql.models.ServerKey; -import com.azure.resourcemanager.postgresql.models.ServerKeys; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ServerKeysImpl implements ServerKeys { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerKeysImpl.class); - - private final ServerKeysClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public ServerKeysImpl( - ServerKeysClient innerClient, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new ServerKeyImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String serverName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new ServerKeyImpl(inner1, this.manager())); - } - - public ServerKey get(String resourceGroupName, String serverName, String keyName) { - ServerKeyInner inner = this.serviceClient().get(resourceGroupName, serverName, keyName); - if (inner != null) { - return new ServerKeyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String serverName, String keyName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, keyName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ServerKeyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String serverName, String keyName, String resourceGroupName) { - this.serviceClient().delete(serverName, keyName, resourceGroupName); - } - - public void delete(String serverName, String keyName, String resourceGroupName, Context context) { - this.serviceClient().delete(serverName, keyName, resourceGroupName, context); - } - - public ServerKey getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String keyName = Utils.getValueFromIdByName(id, "keys"); - if (keyName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, keyName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String keyName = Utils.getValueFromIdByName(id, "keys"); - if (keyName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, keyName, context); - } - - public void deleteById(String id) { - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String keyName = Utils.getValueFromIdByName(id, "keys"); - if (keyName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); - } - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.delete(serverName, keyName, resourceGroupName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String keyName = Utils.getValueFromIdByName(id, "keys"); - if (keyName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); - } - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.delete(serverName, keyName, resourceGroupName, context); - } - - private ServerKeysClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } - - public ServerKeyImpl define(String name) { - return new ServerKeyImpl(name, this.manager()); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerParametersClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerParametersClientImpl.java deleted file mode 100644 index 0178f2cc04d8..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerParametersClientImpl.java +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.ServerParametersClient; -import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationListResultInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServerParametersClient. */ -public final class ServerParametersClientImpl implements ServerParametersClient { - private final ClientLogger logger = new ClientLogger(ServerParametersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ServerParametersService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of ServerParametersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServerParametersClientImpl(PostgreSqlManagementClientImpl client) { - this.service = - RestProxy.create(ServerParametersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientServerParameters to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface ServerParametersService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/updateConfigurations") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listUpdateConfigurations( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @BodyParam("application/json") ConfigurationListResultInner value, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listUpdateConfigurationsWithResponseAsync( - String resourceGroupName, String serverName, ConfigurationListResultInner value) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } else { - value.validate(); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listUpdateConfigurations( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - value, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listUpdateConfigurationsWithResponseAsync( - String resourceGroupName, String serverName, ConfigurationListResultInner value, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (value == null) { - return Mono.error(new IllegalArgumentException("Parameter value is required and cannot be null.")); - } else { - value.validate(); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listUpdateConfigurations( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - serverName, - value, - accept, - context); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ConfigurationListResultInner> - beginListUpdateConfigurationsAsync( - String resourceGroupName, String serverName, ConfigurationListResultInner value) { - Mono>> mono = - listUpdateConfigurationsWithResponseAsync(resourceGroupName, serverName, value); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfigurationListResultInner.class, - ConfigurationListResultInner.class, - Context.NONE); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ConfigurationListResultInner> - beginListUpdateConfigurationsAsync( - String resourceGroupName, String serverName, ConfigurationListResultInner value, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - listUpdateConfigurationsWithResponseAsync(resourceGroupName, serverName, value, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfigurationListResultInner.class, - ConfigurationListResultInner.class, - context); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConfigurationListResultInner> - beginListUpdateConfigurations(String resourceGroupName, String serverName, ConfigurationListResultInner value) { - return beginListUpdateConfigurationsAsync(resourceGroupName, serverName, value).getSyncPoller(); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ConfigurationListResultInner> - beginListUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value, Context context) { - return beginListUpdateConfigurationsAsync(resourceGroupName, serverName, value, context).getSyncPoller(); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listUpdateConfigurationsAsync( - String resourceGroupName, String serverName, ConfigurationListResultInner value) { - return beginListUpdateConfigurationsAsync(resourceGroupName, serverName, value) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listUpdateConfigurationsAsync( - String resourceGroupName, String serverName, ConfigurationListResultInner value, Context context) { - return beginListUpdateConfigurationsAsync(resourceGroupName, serverName, value, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationListResultInner listUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value) { - return listUpdateConfigurationsAsync(resourceGroupName, serverName, value).block(); - } - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationListResultInner listUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value, Context context) { - return listUpdateConfigurationsAsync(resourceGroupName, serverName, value, context).block(); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerParametersImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerParametersImpl.java deleted file mode 100644 index 9dce6e00826a..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerParametersImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.ServerParametersClient; -import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationListResultInner; -import com.azure.resourcemanager.postgresql.models.ConfigurationListResult; -import com.azure.resourcemanager.postgresql.models.ServerParameters; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ServerParametersImpl implements ServerParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerParametersImpl.class); - - private final ServerParametersClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public ServerParametersImpl( - ServerParametersClient innerClient, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public ConfigurationListResult listUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value) { - ConfigurationListResultInner inner = - this.serviceClient().listUpdateConfigurations(resourceGroupName, serverName, value); - if (inner != null) { - return new ConfigurationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public ConfigurationListResult listUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value, Context context) { - ConfigurationListResultInner inner = - this.serviceClient().listUpdateConfigurations(resourceGroupName, serverName, value, context); - if (inner != null) { - return new ConfigurationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private ServerParametersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerSecurityAlertPoliciesClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerSecurityAlertPoliciesClientImpl.java deleted file mode 100644 index 9b138dd2e137..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerSecurityAlertPoliciesClientImpl.java +++ /dev/null @@ -1,889 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.ServerSecurityAlertPoliciesClient; -import com.azure.resourcemanager.postgresql.fluent.models.ServerSecurityAlertPolicyInner; -import com.azure.resourcemanager.postgresql.models.SecurityAlertPolicyName; -import com.azure.resourcemanager.postgresql.models.ServerSecurityAlertPolicyListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServerSecurityAlertPoliciesClient. */ -public final class ServerSecurityAlertPoliciesClientImpl implements ServerSecurityAlertPoliciesClient { - private final ClientLogger logger = new ClientLogger(ServerSecurityAlertPoliciesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ServerSecurityAlertPoliciesService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of ServerSecurityAlertPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServerSecurityAlertPoliciesClientImpl(PostgreSqlManagementClientImpl client) { - this.service = - RestProxy - .create( - ServerSecurityAlertPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientServerSecurityAlertPolicies to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface ServerSecurityAlertPoliciesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("securityAlertPolicyName") SecurityAlertPolicyName securityAlertPolicyName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("securityAlertPolicyName") SecurityAlertPolicyName securityAlertPolicyName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ServerSecurityAlertPolicyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL" - + "/servers/{serverName}/securityAlertPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a server's security alert policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (securityAlertPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - securityAlertPolicyName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a server's security alert policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (securityAlertPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - securityAlertPolicyName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context); - } - - /** - * Get a server's security alert policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName) { - return getWithResponseAsync(resourceGroupName, serverName, securityAlertPolicyName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get a server's security alert policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerSecurityAlertPolicyInner get( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName) { - return getAsync(resourceGroupName, serverName, securityAlertPolicyName).block(); - } - - /** - * Get a server's security alert policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, securityAlertPolicyName, context).block(); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (securityAlertPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serverName, - securityAlertPolicyName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (securityAlertPolicyName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serverName, - securityAlertPolicyName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ServerSecurityAlertPolicyInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, securityAlertPolicyName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServerSecurityAlertPolicyInner.class, - ServerSecurityAlertPolicyInner.class, - Context.NONE); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, ServerSecurityAlertPolicyInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, serverName, securityAlertPolicyName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ServerSecurityAlertPolicyInner.class, - ServerSecurityAlertPolicyInner.class, - context); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServerSecurityAlertPolicyInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, securityAlertPolicyName, parameters) - .getSyncPoller(); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, ServerSecurityAlertPolicyInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, securityAlertPolicyName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, securityAlertPolicyName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, securityAlertPolicyName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerSecurityAlertPolicyInner createOrUpdate( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, securityAlertPolicyName, parameters).block(); - } - - /** - * Creates or updates a threat detection policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the threat detection policy. - * @param parameters The server security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server security alert policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerSecurityAlertPolicyInner createOrUpdate( - String resourceGroupName, - String serverName, - SecurityAlertPolicyName securityAlertPolicyName, - ServerSecurityAlertPolicyInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, securityAlertPolicyName, parameters, context).block(); - } - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByServer( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync( - String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); - } - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); - } - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer( - String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of the server's security alert policies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of the server's security alert policies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerSecurityAlertPoliciesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerSecurityAlertPoliciesImpl.java deleted file mode 100644 index cc2437538b73..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerSecurityAlertPoliciesImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.ServerSecurityAlertPoliciesClient; -import com.azure.resourcemanager.postgresql.fluent.models.ServerSecurityAlertPolicyInner; -import com.azure.resourcemanager.postgresql.models.SecurityAlertPolicyName; -import com.azure.resourcemanager.postgresql.models.ServerSecurityAlertPolicies; -import com.azure.resourcemanager.postgresql.models.ServerSecurityAlertPolicy; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ServerSecurityAlertPoliciesImpl implements ServerSecurityAlertPolicies { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerSecurityAlertPoliciesImpl.class); - - private final ServerSecurityAlertPoliciesClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public ServerSecurityAlertPoliciesImpl( - ServerSecurityAlertPoliciesClient innerClient, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public ServerSecurityAlertPolicy get( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName) { - ServerSecurityAlertPolicyInner inner = - this.serviceClient().get(resourceGroupName, serverName, securityAlertPolicyName); - if (inner != null) { - return new ServerSecurityAlertPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, securityAlertPolicyName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ServerSecurityAlertPolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new ServerSecurityAlertPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByServer( - String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new ServerSecurityAlertPolicyImpl(inner1, this.manager())); - } - - public ServerSecurityAlertPolicy getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - SecurityAlertPolicyName securityAlertPolicyName = - SecurityAlertPolicyName.fromString(Utils.getValueFromIdByName(id, "securityAlertPolicies")); - if (securityAlertPolicyName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityAlertPolicies'.", - id))); - } - return this.getWithResponse(resourceGroupName, serverName, securityAlertPolicyName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - SecurityAlertPolicyName securityAlertPolicyName = - SecurityAlertPolicyName.fromString(Utils.getValueFromIdByName(id, "securityAlertPolicies")); - if (securityAlertPolicyName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityAlertPolicies'.", - id))); - } - return this.getWithResponse(resourceGroupName, serverName, securityAlertPolicyName, context); - } - - private ServerSecurityAlertPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } - - public ServerSecurityAlertPolicyImpl define(SecurityAlertPolicyName name) { - return new ServerSecurityAlertPolicyImpl(name, this.manager()); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerSecurityAlertPolicyImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerSecurityAlertPolicyImpl.java deleted file mode 100644 index 2047e41bbbe4..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServerSecurityAlertPolicyImpl.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.ServerSecurityAlertPolicyInner; -import com.azure.resourcemanager.postgresql.models.SecurityAlertPolicyName; -import com.azure.resourcemanager.postgresql.models.ServerSecurityAlertPolicy; -import com.azure.resourcemanager.postgresql.models.ServerSecurityAlertPolicyState; -import java.util.Collections; -import java.util.List; - -public final class ServerSecurityAlertPolicyImpl - implements ServerSecurityAlertPolicy, ServerSecurityAlertPolicy.Definition, ServerSecurityAlertPolicy.Update { - private ServerSecurityAlertPolicyInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ServerSecurityAlertPolicyState state() { - return this.innerModel().state(); - } - - public List disabledAlerts() { - List inner = this.innerModel().disabledAlerts(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List emailAddresses() { - List inner = this.innerModel().emailAddresses(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean emailAccountAdmins() { - return this.innerModel().emailAccountAdmins(); - } - - public String storageEndpoint() { - return this.innerModel().storageEndpoint(); - } - - public String storageAccountAccessKey() { - return this.innerModel().storageAccountAccessKey(); - } - - public Integer retentionDays() { - return this.innerModel().retentionDays(); - } - - public ServerSecurityAlertPolicyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private SecurityAlertPolicyName securityAlertPolicyName; - - public ServerSecurityAlertPolicyImpl withExistingServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public ServerSecurityAlertPolicy create() { - this.innerObject = - serviceManager - .serviceClient() - .getServerSecurityAlertPolicies() - .createOrUpdate( - resourceGroupName, serverName, securityAlertPolicyName, this.innerModel(), Context.NONE); - return this; - } - - public ServerSecurityAlertPolicy create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getServerSecurityAlertPolicies() - .createOrUpdate(resourceGroupName, serverName, securityAlertPolicyName, this.innerModel(), context); - return this; - } - - ServerSecurityAlertPolicyImpl( - SecurityAlertPolicyName name, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = new ServerSecurityAlertPolicyInner(); - this.serviceManager = serviceManager; - this.securityAlertPolicyName = name; - } - - public ServerSecurityAlertPolicyImpl update() { - return this; - } - - public ServerSecurityAlertPolicy apply() { - this.innerObject = - serviceManager - .serviceClient() - .getServerSecurityAlertPolicies() - .createOrUpdate( - resourceGroupName, serverName, securityAlertPolicyName, this.innerModel(), Context.NONE); - return this; - } - - public ServerSecurityAlertPolicy apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getServerSecurityAlertPolicies() - .createOrUpdate(resourceGroupName, serverName, securityAlertPolicyName, this.innerModel(), context); - return this; - } - - ServerSecurityAlertPolicyImpl( - ServerSecurityAlertPolicyInner innerObject, - com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "servers"); - this.securityAlertPolicyName = - SecurityAlertPolicyName.fromString(Utils.getValueFromIdByName(innerObject.id(), "securityAlertPolicies")); - } - - public ServerSecurityAlertPolicy refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getServerSecurityAlertPolicies() - .getWithResponse(resourceGroupName, serverName, securityAlertPolicyName, Context.NONE) - .getValue(); - return this; - } - - public ServerSecurityAlertPolicy refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getServerSecurityAlertPolicies() - .getWithResponse(resourceGroupName, serverName, securityAlertPolicyName, context) - .getValue(); - return this; - } - - public ServerSecurityAlertPolicyImpl withState(ServerSecurityAlertPolicyState state) { - this.innerModel().withState(state); - return this; - } - - public ServerSecurityAlertPolicyImpl withDisabledAlerts(List disabledAlerts) { - this.innerModel().withDisabledAlerts(disabledAlerts); - return this; - } - - public ServerSecurityAlertPolicyImpl withEmailAddresses(List emailAddresses) { - this.innerModel().withEmailAddresses(emailAddresses); - return this; - } - - public ServerSecurityAlertPolicyImpl withEmailAccountAdmins(Boolean emailAccountAdmins) { - this.innerModel().withEmailAccountAdmins(emailAccountAdmins); - return this; - } - - public ServerSecurityAlertPolicyImpl withStorageEndpoint(String storageEndpoint) { - this.innerModel().withStorageEndpoint(storageEndpoint); - return this; - } - - public ServerSecurityAlertPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { - this.innerModel().withStorageAccountAccessKey(storageAccountAccessKey); - return this; - } - - public ServerSecurityAlertPolicyImpl withRetentionDays(Integer retentionDays) { - this.innerModel().withRetentionDays(retentionDays); - return this; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServersClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServersClientImpl.java index e56c48e1ce71..1bbc076509f7 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServersClientImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServersClientImpl.java @@ -36,9 +36,9 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.postgresql.fluent.ServersClient; import com.azure.resourcemanager.postgresql.fluent.models.ServerInner; -import com.azure.resourcemanager.postgresql.models.ServerForCreate; +import com.azure.resourcemanager.postgresql.models.RestartParameter; +import com.azure.resourcemanager.postgresql.models.ServerForUpdate; import com.azure.resourcemanager.postgresql.models.ServerListResult; -import com.azure.resourcemanager.postgresql.models.ServerUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -72,8 +72,8 @@ public final class ServersClientImpl implements ServersClient { private interface ServersService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -82,14 +82,14 @@ Mono>> create( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @BodyParam("application/json") ServerForCreate parameters, + @BodyParam("application/json") ServerInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -98,14 +98,14 @@ Mono>> update( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, - @BodyParam("application/json") ServerUpdateParameters parameters, + @BodyParam("application/json") ServerForUpdate parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -119,8 +119,8 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -134,8 +134,8 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -147,7 +147,7 @@ Mono> listByResourceGroup( Context context); @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSQL/servers") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSql/flexibleServers") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -159,8 +159,8 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/restart") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/restart") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> restart( @@ -169,12 +169,63 @@ Mono>> restart( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serverName") String serverName, + @BodyParam("application/json") RestartParameter parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql" + + "/flexibleServers/{serverName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -186,7 +237,7 @@ Mono>> restart( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( - String resourceGroupName, String serverName, ServerForCreate parameters) { + String resourceGroupName, String serverName, ServerInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -211,7 +262,6 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -219,7 +269,7 @@ private Mono>> createWithResponseAsync( service .create( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -230,7 +280,7 @@ private Mono>> createWithResponseAsync( } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -243,7 +293,7 @@ private Mono>> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( - String resourceGroupName, String serverName, ServerForCreate parameters, Context context) { + String resourceGroupName, String serverName, ServerInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -268,13 +318,12 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .create( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -284,7 +333,7 @@ private Mono>> createWithResponseAsync( } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -296,7 +345,7 @@ private Mono>> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private PollerFlux, ServerInner> beginCreateAsync( - String resourceGroupName, String serverName, ServerForCreate parameters) { + String resourceGroupName, String serverName, ServerInner parameters) { Mono>> mono = createWithResponseAsync(resourceGroupName, serverName, parameters); return this .client @@ -305,7 +354,7 @@ private PollerFlux, ServerInner> beginCreateAsync( } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -318,7 +367,7 @@ private PollerFlux, ServerInner> beginCreateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private PollerFlux, ServerInner> beginCreateAsync( - String resourceGroupName, String serverName, ServerForCreate parameters, Context context) { + String resourceGroupName, String serverName, ServerInner parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = createWithResponseAsync(resourceGroupName, serverName, parameters, context); @@ -329,7 +378,7 @@ private PollerFlux, ServerInner> beginCreateAsync( } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -341,12 +390,12 @@ private PollerFlux, ServerInner> beginCreateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, ServerInner> beginCreate( - String resourceGroupName, String serverName, ServerForCreate parameters) { + String resourceGroupName, String serverName, ServerInner parameters) { return beginCreateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -359,12 +408,12 @@ public SyncPoller, ServerInner> beginCreate( */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, ServerInner> beginCreate( - String resourceGroupName, String serverName, ServerForCreate parameters, Context context) { + String resourceGroupName, String serverName, ServerInner parameters, Context context) { return beginCreateAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -375,14 +424,14 @@ public SyncPoller, ServerInner> beginCreate( * @return represents a server. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String serverName, ServerForCreate parameters) { + private Mono createAsync(String resourceGroupName, String serverName, ServerInner parameters) { return beginCreateAsync(resourceGroupName, serverName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -395,14 +444,14 @@ private Mono createAsync(String resourceGroupName, String serverNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( - String resourceGroupName, String serverName, ServerForCreate parameters, Context context) { + String resourceGroupName, String serverName, ServerInner parameters, Context context) { return beginCreateAsync(resourceGroupName, serverName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -413,12 +462,12 @@ private Mono createAsync( * @return represents a server. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner create(String resourceGroupName, String serverName, ServerForCreate parameters) { + public ServerInner create(String resourceGroupName, String serverName, ServerInner parameters) { return createAsync(resourceGroupName, serverName, parameters).block(); } /** - * Creates a new server, or will overwrite an existing server. + * Creates a new server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -430,8 +479,7 @@ public ServerInner create(String resourceGroupName, String serverName, ServerFor * @return represents a server. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner create( - String resourceGroupName, String serverName, ServerForCreate parameters, Context context) { + public ServerInner create(String resourceGroupName, String serverName, ServerInner parameters, Context context) { return createAsync(resourceGroupName, serverName, parameters, context).block(); } @@ -449,7 +497,7 @@ public ServerInner create( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( - String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + String resourceGroupName, String serverName, ServerForUpdate parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -474,7 +522,6 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -482,7 +529,7 @@ private Mono>> updateWithResponseAsync( service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -507,7 +554,7 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( - String resourceGroupName, String serverName, ServerUpdateParameters parameters, Context context) { + String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -532,13 +579,12 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -561,7 +607,7 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private PollerFlux, ServerInner> beginUpdateAsync( - String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + String resourceGroupName, String serverName, ServerForUpdate parameters) { Mono>> mono = updateWithResponseAsync(resourceGroupName, serverName, parameters); return this .client @@ -584,7 +630,7 @@ private PollerFlux, ServerInner> beginUpdateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private PollerFlux, ServerInner> beginUpdateAsync( - String resourceGroupName, String serverName, ServerUpdateParameters parameters, Context context) { + String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = updateWithResponseAsync(resourceGroupName, serverName, parameters, context); @@ -608,7 +654,7 @@ private PollerFlux, ServerInner> beginUpdateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, ServerInner> beginUpdate( - String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + String resourceGroupName, String serverName, ServerForUpdate parameters) { return beginUpdateAsync(resourceGroupName, serverName, parameters).getSyncPoller(); } @@ -627,7 +673,7 @@ public SyncPoller, ServerInner> beginUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, ServerInner> beginUpdate( - String resourceGroupName, String serverName, ServerUpdateParameters parameters, Context context) { + String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); } @@ -644,8 +690,7 @@ public SyncPoller, ServerInner> beginUpdate( * @return represents a server. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + private Mono updateAsync(String resourceGroupName, String serverName, ServerForUpdate parameters) { return beginUpdateAsync(resourceGroupName, serverName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -666,7 +711,7 @@ private Mono updateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( - String resourceGroupName, String serverName, ServerUpdateParameters parameters, Context context) { + String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, serverName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -685,7 +730,7 @@ private Mono updateAsync( * @return represents a server. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ServerInner update(String resourceGroupName, String serverName, ServerUpdateParameters parameters) { + public ServerInner update(String resourceGroupName, String serverName, ServerForUpdate parameters) { return updateAsync(resourceGroupName, serverName, parameters).block(); } @@ -704,7 +749,7 @@ public ServerInner update(String resourceGroupName, String serverName, ServerUpd */ @ServiceMethod(returns = ReturnType.SINGLE) public ServerInner update( - String resourceGroupName, String serverName, ServerUpdateParameters parameters, Context context) { + String resourceGroupName, String serverName, ServerForUpdate parameters, Context context) { return updateAsync(resourceGroupName, serverName, parameters, context).block(); } @@ -739,7 +784,6 @@ private Mono>> deleteWithResponseAsync(String resource if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -747,7 +791,7 @@ private Mono>> deleteWithResponseAsync(String resource service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -789,13 +833,12 @@ private Mono>> deleteWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -968,7 +1011,6 @@ private Mono> getByResourceGroupWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -976,7 +1018,7 @@ private Mono> getByResourceGroupWithResponseAsync( service .getByResourceGroup( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -1018,13 +1060,12 @@ private Mono> getByResourceGroupWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, @@ -1114,7 +1155,6 @@ private Mono> listByResourceGroupSinglePageAsync(Stri return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1122,7 +1162,7 @@ private Mono> listByResourceGroupSinglePageAsync(Stri service .listByResourceGroup( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, @@ -1130,7 +1170,12 @@ private Mono> listByResourceGroupSinglePageAsync(Stri .>map( res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1163,13 +1208,12 @@ private Mono> listByResourceGroupSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, @@ -1177,7 +1221,12 @@ private Mono> listByResourceGroupSinglePageAsync( .map( res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** @@ -1191,7 +1240,9 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** @@ -1206,7 +1257,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** @@ -1259,17 +1312,26 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) .>map( res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1296,15 +1358,24 @@ private Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) .map( res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** @@ -1316,7 +1387,7 @@ private Mono> listSinglePageAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -1330,7 +1401,8 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -1364,13 +1436,15 @@ public PagedIterable list(Context context) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync(String resourceGroupName, String serverName) { + private Mono>> restartWithResponseAsync( + String resourceGroupName, String serverName, RestartParameter parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1390,7 +1464,9 @@ private Mono>> restartWithResponseAsync(String resourc if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; + if (parameters != null) { + parameters.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( @@ -1398,10 +1474,11 @@ private Mono>> restartWithResponseAsync(String resourc service .restart( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, + parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1412,6 +1489,7 @@ private Mono>> restartWithResponseAsync(String resourc * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1420,7 +1498,7 @@ private Mono>> restartWithResponseAsync(String resourc */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartWithResponseAsync( - String resourceGroupName, String serverName, Context context) { + String resourceGroupName, String serverName, RestartParameter parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1440,16 +1518,19 @@ private Mono>> restartWithResponseAsync( if (serverName == null) { return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; + if (parameters != null) { + parameters.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, + parameters, accept, context); } @@ -1459,14 +1540,16 @@ private Mono>> restartWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String serverName) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, serverName); + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String serverName, RestartParameter parameters) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, serverName, parameters); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); @@ -1477,6 +1560,7 @@ private PollerFlux, Void> beginRestartAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1485,9 +1569,10 @@ private PollerFlux, Void> beginRestartAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.SINGLE) private PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String serverName, Context context) { + String resourceGroupName, String serverName, RestartParameter parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = restartWithResponseAsync(resourceGroupName, serverName, context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, serverName, parameters, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); @@ -1498,14 +1583,16 @@ private PollerFlux, Void> beginRestartAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestart(String resourceGroupName, String serverName) { - return beginRestartAsync(resourceGroupName, serverName).getSyncPoller(); + public SyncPoller, Void> beginRestart( + String resourceGroupName, String serverName, RestartParameter parameters) { + return beginRestartAsync(resourceGroupName, serverName, parameters).getSyncPoller(); } /** @@ -1513,6 +1600,7 @@ public SyncPoller, Void> beginRestart(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1521,8 +1609,26 @@ public SyncPoller, Void> beginRestart(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, Void> beginRestart( - String resourceGroupName, String serverName, Context context) { - return beginRestartAsync(resourceGroupName, serverName, context).getSyncPoller(); + String resourceGroupName, String serverName, RestartParameter parameters, Context context) { + return beginRestartAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); + } + + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String serverName, RestartParameter parameters) { + return beginRestartAsync(resourceGroupName, serverName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1537,7 +1643,10 @@ public SyncPoller, Void> beginRestart( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono restartAsync(String resourceGroupName, String serverName) { - return beginRestartAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); + final RestartParameter parameters = null; + return beginRestartAsync(resourceGroupName, serverName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1545,6 +1654,7 @@ private Mono restartAsync(String resourceGroupName, String serverName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1552,12 +1662,28 @@ private Mono restartAsync(String resourceGroupName, String serverName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String serverName, Context context) { - return beginRestartAsync(resourceGroupName, serverName, context) + private Mono restartAsync( + String resourceGroupName, String serverName, RestartParameter parameters, Context context) { + return beginRestartAsync(resourceGroupName, serverName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String serverName, RestartParameter parameters) { + restartAsync(resourceGroupName, serverName, parameters).block(); + } + /** * Restarts a server. * @@ -1569,7 +1695,8 @@ private Mono restartAsync(String resourceGroupName, String serverName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) public void restart(String resourceGroupName, String serverName) { - restartAsync(resourceGroupName, serverName).block(); + final RestartParameter parameters = null; + restartAsync(resourceGroupName, serverName, parameters).block(); } /** @@ -1577,13 +1704,607 @@ public void restart(String resourceGroupName, String serverName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String serverName, RestartParameter parameters, Context context) { + restartAsync(resourceGroupName, serverName, parameters, context).block(); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String serverName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String serverName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String serverName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, serverName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String serverName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, serverName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart(String resourceGroupName, String serverName) { + return beginStartAsync(resourceGroupName, serverName).getSyncPoller(); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart(String resourceGroupName, String serverName, Context context) { + return beginStartAsync(resourceGroupName, serverName, context).getSyncPoller(); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String serverName, Context context) { - restartAsync(resourceGroupName, serverName, context).block(); + private Mono startAsync(String resourceGroupName, String serverName) { + return beginStartAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String serverName, Context context) { + return beginStartAsync(resourceGroupName, serverName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String serverName) { + startAsync(resourceGroupName, serverName).block(); + } + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String serverName, Context context) { + startAsync(resourceGroupName, serverName, context).block(); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceGroupName, String serverName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String serverName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serverName == null) { + return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync(String resourceGroupName, String serverName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, serverName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String serverName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(resourceGroupName, serverName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop(String resourceGroupName, String serverName) { + return beginStopAsync(resourceGroupName, serverName).getSyncPoller(); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop(String resourceGroupName, String serverName, Context context) { + return beginStopAsync(resourceGroupName, serverName, context).getSyncPoller(); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String serverName) { + return beginStopAsync(resourceGroupName, serverName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String serverName, Context context) { + return beginStopAsync(resourceGroupName, serverName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String serverName) { + stopAsync(resourceGroupName, serverName).block(); + } + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String serverName, Context context) { + stopAsync(resourceGroupName, serverName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of servers. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of servers. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of servers. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of servers. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServersImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServersImpl.java index 6b8c4649e381..35551b4eb473 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServersImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/ServersImpl.java @@ -11,6 +11,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.postgresql.fluent.ServersClient; import com.azure.resourcemanager.postgresql.fluent.models.ServerInner; +import com.azure.resourcemanager.postgresql.models.RestartParameter; import com.azure.resourcemanager.postgresql.models.Server; import com.azure.resourcemanager.postgresql.models.Servers; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -80,12 +81,32 @@ public PagedIterable list(Context context) { return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager())); } + public void restart(String resourceGroupName, String serverName, RestartParameter parameters) { + this.serviceClient().restart(resourceGroupName, serverName, parameters); + } + public void restart(String resourceGroupName, String serverName) { this.serviceClient().restart(resourceGroupName, serverName); } - public void restart(String resourceGroupName, String serverName, Context context) { - this.serviceClient().restart(resourceGroupName, serverName, context); + public void restart(String resourceGroupName, String serverName, RestartParameter parameters, Context context) { + this.serviceClient().restart(resourceGroupName, serverName, parameters, context); + } + + public void start(String resourceGroupName, String serverName) { + this.serviceClient().start(resourceGroupName, serverName); + } + + public void start(String resourceGroupName, String serverName, Context context) { + this.serviceClient().start(resourceGroupName, serverName, context); + } + + public void stop(String resourceGroupName, String serverName) { + this.serviceClient().stop(resourceGroupName, serverName); + } + + public void stop(String resourceGroupName, String serverName, Context context) { + this.serviceClient().stop(resourceGroupName, serverName, context); } public Server getById(String id) { @@ -97,12 +118,13 @@ public Server getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, serverName, Context.NONE).getValue(); } @@ -116,12 +138,13 @@ public Response getByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, serverName, context); } @@ -135,12 +158,13 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } this.delete(resourceGroupName, serverName, Context.NONE); } @@ -154,12 +178,13 @@ public void deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String serverName = Utils.getValueFromIdByName(id, "servers"); + String serverName = Utils.getValueFromIdByName(id, "flexibleServers"); if (serverName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); } this.delete(resourceGroupName, serverName, context); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkRuleImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkRuleImpl.java deleted file mode 100644 index 4585a28e37e1..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkRuleImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkRuleInner; -import com.azure.resourcemanager.postgresql.models.VirtualNetworkRule; -import com.azure.resourcemanager.postgresql.models.VirtualNetworkRuleState; - -public final class VirtualNetworkRuleImpl - implements VirtualNetworkRule, VirtualNetworkRule.Definition, VirtualNetworkRule.Update { - private VirtualNetworkRuleInner innerObject; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String virtualNetworkSubnetId() { - return this.innerModel().virtualNetworkSubnetId(); - } - - public Boolean ignoreMissingVnetServiceEndpoint() { - return this.innerModel().ignoreMissingVnetServiceEndpoint(); - } - - public VirtualNetworkRuleState state() { - return this.innerModel().state(); - } - - public VirtualNetworkRuleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String serverName; - - private String virtualNetworkRuleName; - - public VirtualNetworkRuleImpl withExistingServer(String resourceGroupName, String serverName) { - this.resourceGroupName = resourceGroupName; - this.serverName = serverName; - return this; - } - - public VirtualNetworkRule create() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworkRules() - .createOrUpdate(resourceGroupName, serverName, virtualNetworkRuleName, this.innerModel(), Context.NONE); - return this; - } - - public VirtualNetworkRule create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworkRules() - .createOrUpdate(resourceGroupName, serverName, virtualNetworkRuleName, this.innerModel(), context); - return this; - } - - VirtualNetworkRuleImpl(String name, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = new VirtualNetworkRuleInner(); - this.serviceManager = serviceManager; - this.virtualNetworkRuleName = name; - } - - public VirtualNetworkRuleImpl update() { - return this; - } - - public VirtualNetworkRule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworkRules() - .createOrUpdate(resourceGroupName, serverName, virtualNetworkRuleName, this.innerModel(), Context.NONE); - return this; - } - - public VirtualNetworkRule apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworkRules() - .createOrUpdate(resourceGroupName, serverName, virtualNetworkRuleName, this.innerModel(), context); - return this; - } - - VirtualNetworkRuleImpl( - VirtualNetworkRuleInner innerObject, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.serverName = Utils.getValueFromIdByName(innerObject.id(), "servers"); - this.virtualNetworkRuleName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkRules"); - } - - public VirtualNetworkRule refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworkRules() - .getWithResponse(resourceGroupName, serverName, virtualNetworkRuleName, Context.NONE) - .getValue(); - return this; - } - - public VirtualNetworkRule refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworkRules() - .getWithResponse(resourceGroupName, serverName, virtualNetworkRuleName, context) - .getValue(); - return this; - } - - public VirtualNetworkRuleImpl withVirtualNetworkSubnetId(String virtualNetworkSubnetId) { - this.innerModel().withVirtualNetworkSubnetId(virtualNetworkSubnetId); - return this; - } - - public VirtualNetworkRuleImpl withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { - this.innerModel().withIgnoreMissingVnetServiceEndpoint(ignoreMissingVnetServiceEndpoint); - return this; - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkRulesClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkRulesClientImpl.java deleted file mode 100644 index 6ea002cf4e51..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkRulesClientImpl.java +++ /dev/null @@ -1,1152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.postgresql.fluent.VirtualNetworkRulesClient; -import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkRuleInner; -import com.azure.resourcemanager.postgresql.models.VirtualNetworkRuleListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in VirtualNetworkRulesClient. */ -public final class VirtualNetworkRulesClientImpl implements VirtualNetworkRulesClient { - private final ClientLogger logger = new ClientLogger(VirtualNetworkRulesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final VirtualNetworkRulesService service; - - /** The service client containing this operation class. */ - private final PostgreSqlManagementClientImpl client; - - /** - * Initializes an instance of VirtualNetworkRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualNetworkRulesClientImpl(PostgreSqlManagementClientImpl client) { - this.service = - RestProxy.create(VirtualNetworkRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PostgreSqlManagementClientVirtualNetworkRules to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PostgreSqlManagement") - private interface VirtualNetworkRulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("virtualNetworkRuleName") String virtualNetworkRuleName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("virtualNetworkRuleName") String virtualNetworkRuleName, - @BodyParam("application/json") VirtualNetworkRuleInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("virtualNetworkRuleName") String virtualNetworkRuleName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSQL" - + "/servers/{serverName}/virtualNetworkRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServer( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serverName") String serverName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String virtualNetworkRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualNetworkRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - virtualNetworkRuleName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualNetworkRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - virtualNetworkRuleName, - accept, - context); - } - - /** - * Gets a virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String serverName, String virtualNetworkRuleName) { - return getWithResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkRuleInner get(String resourceGroupName, String serverName, String virtualNetworkRuleName) { - return getAsync(resourceGroupName, serverName, virtualNetworkRuleName).block(); - } - - /** - * Gets a virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context) { - return getWithResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, context).block(); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualNetworkRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - virtualNetworkRuleName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualNetworkRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - virtualNetworkRuleName, - parameters, - accept, - context); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkRuleInner.class, - VirtualNetworkRuleInner.class, - Context.NONE); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, VirtualNetworkRuleInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkRuleInner.class, - VirtualNetworkRuleInner.class, - context); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters) - .getSyncPoller(); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, VirtualNetworkRuleInner> beginCreateOrUpdate( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkRuleInner createOrUpdate( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters) { - return createOrUpdateAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).block(); - } - - /** - * Creates or updates an existing virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param parameters The requested virtual Network Rule Resource state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkRuleInner createOrUpdate( - String resourceGroupName, - String serverName, - String virtualNetworkRuleName, - VirtualNetworkRuleInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters, context).block(); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String serverName, String virtualNetworkRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (virtualNetworkRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - serverName, - virtualNetworkRuleName, - this.client.getSubscriptionId(), - apiVersion, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (virtualNetworkRuleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - serverName, - virtualNetworkRuleName, - this.client.getSubscriptionId(), - apiVersion, - context); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serverName, String virtualNetworkRuleName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String virtualNetworkRuleName) { - return beginDeleteAsync(resourceGroupName, serverName, virtualNetworkRuleName).getSyncPoller(); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context) { - return beginDeleteAsync(resourceGroupName, serverName, virtualNetworkRuleName, context).getSyncPoller(); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName) { - return beginDeleteAsync(resourceGroupName, serverName, virtualNetworkRuleName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context) { - return beginDeleteAsync(resourceGroupName, serverName, virtualNetworkRuleName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, String virtualNetworkRuleName) { - deleteAsync(resourceGroupName, serverName, virtualNetworkRuleName).block(); - } - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context) { - deleteAsync(resourceGroupName, serverName, virtualNetworkRuleName, context).block(); - } - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByServer( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerSinglePageAsync( - String resourceGroupName, String serverName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serverName == null) { - return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-12-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServer( - this.client.getEndpoint(), - resourceGroupName, - serverName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync(String resourceGroupName, String serverName) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName), - nextLink -> listByServerNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByServerAsync( - String resourceGroupName, String serverName, Context context) { - return new PagedFlux<>( - () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), - nextLink -> listByServerNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer(String resourceGroupName, String serverName) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); - } - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByServer( - String resourceGroupName, String serverName, Context context) { - return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByServerNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByServerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkRulesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkRulesImpl.java deleted file mode 100644 index 1eb4fa636168..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkRulesImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.VirtualNetworkRulesClient; -import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkRuleInner; -import com.azure.resourcemanager.postgresql.models.VirtualNetworkRule; -import com.azure.resourcemanager.postgresql.models.VirtualNetworkRules; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class VirtualNetworkRulesImpl implements VirtualNetworkRules { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRulesImpl.class); - - private final VirtualNetworkRulesClient innerClient; - - private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; - - public VirtualNetworkRulesImpl( - VirtualNetworkRulesClient innerClient, com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public VirtualNetworkRule get(String resourceGroupName, String serverName, String virtualNetworkRuleName) { - VirtualNetworkRuleInner inner = this.serviceClient().get(resourceGroupName, serverName, virtualNetworkRuleName); - if (inner != null) { - return new VirtualNetworkRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serverName, virtualNetworkRuleName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VirtualNetworkRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String serverName, String virtualNetworkRuleName) { - this.serviceClient().delete(resourceGroupName, serverName, virtualNetworkRuleName); - } - - public void delete(String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context) { - this.serviceClient().delete(resourceGroupName, serverName, virtualNetworkRuleName, context); - } - - public PagedIterable listByServer(String resourceGroupName, String serverName) { - PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName); - return Utils.mapPage(inner, inner1 -> new VirtualNetworkRuleImpl(inner1, this.manager())); - } - - public PagedIterable listByServer( - String resourceGroupName, String serverName, Context context) { - PagedIterable inner = - this.serviceClient().listByServer(resourceGroupName, serverName, context); - return Utils.mapPage(inner, inner1 -> new VirtualNetworkRuleImpl(inner1, this.manager())); - } - - public VirtualNetworkRule getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualNetworkRules"); - if (virtualNetworkRuleName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkRules'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, virtualNetworkRuleName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualNetworkRules"); - if (virtualNetworkRuleName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkRules'.", id))); - } - return this.getWithResponse(resourceGroupName, serverName, virtualNetworkRuleName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualNetworkRules"); - if (virtualNetworkRuleName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkRules'.", id))); - } - this.delete(resourceGroupName, serverName, virtualNetworkRuleName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String serverName = Utils.getValueFromIdByName(id, "servers"); - if (serverName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); - } - String virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualNetworkRules"); - if (virtualNetworkRuleName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkRules'.", id))); - } - this.delete(resourceGroupName, serverName, virtualNetworkRuleName, context); - } - - private VirtualNetworkRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { - return this.serviceManager; - } - - public VirtualNetworkRuleImpl define(String name) { - return new VirtualNetworkRuleImpl(name, this.manager()); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkSubnetUsageResultImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkSubnetUsageResultImpl.java new file mode 100644 index 000000000000..f266c23015a4 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkSubnetUsageResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.implementation; + +import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkSubnetUsageResultInner; +import com.azure.resourcemanager.postgresql.models.DelegatedSubnetUsage; +import com.azure.resourcemanager.postgresql.models.VirtualNetworkSubnetUsageResult; +import java.util.Collections; +import java.util.List; + +public final class VirtualNetworkSubnetUsageResultImpl implements VirtualNetworkSubnetUsageResult { + private VirtualNetworkSubnetUsageResultInner innerObject; + + private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; + + VirtualNetworkSubnetUsageResultImpl( + VirtualNetworkSubnetUsageResultInner innerObject, + com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List delegatedSubnetsUsage() { + List inner = this.innerModel().delegatedSubnetsUsage(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualNetworkSubnetUsageResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedPerformanceTiersClientImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkSubnetUsagesClientImpl.java similarity index 56% rename from sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedPerformanceTiersClientImpl.java rename to sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkSubnetUsagesClientImpl.java index c98b9cd8fe70..44651cd710dc 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/LocationBasedPerformanceTiersClientImpl.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkSubnetUsagesClientImpl.java @@ -4,91 +4,89 @@ package com.azure.resourcemanager.postgresql.implementation; +import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.LocationBasedPerformanceTiersClient; -import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner; -import com.azure.resourcemanager.postgresql.models.PerformanceTierListResult; +import com.azure.resourcemanager.postgresql.fluent.VirtualNetworkSubnetUsagesClient; +import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkSubnetUsageResultInner; +import com.azure.resourcemanager.postgresql.models.VirtualNetworkSubnetUsageParameter; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in LocationBasedPerformanceTiersClient. */ -public final class LocationBasedPerformanceTiersClientImpl implements LocationBasedPerformanceTiersClient { - private final ClientLogger logger = new ClientLogger(LocationBasedPerformanceTiersClientImpl.class); +/** An instance of this class provides access to all the operations defined in VirtualNetworkSubnetUsagesClient. */ +public final class VirtualNetworkSubnetUsagesClientImpl implements VirtualNetworkSubnetUsagesClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkSubnetUsagesClientImpl.class); /** The proxy service used to perform REST calls. */ - private final LocationBasedPerformanceTiersService service; + private final VirtualNetworkSubnetUsagesService service; /** The service client containing this operation class. */ private final PostgreSqlManagementClientImpl client; /** - * Initializes an instance of LocationBasedPerformanceTiersClientImpl. + * Initializes an instance of VirtualNetworkSubnetUsagesClientImpl. * * @param client the instance of the service client containing this operation class. */ - LocationBasedPerformanceTiersClientImpl(PostgreSqlManagementClientImpl client) { + VirtualNetworkSubnetUsagesClientImpl(PostgreSqlManagementClientImpl client) { this.service = RestProxy .create( - LocationBasedPerformanceTiersService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); + VirtualNetworkSubnetUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for PostgreSqlManagementClientLocationBasedPerformanceTiers to be used by + * The interface defining all the services for PostgreSqlManagementClientVirtualNetworkSubnetUsages to be used by * the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "PostgreSqlManagement") - private interface LocationBasedPerformanceTiersService { + private interface VirtualNetworkSubnetUsagesService { @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSQL/locations/{locationName}" - + "/performanceTiers") + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSql/locations/{locationName}" + + "/checkVirtualNetworkSubnetUsage") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> execute( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("locationName") String locationName, + @BodyParam("application/json") VirtualNetworkSubnetUsageParameter parameters, @HeaderParam("Accept") String accept, Context context); } /** - * List all the performance tiers at specified location in a given subscription. + * Get virtual network subnet usage for a given vNet resource id. * * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. + * @return virtual network subnet usage for a given vNet resource id. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName) { + private Mono> executeWithResponseAsync( + String locationName, VirtualNetworkSubnetUsageParameter parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -104,39 +102,41 @@ private Mono> listSinglePageAsync( if (locationName == null) { return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( + .execute( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, + parameters, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all the performance tiers at specified location in a given subscription. + * Get virtual network subnet usage for a given vNet resource id. * * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. + * @return virtual network subnet usage for a given vNet resource id. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String locationName, Context context) { + private Mono> executeWithResponseAsync( + String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -152,72 +152,78 @@ private Mono> listSinglePageAsync( if (locationName == null) { return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); } - final String apiVersion = "2017-12-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), locationName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + .execute( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + locationName, + parameters, + accept, + context); } /** - * List all the performance tiers at specified location in a given subscription. + * Get virtual network subnet usage for a given vNet resource id. * * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. + * @return virtual network subnet usage for a given vNet resource id. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName)); - } - - /** - * List all the performance tiers at specified location in a given subscription. - * - * @param locationName The name of the location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeAsync( + String locationName, VirtualNetworkSubnetUsageParameter parameters) { + return executeWithResponseAsync(locationName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * List all the performance tiers at specified location in a given subscription. + * Get virtual network subnet usage for a given vNet resource id. * * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. + * @return virtual network subnet usage for a given vNet resource id. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName) { - return new PagedIterable<>(listAsync(locationName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkSubnetUsageResultInner execute( + String locationName, VirtualNetworkSubnetUsageParameter parameters) { + return executeAsync(locationName, parameters).block(); } /** - * List all the performance tiers at specified location in a given subscription. + * Get virtual network subnet usage for a given vNet resource id. * * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. + * @return virtual network subnet usage for a given vNet resource id. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, Context context) { - return new PagedIterable<>(listAsync(locationName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response executeWithResponse( + String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context) { + return executeWithResponseAsync(locationName, parameters, context).block(); } } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkSubnetUsagesImpl.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkSubnetUsagesImpl.java new file mode 100644 index 000000000000..afcbd4f57db9 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/implementation/VirtualNetworkSubnetUsagesImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresql.fluent.VirtualNetworkSubnetUsagesClient; +import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkSubnetUsageResultInner; +import com.azure.resourcemanager.postgresql.models.VirtualNetworkSubnetUsageParameter; +import com.azure.resourcemanager.postgresql.models.VirtualNetworkSubnetUsageResult; +import com.azure.resourcemanager.postgresql.models.VirtualNetworkSubnetUsages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkSubnetUsagesImpl implements VirtualNetworkSubnetUsages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkSubnetUsagesImpl.class); + + private final VirtualNetworkSubnetUsagesClient innerClient; + + private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager; + + public VirtualNetworkSubnetUsagesImpl( + VirtualNetworkSubnetUsagesClient innerClient, + com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualNetworkSubnetUsageResult execute(String locationName, VirtualNetworkSubnetUsageParameter parameters) { + VirtualNetworkSubnetUsageResultInner inner = this.serviceClient().execute(locationName, parameters); + if (inner != null) { + return new VirtualNetworkSubnetUsageResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response executeWithResponse( + String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context) { + Response inner = + this.serviceClient().executeWithResponse(locationName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkSubnetUsageResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private VirtualNetworkSubnetUsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Backup.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Backup.java new file mode 100644 index 000000000000..5ed0b95b520a --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Backup.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Backup properties of a server. */ +@Fluent +public final class Backup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Backup.class); + + /* + * Backup retention days for the server. + */ + @JsonProperty(value = "backupRetentionDays") + private Integer backupRetentionDays; + + /* + * A value indicating whether Geo-Redundant backup is enabled on the + * server. + */ + @JsonProperty(value = "geoRedundantBackup") + private GeoRedundantBackupEnum geoRedundantBackup; + + /* + * The earliest restore point time (ISO8601 format) for server. + */ + @JsonProperty(value = "earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime earliestRestoreDate; + + /** + * Get the backupRetentionDays property: Backup retention days for the server. + * + * @return the backupRetentionDays value. + */ + public Integer backupRetentionDays() { + return this.backupRetentionDays; + } + + /** + * Set the backupRetentionDays property: Backup retention days for the server. + * + * @param backupRetentionDays the backupRetentionDays value to set. + * @return the Backup object itself. + */ + public Backup withBackupRetentionDays(Integer backupRetentionDays) { + this.backupRetentionDays = backupRetentionDays; + return this; + } + + /** + * Get the geoRedundantBackup property: A value indicating whether Geo-Redundant backup is enabled on the server. + * + * @return the geoRedundantBackup value. + */ + public GeoRedundantBackupEnum geoRedundantBackup() { + return this.geoRedundantBackup; + } + + /** + * Set the geoRedundantBackup property: A value indicating whether Geo-Redundant backup is enabled on the server. + * + * @param geoRedundantBackup the geoRedundantBackup value to set. + * @return the Backup object itself. + */ + public Backup withGeoRedundantBackup(GeoRedundantBackupEnum geoRedundantBackup) { + this.geoRedundantBackup = geoRedundantBackup; + return this; + } + + /** + * Get the earliestRestoreDate property: The earliest restore point time (ISO8601 format) for server. + * + * @return the earliestRestoreDate value. + */ + public OffsetDateTime earliestRestoreDate() { + return this.earliestRestoreDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKeyListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CapabilitiesListResult.java similarity index 76% rename from sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKeyListResult.java rename to sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CapabilitiesListResult.java index 1a55f6e01d30..04f332ea6e9e 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKeyListResult.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CapabilitiesListResult.java @@ -6,21 +6,21 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.models.ServerKeyInner; +import com.azure.resourcemanager.postgresql.fluent.models.CapabilityPropertiesInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of PostgreSQL Server keys. */ +/** location capability. */ @Immutable -public final class ServerKeyListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerKeyListResult.class); +public final class CapabilitiesListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapabilitiesListResult.class); /* - * A list of PostgreSQL Server keys. + * A list of supported capabilities. */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + private List value; /* * Link to retrieve next page of results. @@ -29,11 +29,11 @@ public final class ServerKeyListResult { private String nextLink; /** - * Get the value property: A list of PostgreSQL Server keys. + * Get the value property: A list of supported capabilities. * * @return the value value. */ - public List value() { + public List value() { return this.value; } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CapabilityProperties.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CapabilityProperties.java new file mode 100644 index 000000000000..bf195f64cb8e --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CapabilityProperties.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.resourcemanager.postgresql.fluent.models.CapabilityPropertiesInner; +import java.util.List; + +/** An immutable client-side representation of CapabilityProperties. */ +public interface CapabilityProperties { + /** + * Gets the zone property: zone name. + * + * @return the zone value. + */ + String zone(); + + /** + * Gets the supportedFlexibleServerEditions property: The supportedFlexibleServerEditions property. + * + * @return the supportedFlexibleServerEditions value. + */ + List supportedFlexibleServerEditions(); + + /** + * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.CapabilityPropertiesInner object. + * + * @return the inner object. + */ + CapabilityPropertiesInner innerModel(); +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Configuration.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Configuration.java index 6822d3502184..b196493abb53 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Configuration.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Configuration.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.postgresql.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationInner; @@ -30,6 +31,13 @@ public interface Configuration { */ String type(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the value property: Value of the configuration. * @@ -56,7 +64,7 @@ public interface Configuration { * * @return the dataType value. */ - String dataType(); + ConfigurationDataType dataType(); /** * Gets the allowedValues property: Allowed values of the configuration. @@ -97,7 +105,7 @@ interface WithParentResource { * @param serverName The name of the server. * @return the next definition stage. */ - WithCreate withExistingServer(String resourceGroupName, String serverName); + WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); } /** * The stage of the Configuration definition which contains all the minimum required properties for the resource diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ConfigurationDataType.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ConfigurationDataType.java new file mode 100644 index 000000000000..8d1ea3e736d4 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ConfigurationDataType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConfigurationDataType. */ +public final class ConfigurationDataType extends ExpandableStringEnum { + /** Static value Boolean for ConfigurationDataType. */ + public static final ConfigurationDataType BOOLEAN = fromString("Boolean"); + + /** Static value Numeric for ConfigurationDataType. */ + public static final ConfigurationDataType NUMERIC = fromString("Numeric"); + + /** Static value Integer for ConfigurationDataType. */ + public static final ConfigurationDataType INTEGER = fromString("Integer"); + + /** Static value Enumeration for ConfigurationDataType. */ + public static final ConfigurationDataType ENUMERATION = fromString("Enumeration"); + + /** + * Creates or finds a ConfigurationDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationDataType. + */ + @JsonCreator + public static ConfigurationDataType fromString(String name) { + return fromString(name, ConfigurationDataType.class); + } + + /** @return known ConfigurationDataType values. */ + public static Collection values() { + return values(ConfigurationDataType.class); + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ConfigurationListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ConfigurationListResult.java index 989f6cd336b8..d90af0e8590a 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ConfigurationListResult.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ConfigurationListResult.java @@ -4,22 +4,78 @@ package com.azure.resourcemanager.postgresql.models; -import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationListResultInner; +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** An immutable client-side representation of ConfigurationListResult. */ -public interface ConfigurationListResult { +/** A list of server configurations. */ +@Fluent +public final class ConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationListResult.class); + + /* + * The list of server configurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + /** - * Gets the value property: The list of server configurations. + * Get the value property: The list of server configurations. * * @return the value value. */ - List value(); + public List value() { + return this.value; + } + + /** + * Set the value property: The list of server configurations. + * + * @param value the value value to set. + * @return the ConfigurationListResult object itself. + */ + public ConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the ConfigurationListResult object itself. + */ + public ConfigurationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.ConfigurationListResultInner object. + * Validates the instance. * - * @return the inner object. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - ConfigurationListResultInner innerModel(); + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Configurations.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Configurations.java index e435a1bb1171..bd4e8349080e 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Configurations.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Configurations.java @@ -11,57 +11,57 @@ /** Resource collection API of Configurations. */ public interface Configurations { /** - * Gets information about a configuration of server. + * List all the configurations in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param configurationName The name of the server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a configuration of server. + * @return a list of server configurations. */ - Configuration get(String resourceGroupName, String serverName, String configurationName); + PagedIterable listByServer(String resourceGroupName, String serverName); /** - * Gets information about a configuration of server. + * List all the configurations in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. - * @param configurationName The name of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a configuration of server. + * @return a list of server configurations. */ - Response getWithResponse( - String resourceGroupName, String serverName, String configurationName, Context context); + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); /** - * List all the configurations in a given server. + * Gets information about a configuration of server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. + * @return information about a configuration of server. */ - PagedIterable listByServer(String resourceGroupName, String serverName); + Configuration get(String resourceGroupName, String serverName, String configurationName); /** - * List all the configurations in a given server. + * Gets information about a configuration of server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param configurationName The name of the server configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. + * @return information about a configuration of server. */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); + Response getWithResponse( + String resourceGroupName, String serverName, String configurationName, Context context); /** * Gets information about a configuration of server. diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CreateMode.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CreateMode.java index 261635242333..2465b503195d 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CreateMode.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CreateMode.java @@ -13,14 +13,14 @@ public final class CreateMode extends ExpandableStringEnum { /** Static value Default for CreateMode. */ public static final CreateMode DEFAULT = fromString("Default"); - /** Static value PointInTimeRestore for CreateMode. */ - public static final CreateMode POINT_IN_TIME_RESTORE = fromString("PointInTimeRestore"); + /** Static value Create for CreateMode. */ + public static final CreateMode CREATE = fromString("Create"); - /** Static value GeoRestore for CreateMode. */ - public static final CreateMode GEO_RESTORE = fromString("GeoRestore"); + /** Static value Update for CreateMode. */ + public static final CreateMode UPDATE = fromString("Update"); - /** Static value Replica for CreateMode. */ - public static final CreateMode REPLICA = fromString("Replica"); + /** Static value PointInTimeRestore for CreateMode. */ + public static final CreateMode POINT_IN_TIME_RESTORE = fromString("PointInTimeRestore"); /** * Creates or finds a CreateMode from its string representation. diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CreateModeForUpdate.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CreateModeForUpdate.java new file mode 100644 index 000000000000..17d60a97ab93 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/CreateModeForUpdate.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CreateModeForUpdate. */ +public final class CreateModeForUpdate extends ExpandableStringEnum { + /** Static value Default for CreateModeForUpdate. */ + public static final CreateModeForUpdate DEFAULT = fromString("Default"); + + /** Static value Update for CreateModeForUpdate. */ + public static final CreateModeForUpdate UPDATE = fromString("Update"); + + /** + * Creates or finds a CreateModeForUpdate from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreateModeForUpdate. + */ + @JsonCreator + public static CreateModeForUpdate fromString(String name) { + return fromString(name, CreateModeForUpdate.class); + } + + /** @return known CreateModeForUpdate values. */ + public static Collection values() { + return values(CreateModeForUpdate.class); + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Database.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Database.java index d8c79c9bcefe..ae9192734add 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Database.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Database.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.postgresql.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.postgresql.fluent.models.DatabaseInner; @@ -30,6 +31,13 @@ public interface Database { */ String type(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the charset property: The charset of the database. * @@ -69,7 +77,7 @@ interface WithParentResource { * @param serverName The name of the server. * @return the next definition stage. */ - WithCreate withExistingServer(String resourceGroupName, String serverName); + WithCreate withExistingFlexibleServer(String resourceGroupName, String serverName); } /** * The stage of the Database definition which contains all the minimum required properties for the resource to @@ -112,53 +120,6 @@ interface WithCollation { WithCreate withCollation(String collation); } } - /** - * Begins update for the Database resource. - * - * @return the stage of resource update. - */ - Database.Update update(); - - /** The template for Database update. */ - interface Update extends UpdateStages.WithCharset, UpdateStages.WithCollation { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Database apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Database apply(Context context); - } - /** The Database update stages. */ - interface UpdateStages { - /** The stage of the Database update allowing to specify charset. */ - interface WithCharset { - /** - * Specifies the charset property: The charset of the database.. - * - * @param charset The charset of the database. - * @return the next definition stage. - */ - Update withCharset(String charset); - } - /** The stage of the Database update allowing to specify collation. */ - interface WithCollation { - /** - * Specifies the collation property: The collation of the database.. - * - * @param collation The collation of the database. - * @return the next definition stage. - */ - Update withCollation(String collation); - } - } /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/DatabaseListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/DatabaseListResult.java index 2d9e9cd4721c..4dfe22b2db77 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/DatabaseListResult.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/DatabaseListResult.java @@ -22,6 +22,12 @@ public final class DatabaseListResult { @JsonProperty(value = "value") private List value; + /* + * The link used to get the next page of databases. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + /** * Get the value property: The list of databases housed in a server. * @@ -42,6 +48,26 @@ public DatabaseListResult withValue(List value) { return this; } + /** + * Get the nextLink property: The link used to get the next page of databases. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of databases. + * + * @param nextLink the nextLink value to set. + * @return the DatabaseListResult object itself. + */ + public DatabaseListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/DelegatedSubnetUsage.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/DelegatedSubnetUsage.java new file mode 100644 index 000000000000..f0e951a0bca3 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/DelegatedSubnetUsage.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Delegated subnet usage data. */ +@Immutable +public final class DelegatedSubnetUsage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetUsage.class); + + /* + * name of the subnet + */ + @JsonProperty(value = "subnetName", access = JsonProperty.Access.WRITE_ONLY) + private String subnetName; + + /* + * Number of used delegated subnets + */ + @JsonProperty(value = "usage", access = JsonProperty.Access.WRITE_ONLY) + private Long usage; + + /** + * Get the subnetName property: name of the subnet. + * + * @return the subnetName value. + */ + public String subnetName() { + return this.subnetName; + } + + /** + * Get the usage property: Number of used delegated subnets. + * + * @return the usage value. + */ + public Long usage() { + return this.usage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRule.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRule.java index ac50ce3547fb..cfe1065fb63d 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRule.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRule.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.postgresql.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.postgresql.fluent.models.FirewallRuleInner; @@ -30,6 +31,13 @@ public interface FirewallRule { */ String type(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the startIpAddress property: The start IP address of the server firewall rule. Must be IPv4 format. * @@ -73,7 +81,7 @@ interface WithParentResource { * @param serverName The name of the server. * @return the next definition stage. */ - WithStartIpAddress withExistingServer(String resourceGroupName, String serverName); + WithStartIpAddress withExistingFlexibleServer(String resourceGroupName, String serverName); } /** The stage of the FirewallRule definition allowing to specify startIpAddress. */ interface WithStartIpAddress { diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRuleListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRuleListResult.java index 3cf973213a6e..b62ac94a05c0 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRuleListResult.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRuleListResult.java @@ -22,6 +22,12 @@ public final class FirewallRuleListResult { @JsonProperty(value = "value") private List value; + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + /** * Get the value property: The list of firewall rules in a server. * @@ -42,6 +48,26 @@ public FirewallRuleListResult withValue(List value) { return this; } + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the FirewallRuleListResult object itself. + */ + public FirewallRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRules.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRules.java index 359b0fbbfae8..734ec6ede182 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRules.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/FirewallRules.java @@ -11,7 +11,7 @@ /** Resource collection API of FirewallRules. */ public interface FirewallRules { /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -23,7 +23,7 @@ public interface FirewallRules { void delete(String resourceGroupName, String serverName, String firewallRuleName); /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -36,7 +36,7 @@ public interface FirewallRules { void delete(String resourceGroupName, String serverName, String firewallRuleName, Context context); /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -44,12 +44,12 @@ public interface FirewallRules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ FirewallRule get(String resourceGroupName, String serverName, String firewallRuleName); /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -58,13 +58,13 @@ public interface FirewallRules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ Response getWithResponse( String resourceGroupName, String serverName, String firewallRuleName, Context context); /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -76,7 +76,7 @@ Response getWithResponse( PagedIterable listByServer(String resourceGroupName, String serverName); /** - * List all the firewall rules in a given server. + * List all the firewall rules in a given PostgreSQL server. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. @@ -89,30 +89,30 @@ Response getWithResponse( PagedIterable listByServer(String resourceGroupName, String serverName, Context context); /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ FirewallRule getById(String id); /** - * Gets information about a server firewall rule. + * List all the firewall rules in a given server. * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a server firewall rule. + * @return represents a server firewall rule. */ Response getByIdWithResponse(String id, Context context); /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,7 +122,7 @@ Response getWithResponse( void deleteById(String id); /** - * Deletes a server firewall rule. + * Deletes a PostgreSQL server firewall rule. * * @param id the resource ID. * @param context The context to associate with this operation. diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/GeoRedundantBackup.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/GeoRedundantBackup.java deleted file mode 100644 index 0f21c9763b17..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/GeoRedundantBackup.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** 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/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/GeoRedundantBackupEnum.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/GeoRedundantBackupEnum.java new file mode 100644 index 000000000000..3344b8047466 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/GeoRedundantBackupEnum.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GeoRedundantBackupEnum. */ +public final class GeoRedundantBackupEnum extends ExpandableStringEnum { + /** Static value Enabled for GeoRedundantBackupEnum. */ + public static final GeoRedundantBackupEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for GeoRedundantBackupEnum. */ + public static final GeoRedundantBackupEnum DISABLED = fromString("Disabled"); + + /** + * Creates or finds a GeoRedundantBackupEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding GeoRedundantBackupEnum. + */ + @JsonCreator + public static GeoRedundantBackupEnum fromString(String name) { + return fromString(name, GeoRedundantBackupEnum.class); + } + + /** @return known GeoRedundantBackupEnum values. */ + public static Collection values() { + return values(GeoRedundantBackupEnum.class); + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/RecoverableServers.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/GetPrivateDnsZoneSuffixes.java similarity index 52% rename from sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/RecoverableServers.java rename to sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/GetPrivateDnsZoneSuffixes.java index 7972ea8d6e2b..c88bd0c4ec92 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/RecoverableServers.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/GetPrivateDnsZoneSuffixes.java @@ -7,30 +7,25 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of RecoverableServers. */ -public interface RecoverableServers { +/** Resource collection API of GetPrivateDnsZoneSuffixes. */ +public interface GetPrivateDnsZoneSuffixes { /** - * Gets a recoverable PostgreSQL Server. + * Get private DNS zone suffix in the cloud. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recoverable PostgreSQL Server. + * @return private DNS zone suffix in the cloud. */ - RecoverableServerResource get(String resourceGroupName, String serverName); + String execute(); /** - * Gets a recoverable PostgreSQL Server. + * Get private DNS zone suffix in the cloud. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a recoverable PostgreSQL Server. + * @return private DNS zone suffix in the cloud. */ - Response getWithResponse(String resourceGroupName, String serverName, Context context); + Response executeWithResponse(Context context); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/HighAvailability.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/HighAvailability.java new file mode 100644 index 000000000000..e52fe4463887 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/HighAvailability.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** High availability properties of a server. */ +@Fluent +public final class HighAvailability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HighAvailability.class); + + /* + * The HA mode for the server. + */ + @JsonProperty(value = "mode") + private HighAvailabilityMode mode; + + /* + * A state of a HA server that is visible to user. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private ServerHAState state; + + /* + * availability zone information of the standby. + */ + @JsonProperty(value = "standbyAvailabilityZone", access = JsonProperty.Access.WRITE_ONLY) + private String standbyAvailabilityZone; + + /** + * Get the mode property: The HA mode for the server. + * + * @return the mode value. + */ + public HighAvailabilityMode mode() { + return this.mode; + } + + /** + * Set the mode property: The HA mode for the server. + * + * @param mode the mode value to set. + * @return the HighAvailability object itself. + */ + public HighAvailability withMode(HighAvailabilityMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the state property: A state of a HA server that is visible to user. + * + * @return the state value. + */ + public ServerHAState state() { + return this.state; + } + + /** + * Get the standbyAvailabilityZone property: availability zone information of the standby. + * + * @return the standbyAvailabilityZone value. + */ + public String standbyAvailabilityZone() { + return this.standbyAvailabilityZone; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/HighAvailabilityMode.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/HighAvailabilityMode.java new file mode 100644 index 000000000000..963ee821c123 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/HighAvailabilityMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HighAvailabilityMode. */ +public final class HighAvailabilityMode extends ExpandableStringEnum { + /** Static value Disabled for HighAvailabilityMode. */ + public static final HighAvailabilityMode DISABLED = fromString("Disabled"); + + /** Static value ZoneRedundant for HighAvailabilityMode. */ + public static final HighAvailabilityMode ZONE_REDUNDANT = fromString("ZoneRedundant"); + + /** + * Creates or finds a HighAvailabilityMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding HighAvailabilityMode. + */ + @JsonCreator + public static HighAvailabilityMode fromString(String name) { + return fromString(name, HighAvailabilityMode.class); + } + + /** @return known HighAvailabilityMode values. */ + public static Collection values() { + return values(HighAvailabilityMode.class); + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ResourceIdentity.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Identity.java similarity index 51% rename from sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ResourceIdentity.java rename to sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Identity.java index 531352fe7bc2..31ffb6702ea1 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ResourceIdentity.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Identity.java @@ -8,71 +8,66 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.UUID; -/** Azure Active Directory identity configuration for a resource. */ +/** Identity for the resource. */ @Fluent -public class ResourceIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceIdentity.class); +public class Identity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); /* - * The Azure Active Directory principal id. + * The principal ID of resource identity. */ @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private UUID principalId; + private String principalId; /* - * The identity type. Set this to 'SystemAssigned' in order to - * automatically create and assign an Azure Active Directory principal for - * the resource. + * The tenant ID of resource. */ - @JsonProperty(value = "type") - private IdentityType type; + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; /* - * The Azure Active Directory tenant id. + * The identity type. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private UUID tenantId; + @JsonProperty(value = "type") + private ResourceIdentityType type; /** - * Get the principalId property: The Azure Active Directory principal id. + * Get the principalId property: The principal ID of resource identity. * * @return the principalId value. */ - public UUID principalId() { + public String principalId() { return this.principalId; } /** - * Get the type property: The identity type. Set this to 'SystemAssigned' in order to automatically create and - * assign an Azure Active Directory principal for the resource. + * Get the tenantId property: The tenant ID of resource. * - * @return the type value. + * @return the tenantId value. */ - public IdentityType type() { - return this.type; + public String tenantId() { + return this.tenantId; } /** - * Set the type property: The identity type. Set this to 'SystemAssigned' in order to automatically create and - * assign an Azure Active Directory principal for the resource. + * Get the type property: The identity type. * - * @param type the type value to set. - * @return the ResourceIdentity object itself. + * @return the type value. */ - public ResourceIdentity withType(IdentityType type) { - this.type = type; - return this; + public ResourceIdentityType type() { + return this.type; } /** - * Get the tenantId property: The Azure Active Directory tenant id. + * Set the type property: The identity type. * - * @return the tenantId value. + * @param type the type value to set. + * @return the Identity object itself. */ - public UUID tenantId() { - return this.tenantId; + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; } /** diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/IdentityType.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/IdentityType.java deleted file mode 100644 index 01d6e4ec7d7b..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/IdentityType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for IdentityType. */ -public final class IdentityType extends ExpandableStringEnum { - /** Static value SystemAssigned for IdentityType. */ - public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - - /** - * Creates or finds a IdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding IdentityType. - */ - @JsonCreator - public static IdentityType fromString(String name) { - return fromString(name, IdentityType.class); - } - - /** @return known IdentityType values. */ - public static Collection values() { - return values(IdentityType.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/InfrastructureEncryption.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/InfrastructureEncryption.java deleted file mode 100644 index daf24145f365..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/InfrastructureEncryption.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InfrastructureEncryption. */ -public final class InfrastructureEncryption extends ExpandableStringEnum { - /** Static value Enabled for InfrastructureEncryption. */ - public static final InfrastructureEncryption ENABLED = fromString("Enabled"); - - /** Static value Disabled for InfrastructureEncryption. */ - public static final InfrastructureEncryption DISABLED = fromString("Disabled"); - - /** - * Creates or finds a InfrastructureEncryption from its string representation. - * - * @param name a name to look for. - * @return the corresponding InfrastructureEncryption. - */ - @JsonCreator - public static InfrastructureEncryption fromString(String name) { - return fromString(name, InfrastructureEncryption.class); - } - - /** @return known InfrastructureEncryption values. */ - public static Collection values() { - return values(InfrastructureEncryption.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LocationBasedPerformanceTiers.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LocationBasedCapabilities.java similarity index 66% rename from sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LocationBasedPerformanceTiers.java rename to sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LocationBasedCapabilities.java index 8a1bd181effc..4a1647ef8eca 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LocationBasedPerformanceTiers.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LocationBasedCapabilities.java @@ -7,28 +7,28 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of LocationBasedPerformanceTiers. */ -public interface LocationBasedPerformanceTiers { +/** Resource collection API of LocationBasedCapabilities. */ +public interface LocationBasedCapabilities { /** - * List all the performance tiers at specified location in a given subscription. + * Get capabilities at specified location in a given subscription. * * @param locationName The name of the location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. + * @return capabilities at specified location in a given subscription. */ - PagedIterable list(String locationName); + PagedIterable execute(String locationName); /** - * List all the performance tiers at specified location in a given subscription. + * Get capabilities at specified location in a given subscription. * * @param locationName The name of the location. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. + * @return capabilities at specified location in a given subscription. */ - PagedIterable list(String locationName, Context context); + PagedIterable execute(String locationName, Context context); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LogFile.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LogFile.java deleted file mode 100644 index c10c01046c5f..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LogFile.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.resourcemanager.postgresql.fluent.models.LogFileInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of LogFile. */ -public interface LogFile { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the sizeInKB property: Size of the log file. - * - * @return the sizeInKB value. - */ - Long sizeInKB(); - - /** - * Gets the createdTime property: Creation timestamp of the log file. - * - * @return the createdTime value. - */ - OffsetDateTime createdTime(); - - /** - * Gets the lastModifiedTime property: Last modified timestamp of the log file. - * - * @return the lastModifiedTime value. - */ - OffsetDateTime lastModifiedTime(); - - /** - * Gets the typePropertiesType property: Type of the log file. - * - * @return the typePropertiesType value. - */ - String typePropertiesType(); - - /** - * Gets the url property: The url to download the log file from. - * - * @return the url value. - */ - String url(); - - /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.LogFileInner object. - * - * @return the inner object. - */ - LogFileInner innerModel(); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LogFileListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LogFileListResult.java deleted file mode 100644 index 08801e8ef09c..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LogFileListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.models.LogFileInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of log files. */ -@Fluent -public final class LogFileListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogFileListResult.class); - - /* - * The list of log files. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of log files. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of log files. - * - * @param value the value value to set. - * @return the LogFileListResult object itself. - */ - public LogFileListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LogFiles.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LogFiles.java deleted file mode 100644 index 256ab02e3971..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/LogFiles.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of LogFiles. */ -public interface LogFiles { - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the log files in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of log files. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/MaintenanceWindow.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/MaintenanceWindow.java new file mode 100644 index 000000000000..0f6e5e2907b5 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/MaintenanceWindow.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Maintenance window properties of a server. */ +@Fluent +public final class MaintenanceWindow { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MaintenanceWindow.class); + + /* + * indicates whether custom window is enabled or disabled + */ + @JsonProperty(value = "customWindow") + private String customWindow; + + /* + * start hour for maintenance window + */ + @JsonProperty(value = "startHour") + private Integer startHour; + + /* + * start minute for maintenance window + */ + @JsonProperty(value = "startMinute") + private Integer startMinute; + + /* + * day of week for maintenance window + */ + @JsonProperty(value = "dayOfWeek") + private Integer dayOfWeek; + + /** + * Get the customWindow property: indicates whether custom window is enabled or disabled. + * + * @return the customWindow value. + */ + public String customWindow() { + return this.customWindow; + } + + /** + * Set the customWindow property: indicates whether custom window is enabled or disabled. + * + * @param customWindow the customWindow value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withCustomWindow(String customWindow) { + this.customWindow = customWindow; + return this; + } + + /** + * Get the startHour property: start hour for maintenance window. + * + * @return the startHour value. + */ + public Integer startHour() { + return this.startHour; + } + + /** + * Set the startHour property: start hour for maintenance window. + * + * @param startHour the startHour value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withStartHour(Integer startHour) { + this.startHour = startHour; + return this; + } + + /** + * Get the startMinute property: start minute for maintenance window. + * + * @return the startMinute value. + */ + public Integer startMinute() { + return this.startMinute; + } + + /** + * Set the startMinute property: start minute for maintenance window. + * + * @param startMinute the startMinute value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withStartMinute(Integer startMinute) { + this.startMinute = startMinute; + return this; + } + + /** + * Get the dayOfWeek property: day of week for maintenance window. + * + * @return the dayOfWeek value. + */ + public Integer dayOfWeek() { + return this.dayOfWeek; + } + + /** + * Set the dayOfWeek property: day of week for maintenance window. + * + * @param dayOfWeek the dayOfWeek value to set. + * @return the MaintenanceWindow object itself. + */ + public MaintenanceWindow withDayOfWeek(Integer dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/MinimalTlsVersionEnum.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/MinimalTlsVersionEnum.java deleted file mode 100644 index e7f4484e3a19..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/MinimalTlsVersionEnum.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MinimalTlsVersionEnum. */ -public final class MinimalTlsVersionEnum extends ExpandableStringEnum { - /** Static value TLS1_0 for MinimalTlsVersionEnum. */ - public static final MinimalTlsVersionEnum TLS1_0 = fromString("TLS1_0"); - - /** Static value TLS1_1 for MinimalTlsVersionEnum. */ - public static final MinimalTlsVersionEnum TLS1_1 = fromString("TLS1_1"); - - /** Static value TLS1_2 for MinimalTlsVersionEnum. */ - public static final MinimalTlsVersionEnum TLS1_2 = fromString("TLS1_2"); - - /** Static value TLSEnforcementDisabled for MinimalTlsVersionEnum. */ - public static final MinimalTlsVersionEnum TLSENFORCEMENT_DISABLED = fromString("TLSEnforcementDisabled"); - - /** - * Creates or finds a MinimalTlsVersionEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding MinimalTlsVersionEnum. - */ - @JsonCreator - public static MinimalTlsVersionEnum fromString(String name) { - return fromString(name, MinimalTlsVersionEnum.class); - } - - /** @return known MinimalTlsVersionEnum values. */ - public static Collection values() { - return values(MinimalTlsVersionEnum.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/NameAvailability.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/NameAvailability.java index b70b7b718ecf..c163e3798ff0 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/NameAvailability.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/NameAvailability.java @@ -23,11 +23,18 @@ public interface NameAvailability { Boolean nameAvailable(); /** - * Gets the reason property: Reason for name being unavailable. + * Gets the name property: name of the PostgreSQL server. * - * @return the reason value. + * @return the name value. */ - String reason(); + String name(); + + /** + * Gets the type property: type of the server. + * + * @return the type value. + */ + String type(); /** * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.NameAvailabilityInner object. diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Network.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Network.java new file mode 100644 index 000000000000..7465f5b2ea29 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Network.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network properties of a server. */ +@Fluent +public final class Network { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Network.class); + + /* + * public network access is enabled or not + */ + @JsonProperty(value = "publicNetworkAccess", access = JsonProperty.Access.WRITE_ONLY) + private ServerPublicNetworkAccessState publicNetworkAccess; + + /* + * delegated subnet arm resource id. + */ + @JsonProperty(value = "delegatedSubnetResourceId") + private String delegatedSubnetResourceId; + + /* + * private dns zone arm resource id. + */ + @JsonProperty(value = "privateDnsZoneArmResourceId") + private String privateDnsZoneArmResourceId; + + /** + * Get the publicNetworkAccess property: public network access is enabled or not. + * + * @return the publicNetworkAccess value. + */ + public ServerPublicNetworkAccessState publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Get the delegatedSubnetResourceId property: delegated subnet arm resource id. + * + * @return the delegatedSubnetResourceId value. + */ + public String delegatedSubnetResourceId() { + return this.delegatedSubnetResourceId; + } + + /** + * Set the delegatedSubnetResourceId property: delegated subnet arm resource id. + * + * @param delegatedSubnetResourceId the delegatedSubnetResourceId value to set. + * @return the Network object itself. + */ + public Network withDelegatedSubnetResourceId(String delegatedSubnetResourceId) { + this.delegatedSubnetResourceId = delegatedSubnetResourceId; + return this; + } + + /** + * Get the privateDnsZoneArmResourceId property: private dns zone arm resource id. + * + * @return the privateDnsZoneArmResourceId value. + */ + public String privateDnsZoneArmResourceId() { + return this.privateDnsZoneArmResourceId; + } + + /** + * Set the privateDnsZoneArmResourceId property: private dns zone arm resource id. + * + * @param privateDnsZoneArmResourceId the privateDnsZoneArmResourceId value to set. + * @return the Network object itself. + */ + public Network withPrivateDnsZoneArmResourceId(String privateDnsZoneArmResourceId) { + this.privateDnsZoneArmResourceId = privateDnsZoneArmResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Operation.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Operation.java index acec2f678652..352b0209e2a7 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Operation.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Operation.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.postgresql.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** REST API operation definition. */ -@Immutable +@Fluent public final class Operation { @JsonIgnore private final ClientLogger logger = new ClientLogger(Operation.class); @@ -28,6 +28,12 @@ public final class Operation { @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) private OperationDisplay display; + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + /* * The intended executor of the operation. */ @@ -58,6 +64,26 @@ public OperationDisplay display() { return this.display; } + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the Operation object itself. + */ + public Operation withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + /** * Get the origin property: The intended executor of the operation. * diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/OperationListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/OperationListResult.java index 8e4b7593340d..1571783fe17f 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/OperationListResult.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/OperationListResult.java @@ -10,12 +10,20 @@ /** An immutable client-side representation of OperationListResult. */ public interface OperationListResult { /** - * Gets the value property: The list of resource provider operations. + * Gets the value property: Collection of available operation details. * * @return the value value. */ List value(); + /** + * Gets the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + String nextLink(); + /** * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.OperationListResultInner object. * diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PerformanceTierListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PerformanceTierListResult.java deleted file mode 100644 index 6f2360080fb5..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PerformanceTierListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of performance tiers. */ -@Fluent -public final class PerformanceTierListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PerformanceTierListResult.class); - - /* - * The list of performance tiers - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of performance tiers. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of performance tiers. - * - * @param value the value value to set. - * @return the PerformanceTierListResult object itself. - */ - public PerformanceTierListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PerformanceTierProperties.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PerformanceTierProperties.java deleted file mode 100644 index 41567fc10c32..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PerformanceTierProperties.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner; -import java.util.List; - -/** An immutable client-side representation of PerformanceTierProperties. */ -public interface PerformanceTierProperties { - /** - * Gets the id property: ID of the performance tier. - * - * @return the id value. - */ - String id(); - - /** - * Gets the maxBackupRetentionDays property: Maximum Backup retention in days for the performance tier edition. - * - * @return the maxBackupRetentionDays value. - */ - Integer maxBackupRetentionDays(); - - /** - * Gets the minBackupRetentionDays property: Minimum Backup retention in days for the performance tier edition. - * - * @return the minBackupRetentionDays value. - */ - Integer minBackupRetentionDays(); - - /** - * Gets the maxStorageMB property: Max storage allowed for a server. - * - * @return the maxStorageMB value. - */ - Integer maxStorageMB(); - - /** - * Gets the minLargeStorageMB property: Max storage allowed for a server. - * - * @return the minLargeStorageMB value. - */ - Integer minLargeStorageMB(); - - /** - * Gets the maxLargeStorageMB property: Max storage allowed for a server. - * - * @return the maxLargeStorageMB value. - */ - Integer maxLargeStorageMB(); - - /** - * Gets the minStorageMB property: Max storage allowed for a server. - * - * @return the minStorageMB value. - */ - Integer minStorageMB(); - - /** - * Gets the serviceLevelObjectives property: Service level objectives associated with the performance tier. - * - * @return the serviceLevelObjectives value. - */ - List serviceLevelObjectives(); - - /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner object. - * - * @return the inner object. - */ - PerformanceTierPropertiesInner innerModel(); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PerformanceTierServiceLevelObjectives.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PerformanceTierServiceLevelObjectives.java deleted file mode 100644 index 8911f6f7b085..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PerformanceTierServiceLevelObjectives.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Service level objectives for performance tier. */ -@Fluent -public final class PerformanceTierServiceLevelObjectives { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PerformanceTierServiceLevelObjectives.class); - - /* - * 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 the id property: ID for the service level objective. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: 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 the edition property: Edition of the performance tier. - * - * @return the edition value. - */ - public String edition() { - return this.edition; - } - - /** - * Set the edition property: 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 the vCore property: vCore associated with the service level objective. - * - * @return the vCore value. - */ - public Integer vCore() { - return this.vCore; - } - - /** - * Set the vCore property: 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 the hardwareGeneration property: Hardware generation associated with the service level objective. - * - * @return the hardwareGeneration value. - */ - public String hardwareGeneration() { - return this.hardwareGeneration; - } - - /** - * Set the hardwareGeneration property: 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 the maxBackupRetentionDays property: Maximum Backup retention in days for the performance tier edition. - * - * @return the maxBackupRetentionDays value. - */ - public Integer maxBackupRetentionDays() { - return this.maxBackupRetentionDays; - } - - /** - * Set the maxBackupRetentionDays property: 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 the minBackupRetentionDays property: Minimum Backup retention in days for the performance tier edition. - * - * @return the minBackupRetentionDays value. - */ - public Integer minBackupRetentionDays() { - return this.minBackupRetentionDays; - } - - /** - * Set the minBackupRetentionDays property: 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 the maxStorageMB property: Max storage allowed for a server. - * - * @return the maxStorageMB value. - */ - public Integer maxStorageMB() { - return this.maxStorageMB; - } - - /** - * Set the maxStorageMB property: 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 the minStorageMB property: Max storage allowed for a server. - * - * @return the minStorageMB value. - */ - public Integer minStorageMB() { - return this.minStorageMB; - } - - /** - * Set the minStorageMB property: 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointConnection.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointConnection.java deleted file mode 100644 index cb6ee05453d0..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointConnection.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateEndpointConnectionInner; -import java.util.Map; - -/** An immutable client-side representation of PrivateEndpointConnection. */ -public interface PrivateEndpointConnection { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the privateEndpoint property: Private endpoint which the connection belongs to. - * - * @return the privateEndpoint value. - */ - PrivateEndpointProperty privateEndpoint(); - - /** - * Gets the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. - * - * @return the privateLinkServiceConnectionState value. - */ - PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState(); - - /** - * Gets the provisioningState property: State of the private endpoint connection. - * - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.PrivateEndpointConnectionInner object. - * - * @return the inner object. - */ - PrivateEndpointConnectionInner innerModel(); - - /** The entirety of the PrivateEndpointConnection definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The PrivateEndpointConnection definition stages. */ - interface DefinitionStages { - /** The first stage of the PrivateEndpointConnection definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, serverName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @return the next definition stage. - */ - WithCreate withExistingServer(String resourceGroupName, String serverName); - } - /** - * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { - /** - * Executes the create request. - * - * @return the created resource. - */ - PrivateEndpointConnection create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - PrivateEndpointConnection create(Context context); - } - /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ - interface WithPrivateEndpoint { - /** - * Specifies the privateEndpoint property: Private endpoint which the connection belongs to.. - * - * @param privateEndpoint Private endpoint which the connection belongs to. - * @return the next definition stage. - */ - WithCreate withPrivateEndpoint(PrivateEndpointProperty privateEndpoint); - } - /** - * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. - */ - interface WithPrivateLinkServiceConnectionState { - /** - * Specifies the privateLinkServiceConnectionState property: Connection state of the private endpoint - * connection.. - * - * @param privateLinkServiceConnectionState Connection state of the private endpoint connection. - * @return the next definition stage. - */ - WithCreate withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState); - } - } - /** - * Begins update for the PrivateEndpointConnection resource. - * - * @return the stage of resource update. - */ - PrivateEndpointConnection.Update update(); - - /** The template for PrivateEndpointConnection update. */ - interface Update extends UpdateStages.WithTags { - /** - * Executes the update request. - * - * @return the updated resource. - */ - PrivateEndpointConnection apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - PrivateEndpointConnection apply(Context context); - } - /** The PrivateEndpointConnection update stages. */ - interface UpdateStages { - /** The stage of the PrivateEndpointConnection update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - PrivateEndpointConnection refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - PrivateEndpointConnection refresh(Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointConnectionListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointConnectionListResult.java deleted file mode 100644 index dafabfdfad75..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointConnectionListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of private endpoint connections. */ -@Immutable -public final class PrivateEndpointConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); - - /* - * Array of results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to retrieve next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Array of results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointConnections.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointConnections.java deleted file mode 100644 index 9bf3814c365f..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointConnections.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of PrivateEndpointConnections. */ -public interface PrivateEndpointConnections { - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - PrivateEndpointConnection get(String resourceGroupName, String serverName, String privateEndpointConnectionName); - - /** - * Gets a private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - Response getWithResponse( - String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * Gets all private endpoint connections on a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all private endpoint connections on a server. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); - - /** - * Gets a private endpoint connection. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - PrivateEndpointConnection getById(String id); - - /** - * Gets a private endpoint connection. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes a private endpoint connection with a given name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new PrivateEndpointConnection resource. - * - * @param name resource name. - * @return the first stage of the new PrivateEndpointConnection definition. - */ - PrivateEndpointConnection.DefinitionStages.Blank define(String name); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointProvisioningState.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointProvisioningState.java deleted file mode 100644 index fbbdd761d287..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointProvisioningState.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PrivateEndpointProvisioningState. */ -public final class PrivateEndpointProvisioningState extends ExpandableStringEnum { - /** Static value Approving for PrivateEndpointProvisioningState. */ - public static final PrivateEndpointProvisioningState APPROVING = fromString("Approving"); - - /** Static value Ready for PrivateEndpointProvisioningState. */ - public static final PrivateEndpointProvisioningState READY = fromString("Ready"); - - /** Static value Dropping for PrivateEndpointProvisioningState. */ - public static final PrivateEndpointProvisioningState DROPPING = fromString("Dropping"); - - /** Static value Failed for PrivateEndpointProvisioningState. */ - public static final PrivateEndpointProvisioningState FAILED = fromString("Failed"); - - /** Static value Rejecting for PrivateEndpointProvisioningState. */ - public static final PrivateEndpointProvisioningState REJECTING = fromString("Rejecting"); - - /** - * Creates or finds a PrivateEndpointProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointProvisioningState. - */ - @JsonCreator - public static PrivateEndpointProvisioningState fromString(String name) { - return fromString(name, PrivateEndpointProvisioningState.class); - } - - /** @return known PrivateEndpointProvisioningState values. */ - public static Collection values() { - return values(PrivateEndpointProvisioningState.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResource.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResource.java deleted file mode 100644 index 8763a03e54fc..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResource.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.resourcemanager.postgresql.fluent.models.PrivateLinkResourceInner; - -/** An immutable client-side representation of PrivateLinkResource. */ -public interface PrivateLinkResource { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: The private link resource group id. - * - * @return the properties value. - */ - PrivateLinkResourceProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.PrivateLinkResourceInner object. - * - * @return the inner object. - */ - PrivateLinkResourceInner innerModel(); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResourceListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResourceListResult.java deleted file mode 100644 index 0a87eb00724f..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResourceListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.models.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of private link resources. */ -@Immutable -public final class PrivateLinkResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResult.class); - - /* - * Array of results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to retrieve next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Array of results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResourceProperties.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResourceProperties.java deleted file mode 100644 index 5a3a4abe8542..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResourceProperties.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of a private link resource. */ -@Immutable -public final class PrivateLinkResourceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); - - /* - * The private link resource group id. - */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) - private String groupId; - - /* - * The private link resource required member names. - */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) - private List requiredMembers; - - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResources.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResources.java deleted file mode 100644 index d0c2cb06b119..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkResources.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of PrivateLinkResources. */ -public interface PrivateLinkResources { - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * Gets the private link resources for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources for PostgreSQL server. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); - - /** - * Gets a private link resource for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param groupName The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource for PostgreSQL server. - */ - PrivateLinkResource get(String resourceGroupName, String serverName, String groupName); - - /** - * Gets a private link resource for PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private link resource for PostgreSQL server. - */ - Response getWithResponse( - String resourceGroupName, String serverName, String groupName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkServiceConnectionStateActionsRequire.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkServiceConnectionStateActionsRequire.java deleted file mode 100644 index 925cbe3e5876..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkServiceConnectionStateActionsRequire.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PrivateLinkServiceConnectionStateActionsRequire. */ -public final class PrivateLinkServiceConnectionStateActionsRequire - extends ExpandableStringEnum { - /** Static value None for PrivateLinkServiceConnectionStateActionsRequire. */ - public static final PrivateLinkServiceConnectionStateActionsRequire NONE = fromString("None"); - - /** - * Creates or finds a PrivateLinkServiceConnectionStateActionsRequire from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateLinkServiceConnectionStateActionsRequire. - */ - @JsonCreator - public static PrivateLinkServiceConnectionStateActionsRequire fromString(String name) { - return fromString(name, PrivateLinkServiceConnectionStateActionsRequire.class); - } - - /** @return known PrivateLinkServiceConnectionStateActionsRequire values. */ - public static Collection values() { - return values(PrivateLinkServiceConnectionStateActionsRequire.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkServiceConnectionStateProperty.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkServiceConnectionStateProperty.java deleted file mode 100644 index 3bf437baa25f..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkServiceConnectionStateProperty.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The PrivateLinkServiceConnectionStateProperty model. */ -@Fluent -public final class PrivateLinkServiceConnectionStateProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionStateProperty.class); - - /* - * The private link service connection status. - */ - @JsonProperty(value = "status", required = true) - private String status; - - /* - * The private link service connection description. - */ - @JsonProperty(value = "description", required = true) - private String description; - - /* - * The actions required for private link service connection. - */ - @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) - private String actionsRequired; - - /** - * Get the status property: The private link service connection status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: The private link service connection status. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionStateProperty object itself. - */ - public PrivateLinkServiceConnectionStateProperty withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the description property: The private link service connection description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The private link service connection description. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionStateProperty object itself. - */ - public PrivateLinkServiceConnectionStateProperty withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionsRequired property: The actions required for private link service connection. - * - * @return the actionsRequired value. - */ - public String actionsRequired() { - return this.actionsRequired; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property status in model PrivateLinkServiceConnectionStateProperty")); - } - if (description() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property description in model PrivateLinkServiceConnectionStateProperty")); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkServiceConnectionStateStatus.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkServiceConnectionStateStatus.java deleted file mode 100644 index da23b7856e54..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateLinkServiceConnectionStateStatus.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PrivateLinkServiceConnectionStateStatus. */ -public final class PrivateLinkServiceConnectionStateStatus - extends ExpandableStringEnum { - /** Static value Approved for PrivateLinkServiceConnectionStateStatus. */ - public static final PrivateLinkServiceConnectionStateStatus APPROVED = fromString("Approved"); - - /** Static value Pending for PrivateLinkServiceConnectionStateStatus. */ - public static final PrivateLinkServiceConnectionStateStatus PENDING = fromString("Pending"); - - /** Static value Rejected for PrivateLinkServiceConnectionStateStatus. */ - public static final PrivateLinkServiceConnectionStateStatus REJECTED = fromString("Rejected"); - - /** Static value Disconnected for PrivateLinkServiceConnectionStateStatus. */ - public static final PrivateLinkServiceConnectionStateStatus DISCONNECTED = fromString("Disconnected"); - - /** - * Creates or finds a PrivateLinkServiceConnectionStateStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateLinkServiceConnectionStateStatus. - */ - @JsonCreator - public static PrivateLinkServiceConnectionStateStatus fromString(String name) { - return fromString(name, PrivateLinkServiceConnectionStateStatus.class); - } - - /** @return known PrivateLinkServiceConnectionStateStatus values. */ - public static Collection values() { - return values(PrivateLinkServiceConnectionStateStatus.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PublicNetworkAccessEnum.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PublicNetworkAccessEnum.java deleted file mode 100644 index 5ae0b86e6d65..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PublicNetworkAccessEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PublicNetworkAccessEnum. */ -public final class PublicNetworkAccessEnum extends ExpandableStringEnum { - /** Static value Enabled for PublicNetworkAccessEnum. */ - public static final PublicNetworkAccessEnum ENABLED = fromString("Enabled"); - - /** Static value Disabled for PublicNetworkAccessEnum. */ - public static final PublicNetworkAccessEnum DISABLED = fromString("Disabled"); - - /** - * Creates or finds a PublicNetworkAccessEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding PublicNetworkAccessEnum. - */ - @JsonCreator - public static PublicNetworkAccessEnum fromString(String name) { - return fromString(name, PublicNetworkAccessEnum.class); - } - - /** @return known PublicNetworkAccessEnum values. */ - public static Collection values() { - return values(PublicNetworkAccessEnum.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/RecoverableServerResource.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/RecoverableServerResource.java deleted file mode 100644 index acc1da0fbabb..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/RecoverableServerResource.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.resourcemanager.postgresql.fluent.models.RecoverableServerResourceInner; - -/** An immutable client-side representation of RecoverableServerResource. */ -public interface RecoverableServerResource { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the lastAvailableBackupDateTime property: The last available backup date time. - * - * @return the lastAvailableBackupDateTime value. - */ - String lastAvailableBackupDateTime(); - - /** - * Gets the serviceLevelObjective property: The service level objective. - * - * @return the serviceLevelObjective value. - */ - String serviceLevelObjective(); - - /** - * Gets the edition property: Edition of the performance tier. - * - * @return the edition value. - */ - String edition(); - - /** - * Gets the vCore property: vCore associated with the service level objective. - * - * @return the vCore value. - */ - Integer vCore(); - - /** - * Gets the hardwareGeneration property: Hardware generation associated with the service level objective. - * - * @return the hardwareGeneration value. - */ - String hardwareGeneration(); - - /** - * Gets the version property: The PostgreSQL version. - * - * @return the version value. - */ - String version(); - - /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.RecoverableServerResourceInner object. - * - * @return the inner object. - */ - RecoverableServerResourceInner innerModel(); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Replicas.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Replicas.java deleted file mode 100644 index 28cfdd480747..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Replicas.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Replicas. */ -public interface Replicas { - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * List all the replicas for a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of servers. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/AdministratorType.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ResourceIdentityType.java similarity index 53% rename from sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/AdministratorType.java rename to sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ResourceIdentityType.java index 90705162efb9..781fbd1a279e 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/AdministratorType.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ResourceIdentityType.java @@ -7,28 +7,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for AdministratorType. */ -public enum AdministratorType { - /** Enum value ActiveDirectory. */ - ACTIVE_DIRECTORY("ActiveDirectory"); +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); - /** The actual serialized value for a AdministratorType instance. */ + /** The actual serialized value for a ResourceIdentityType instance. */ private final String value; - AdministratorType(String value) { + ResourceIdentityType(String value) { this.value = value; } /** - * Parses a serialized value to a AdministratorType instance. + * Parses a serialized value to a ResourceIdentityType instance. * * @param value the serialized value to parse. - * @return the parsed AdministratorType object, or null if unable to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. */ @JsonCreator - public static AdministratorType fromString(String value) { - AdministratorType[] items = AdministratorType.values(); - for (AdministratorType item : items) { + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/RestartParameter.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/RestartParameter.java new file mode 100644 index 000000000000..a478db60f731 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/RestartParameter.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents server restart parameters. */ +@Fluent +public final class RestartParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestartParameter.class); + + /* + * Indicates whether to restart the server with failover. + */ + @JsonProperty(value = "restartWithFailover") + private Boolean restartWithFailover; + + /* + * Failover mode. + */ + @JsonProperty(value = "failoverMode") + private String failoverMode; + + /** + * Get the restartWithFailover property: Indicates whether to restart the server with failover. + * + * @return the restartWithFailover value. + */ + public Boolean restartWithFailover() { + return this.restartWithFailover; + } + + /** + * Set the restartWithFailover property: Indicates whether to restart the server with failover. + * + * @param restartWithFailover the restartWithFailover value to set. + * @return the RestartParameter object itself. + */ + public RestartParameter withRestartWithFailover(Boolean restartWithFailover) { + this.restartWithFailover = restartWithFailover; + return this; + } + + /** + * Get the failoverMode property: Failover mode. + * + * @return the failoverMode value. + */ + public String failoverMode() { + return this.failoverMode; + } + + /** + * Set the failoverMode property: Failover mode. + * + * @param failoverMode the failoverMode value to set. + * @return the RestartParameter object itself. + */ + public RestartParameter withFailoverMode(String failoverMode) { + this.failoverMode = failoverMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SecurityAlertPolicyName.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SecurityAlertPolicyName.java deleted file mode 100644 index b240c0d36f86..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SecurityAlertPolicyName.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SecurityAlertPolicyName. */ -public final class SecurityAlertPolicyName extends ExpandableStringEnum { - /** Static value Default for SecurityAlertPolicyName. */ - public static final SecurityAlertPolicyName DEFAULT = fromString("Default"); - - /** - * Creates or finds a SecurityAlertPolicyName from its string representation. - * - * @param name a name to look for. - * @return the corresponding SecurityAlertPolicyName. - */ - @JsonCreator - public static SecurityAlertPolicyName fromString(String name) { - return fromString(name, SecurityAlertPolicyName.class); - } - - /** @return known SecurityAlertPolicyName values. */ - public static Collection values() { - return values(SecurityAlertPolicyName.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Server.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Server.java index dedd4dc09e2b..014968c9d324 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Server.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Server.java @@ -5,10 +5,10 @@ package com.azure.resourcemanager.postgresql.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.postgresql.fluent.models.ServerInner; import java.time.OffsetDateTime; -import java.util.List; import java.util.Map; /** An immutable client-side representation of Server. */ @@ -53,7 +53,7 @@ public interface Server { * * @return the identity value. */ - ResourceIdentity identity(); + Identity identity(); /** * Gets the sku property: The SKU (pricing tier) of the server. @@ -62,6 +62,13 @@ public interface Server { */ Sku sku(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the administratorLogin property: The administrator's login name of a server. Can only be specified when the * server is being created (and is required for creation). @@ -71,104 +78,111 @@ public interface Server { String administratorLogin(); /** - * Gets the version property: Server version. + * Gets the administratorLoginPassword property: The administrator login password (required for server creation). + * + * @return the administratorLoginPassword value. + */ + String administratorLoginPassword(); + + /** + * Gets the version property: PostgreSQL Server version. * * @return the version value. */ ServerVersion version(); /** - * Gets the sslEnforcement property: Enable ssl enforcement or not when connect to server. + * Gets the minorVersion property: The minor version of the server. * - * @return the sslEnforcement value. + * @return the minorVersion value. */ - SslEnforcementEnum sslEnforcement(); + String minorVersion(); /** - * Gets the minimalTlsVersion property: Enforce a minimal Tls version for the server. + * Gets the state property: A state of a server that is visible to user. * - * @return the minimalTlsVersion value. + * @return the state value. */ - MinimalTlsVersionEnum minimalTlsVersion(); + ServerState state(); /** - * Gets the byokEnforcement property: Status showing whether the server data encryption is enabled with - * customer-managed keys. + * Gets the fullyQualifiedDomainName property: The fully qualified domain name of a server. * - * @return the byokEnforcement value. + * @return the fullyQualifiedDomainName value. */ - String byokEnforcement(); + String fullyQualifiedDomainName(); /** - * Gets the infrastructureEncryption property: Status showing whether the server enabled infrastructure encryption. + * Gets the storage property: Storage properties of a server. * - * @return the infrastructureEncryption value. + * @return the storage value. */ - InfrastructureEncryption infrastructureEncryption(); + Storage storage(); /** - * Gets the userVisibleState property: A state of a server that is visible to user. + * Gets the backup property: Backup properties of a server. * - * @return the userVisibleState value. + * @return the backup value. */ - ServerState userVisibleState(); + Backup backup(); /** - * Gets the fullyQualifiedDomainName property: The fully qualified domain name of a server. + * Gets the network property: Network properties of a server. * - * @return the fullyQualifiedDomainName value. + * @return the network value. */ - String fullyQualifiedDomainName(); + Network network(); /** - * Gets the earliestRestoreDate property: Earliest restore point creation time (ISO8601 format). + * Gets the highAvailability property: High availability properties of a server. * - * @return the earliestRestoreDate value. + * @return the highAvailability value. */ - OffsetDateTime earliestRestoreDate(); + HighAvailability highAvailability(); /** - * Gets the storageProfile property: Storage profile of a server. + * Gets the maintenanceWindow property: Maintenance window properties of a server. * - * @return the storageProfile value. + * @return the maintenanceWindow value. */ - StorageProfile storageProfile(); + MaintenanceWindow maintenanceWindow(); /** - * Gets the replicationRole property: The replication role of the server. + * Gets the sourceServerResourceId property: The source server resource ID to restore from. It's required when + * 'createMode' is 'PointInTimeRestore'. * - * @return the replicationRole value. + * @return the sourceServerResourceId value. */ - String replicationRole(); + String sourceServerResourceId(); /** - * Gets the masterServerId property: The master server id of a replica server. + * Gets the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore + * from. It's required when 'createMode' is 'PointInTimeRestore'. * - * @return the masterServerId value. + * @return the pointInTimeUtc value. */ - String masterServerId(); + OffsetDateTime pointInTimeUtc(); /** - * Gets the replicaCapacity property: The maximum number of replicas that a master server can have. + * Gets the availabilityZone property: availability zone information of the server. * - * @return the replicaCapacity value. + * @return the availabilityZone value. */ - Integer replicaCapacity(); + String availabilityZone(); /** - * Gets the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * optional but if passed in, must be 'Enabled' or 'Disabled'. + * Gets the createMode property: The mode to create a new PostgreSQL server. * - * @return the publicNetworkAccess value. + * @return the createMode value. */ - PublicNetworkAccessEnum publicNetworkAccess(); + CreateMode createMode(); /** - * Gets the privateEndpointConnections property: List of private endpoint connections on a server. + * Gets the tagsPropertiesTags property: Application-specific metadata in the form of key-value pairs. * - * @return the privateEndpointConnections value. + * @return the tagsPropertiesTags value. */ - List privateEndpointConnections(); + Map tagsPropertiesTags(); /** * Gets the region of the resource. @@ -196,7 +210,6 @@ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** The Server definition stages. */ @@ -209,7 +222,7 @@ interface WithLocation { /** * Specifies the region for the resource. * - * @param location The location the resource resides in. + * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(Region location); @@ -217,7 +230,7 @@ interface WithLocation { /** * Specifies the region for the resource. * - * @param location The location the resource resides in. + * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); @@ -230,24 +243,28 @@ interface WithResourceGroup { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithProperties withExistingResourceGroup(String resourceGroupName); - } - /** The stage of the Server definition allowing to specify properties. */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the server.. - * - * @param properties Properties of the server. - * @return the next definition stage. - */ - WithCreate withProperties(ServerPropertiesForCreate properties); + WithCreate withExistingResourceGroup(String resourceGroupName); } /** * The stage of the Server definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithSku { + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithSku, + DefinitionStages.WithAdministratorLogin, + DefinitionStages.WithAdministratorLoginPassword, + DefinitionStages.WithVersion, + DefinitionStages.WithStorage, + DefinitionStages.WithBackup, + DefinitionStages.WithNetwork, + DefinitionStages.WithHighAvailability, + DefinitionStages.WithSourceServerResourceId, + DefinitionStages.WithPointInTimeUtc, + DefinitionStages.WithAvailabilityZone, + DefinitionStages.WithCreateMode, + DefinitionStages.WithTagsPropertiesTags { /** * Executes the create request. * @@ -266,9 +283,9 @@ interface WithCreate /** The stage of the Server definition allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Application-specific metadata in the form of key-value pairs.. + * Specifies the tags property: Resource tags.. * - * @param tags Application-specific metadata in the form of key-value pairs. + * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); @@ -281,7 +298,7 @@ interface WithIdentity { * @param identity The Azure Active Directory identity of the server. * @return the next definition stage. */ - WithCreate withIdentity(ResourceIdentity identity); + WithCreate withIdentity(Identity identity); } /** The stage of the Server definition allowing to specify sku. */ interface WithSku { @@ -293,6 +310,133 @@ interface WithSku { */ WithCreate withSku(Sku sku); } + /** The stage of the Server definition allowing to specify administratorLogin. */ + interface WithAdministratorLogin { + /** + * Specifies the administratorLogin property: 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 administrator's login name of a server. Can only be specified when the + * server is being created (and is required for creation). + * @return the next definition stage. + */ + WithCreate withAdministratorLogin(String administratorLogin); + } + /** The stage of the Server definition allowing to specify administratorLoginPassword. */ + interface WithAdministratorLoginPassword { + /** + * Specifies the administratorLoginPassword property: The administrator login password (required for server + * creation).. + * + * @param administratorLoginPassword The administrator login password (required for server creation). + * @return the next definition stage. + */ + WithCreate withAdministratorLoginPassword(String administratorLoginPassword); + } + /** The stage of the Server definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: PostgreSQL Server version.. + * + * @param version PostgreSQL Server version. + * @return the next definition stage. + */ + WithCreate withVersion(ServerVersion version); + } + /** The stage of the Server definition allowing to specify storage. */ + interface WithStorage { + /** + * Specifies the storage property: Storage properties of a server.. + * + * @param storage Storage properties of a server. + * @return the next definition stage. + */ + WithCreate withStorage(Storage storage); + } + /** The stage of the Server definition allowing to specify backup. */ + interface WithBackup { + /** + * Specifies the backup property: Backup properties of a server.. + * + * @param backup Backup properties of a server. + * @return the next definition stage. + */ + WithCreate withBackup(Backup backup); + } + /** The stage of the Server definition allowing to specify network. */ + interface WithNetwork { + /** + * Specifies the network property: Network properties of a server.. + * + * @param network Network properties of a server. + * @return the next definition stage. + */ + WithCreate withNetwork(Network network); + } + /** The stage of the Server definition allowing to specify highAvailability. */ + interface WithHighAvailability { + /** + * Specifies the highAvailability property: High availability properties of a server.. + * + * @param highAvailability High availability properties of a server. + * @return the next definition stage. + */ + WithCreate withHighAvailability(HighAvailability highAvailability); + } + /** The stage of the Server definition allowing to specify sourceServerResourceId. */ + interface WithSourceServerResourceId { + /** + * Specifies the sourceServerResourceId property: The source server resource ID to restore from. It's + * required when 'createMode' is 'PointInTimeRestore'.. + * + * @param sourceServerResourceId The source server resource ID to restore from. It's required when + * 'createMode' is 'PointInTimeRestore'. + * @return the next definition stage. + */ + WithCreate withSourceServerResourceId(String sourceServerResourceId); + } + /** The stage of the Server definition allowing to specify pointInTimeUtc. */ + interface WithPointInTimeUtc { + /** + * Specifies the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time + * to restore from. It's required when 'createMode' is 'PointInTimeRestore'.. + * + * @param pointInTimeUtc Restore point creation time (ISO8601 format), specifying the time to restore from. + * It's required when 'createMode' is 'PointInTimeRestore'. + * @return the next definition stage. + */ + WithCreate withPointInTimeUtc(OffsetDateTime pointInTimeUtc); + } + /** The stage of the Server definition allowing to specify availabilityZone. */ + interface WithAvailabilityZone { + /** + * Specifies the availabilityZone property: availability zone information of the server.. + * + * @param availabilityZone availability zone information of the server. + * @return the next definition stage. + */ + WithCreate withAvailabilityZone(String availabilityZone); + } + /** The stage of the Server definition allowing to specify createMode. */ + interface WithCreateMode { + /** + * Specifies the createMode property: The mode to create a new PostgreSQL server.. + * + * @param createMode The mode to create a new PostgreSQL server. + * @return the next definition stage. + */ + WithCreate withCreateMode(CreateMode createMode); + } + /** The stage of the Server definition allowing to specify tagsPropertiesTags. */ + interface WithTagsPropertiesTags { + /** + * Specifies the tagsPropertiesTags property: Application-specific metadata in the form of key-value pairs.. + * + * @param tagsPropertiesTags Application-specific metadata in the form of key-value pairs. + * @return the next definition stage. + */ + WithCreate withTagsPropertiesTags(Map tagsPropertiesTags); + } } /** * Begins update for the Server resource. @@ -304,15 +448,13 @@ interface WithSku { /** The template for Server update. */ interface Update extends UpdateStages.WithTags, - UpdateStages.WithIdentity, UpdateStages.WithSku, - UpdateStages.WithStorageProfile, UpdateStages.WithAdministratorLoginPassword, - UpdateStages.WithVersion, - UpdateStages.WithSslEnforcement, - UpdateStages.WithMinimalTlsVersion, - UpdateStages.WithPublicNetworkAccess, - UpdateStages.WithReplicationRole { + UpdateStages.WithStorage, + UpdateStages.WithBackup, + UpdateStages.WithHighAvailability, + UpdateStages.WithMaintenanceWindow, + UpdateStages.WithCreateMode { /** * Executes the update request. * @@ -340,16 +482,6 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the Server update allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: The Azure Active Directory identity of the server.. - * - * @param identity The Azure Active Directory identity of the server. - * @return the next definition stage. - */ - Update withIdentity(ResourceIdentity identity); - } /** The stage of the Server update allowing to specify sku. */ interface WithSku { /** @@ -360,16 +492,6 @@ interface WithSku { */ Update withSku(Sku sku); } - /** The stage of the Server update allowing to specify storageProfile. */ - interface WithStorageProfile { - /** - * Specifies the storageProfile property: Storage profile of a server.. - * - * @param storageProfile Storage profile of a server. - * @return the next definition stage. - */ - Update withStorageProfile(StorageProfile storageProfile); - } /** The stage of the Server update allowing to specify administratorLoginPassword. */ interface WithAdministratorLoginPassword { /** @@ -380,57 +502,55 @@ interface WithAdministratorLoginPassword { */ Update withAdministratorLoginPassword(String administratorLoginPassword); } - /** The stage of the Server update allowing to specify version. */ - interface WithVersion { + /** The stage of the Server update allowing to specify storage. */ + interface WithStorage { /** - * Specifies the version property: The version of a server.. + * Specifies the storage property: Storage properties of a server.. * - * @param version The version of a server. + * @param storage Storage properties of a server. * @return the next definition stage. */ - Update withVersion(ServerVersion version); + Update withStorage(Storage storage); } - /** The stage of the Server update allowing to specify sslEnforcement. */ - interface WithSslEnforcement { + /** The stage of the Server update allowing to specify backup. */ + interface WithBackup { /** - * Specifies the sslEnforcement property: Enable ssl enforcement or not when connect to server.. + * Specifies the backup property: Backup properties of a server.. * - * @param sslEnforcement Enable ssl enforcement or not when connect to server. + * @param backup Backup properties of a server. * @return the next definition stage. */ - Update withSslEnforcement(SslEnforcementEnum sslEnforcement); + Update withBackup(Backup backup); } - /** The stage of the Server update allowing to specify minimalTlsVersion. */ - interface WithMinimalTlsVersion { + /** The stage of the Server update allowing to specify highAvailability. */ + interface WithHighAvailability { /** - * Specifies the minimalTlsVersion property: Enforce a minimal Tls version for the server.. + * Specifies the highAvailability property: High availability properties of a server.. * - * @param minimalTlsVersion Enforce a minimal Tls version for the server. + * @param highAvailability High availability properties of a server. * @return the next definition stage. */ - Update withMinimalTlsVersion(MinimalTlsVersionEnum minimalTlsVersion); + Update withHighAvailability(HighAvailability highAvailability); } - /** The stage of the Server update allowing to specify publicNetworkAccess. */ - interface WithPublicNetworkAccess { + /** The stage of the Server update allowing to specify maintenanceWindow. */ + interface WithMaintenanceWindow { /** - * Specifies the publicNetworkAccess property: Whether or not public network access is allowed for this - * server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + * Specifies the maintenanceWindow property: Maintenance window properties of a server.. * - * @param publicNetworkAccess Whether or not public network access is allowed for this server. Value is - * optional but if passed in, must be 'Enabled' or 'Disabled'. + * @param maintenanceWindow Maintenance window properties of a server. * @return the next definition stage. */ - Update withPublicNetworkAccess(PublicNetworkAccessEnum publicNetworkAccess); + Update withMaintenanceWindow(MaintenanceWindow maintenanceWindow); } - /** The stage of the Server update allowing to specify replicationRole. */ - interface WithReplicationRole { + /** The stage of the Server update allowing to specify createMode. */ + interface WithCreateMode { /** - * Specifies the replicationRole property: The replication role of the server.. + * Specifies the createMode property: The mode to update a new PostgreSQL server.. * - * @param replicationRole The replication role of the server. + * @param createMode The mode to update a new PostgreSQL server. * @return the next definition stage. */ - Update withReplicationRole(String replicationRole); + Update withCreateMode(CreateModeForUpdate createMode); } } /** @@ -447,4 +567,69 @@ interface WithReplicationRole { * @return the refreshed resource. */ Server refresh(Context context); + + /** + * Restarts a server. + * + * @param parameters The parameters for restarting a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(RestartParameter parameters); + + /** + * Restarts a server. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(); + + /** + * Restarts a server. + * + * @param parameters The parameters for restarting a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(RestartParameter parameters, Context context); + + /** + * Starts a server. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Starts a server. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); + + /** + * Stops a server. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Stops a server. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(Context context); } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerAdministratorResource.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerAdministratorResource.java deleted file mode 100644 index fb0409c8afc5..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerAdministratorResource.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.resourcemanager.postgresql.fluent.models.ServerAdministratorResourceInner; -import java.util.UUID; - -/** An immutable client-side representation of ServerAdministratorResource. */ -public interface ServerAdministratorResource { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the administratorType property: The type of administrator. - * - * @return the administratorType value. - */ - AdministratorType administratorType(); - - /** - * Gets the login property: The server administrator login account name. - * - * @return the login value. - */ - String login(); - - /** - * Gets the sid property: The server administrator Sid (Secure ID). - * - * @return the sid value. - */ - UUID sid(); - - /** - * Gets the tenantId property: The server Active Directory Administrator tenant id. - * - * @return the tenantId value. - */ - UUID tenantId(); - - /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.ServerAdministratorResourceInner object. - * - * @return the inner object. - */ - ServerAdministratorResourceInner innerModel(); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerAdministratorResourceListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerAdministratorResourceListResult.java deleted file mode 100644 index cc5d8ed46574..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerAdministratorResourceListResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.models.ServerAdministratorResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response to a list Active Directory Administrators request. */ -@Fluent -public final class ServerAdministratorResourceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerAdministratorResourceListResult.class); - - /* - * The list of server Active Directory Administrators for the server. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the value property: The list of server Active Directory Administrators for the server. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of server Active Directory Administrators for the server. - * - * @param value the value value to set. - * @return the ServerAdministratorResourceListResult object itself. - */ - public ServerAdministratorResourceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerAdministrators.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerAdministrators.java deleted file mode 100644 index 8287d51e64ab..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerAdministrators.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.ServerAdministratorResourceInner; - -/** Resource collection API of ServerAdministrators. */ -public interface ServerAdministrators { - /** - * Gets information about a AAD server administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a AAD server administrator. - */ - ServerAdministratorResource get(String resourceGroupName, String serverName); - - /** - * Gets information about a AAD server administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a AAD server administrator. - */ - Response getWithResponse(String resourceGroupName, String serverName, Context context); - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - ServerAdministratorResource createOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties); - - /** - * Creates or update active directory administrator on an existing server. The update action will overwrite the - * existing administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param properties The required parameters for creating or updating an AAD server administrator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a and external administrator to be created. - */ - ServerAdministratorResource createOrUpdate( - String resourceGroupName, String serverName, ServerAdministratorResourceInner properties, Context context); - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String serverName); - - /** - * Deletes server active directory administrator. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String serverName, Context context); - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - PagedIterable list(String resourceGroupName, String serverName); - - /** - * Returns a list of server Administrators. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response to a list Active Directory Administrators request. - */ - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerBasedPerformanceTiers.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerBasedPerformanceTiers.java deleted file mode 100644 index 10bea81fbf17..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerBasedPerformanceTiers.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of ServerBasedPerformanceTiers. */ -public interface ServerBasedPerformanceTiers { - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - PagedIterable list(String resourceGroupName, String serverName); - - /** - * List all the performance tiers for a PostgreSQL server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of performance tiers. - */ - PagedIterable list(String resourceGroupName, String serverName, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerEditionCapability.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerEditionCapability.java new file mode 100644 index 000000000000..4b211fbdd17b --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerEditionCapability.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Server edition capabilities. */ +@Immutable +public final class ServerEditionCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEditionCapability.class); + + /* + * Server edition name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The supportedStorageEditions property. + */ + @JsonProperty(value = "supportedStorageEditions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedStorageEditions; + + /* + * The supportedServerVersions property. + */ + @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedServerVersions; + + /** + * Get the name property: Server edition name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the supportedStorageEditions property: The supportedStorageEditions property. + * + * @return the supportedStorageEditions value. + */ + public List supportedStorageEditions() { + return this.supportedStorageEditions; + } + + /** + * Get the supportedServerVersions property: The supportedServerVersions property. + * + * @return the supportedServerVersions value. + */ + public List supportedServerVersions() { + return this.supportedServerVersions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedStorageEditions() != null) { + supportedStorageEditions().forEach(e -> e.validate()); + } + if (supportedServerVersions() != null) { + supportedServerVersions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerForCreate.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerForCreate.java deleted file mode 100644 index ea379ae3fd67..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerForCreate.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Represents a server to be created. */ -@Fluent -public final class ServerForCreate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerForCreate.class); - - /* - * The Azure Active Directory identity of the server. - */ - @JsonProperty(value = "identity") - private ResourceIdentity identity; - - /* - * 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 identity property: The Azure Active Directory identity of the server. - * - * @return the identity value. - */ - public ResourceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The Azure Active Directory identity of the server. - * - * @param identity the identity value to set. - * @return the ServerForCreate object itself. - */ - public ServerForCreate withIdentity(ResourceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the sku property: The SKU (pricing tier) of the server. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: 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 the properties property: Properties of the server. - * - * @return the properties value. - */ - public ServerPropertiesForCreate properties() { - return this.properties; - } - - /** - * Set the properties property: 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 property: The location the resource resides in. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: 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 the tags property: Application-specific metadata in the form of key-value pairs. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (properties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model ServerForCreate")); - } else { - properties().validate(); - } - if (location() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property location in model ServerForCreate")); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerForUpdate.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerForUpdate.java new file mode 100644 index 000000000000..62f1d306b5f3 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerForUpdate.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Represents a server to be updated. */ +@JsonFlatten +@Fluent +public class ServerForUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerForUpdate.class); + + /* + * The location the resource resides in. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The SKU (pricing tier) of the server. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The password of the administrator login. + */ + @JsonProperty(value = "properties.administratorLoginPassword") + private String administratorLoginPassword; + + /* + * Storage properties of a server. + */ + @JsonProperty(value = "properties.storage") + private Storage storage; + + /* + * Backup properties of a server. + */ + @JsonProperty(value = "properties.backup") + private Backup backup; + + /* + * High availability properties of a server. + */ + @JsonProperty(value = "properties.highAvailability") + private HighAvailability highAvailability; + + /* + * Maintenance window properties of a server. + */ + @JsonProperty(value = "properties.maintenanceWindow") + private MaintenanceWindow maintenanceWindow; + + /* + * The mode to update a new PostgreSQL server. + */ + @JsonProperty(value = "properties.createMode") + private CreateModeForUpdate createMode; + + /** + * Get the location property: The location the resource resides in. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location the resource resides in. + * + * @param location the location value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the sku property: The SKU (pricing tier) of the server. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU (pricing tier) of the server. + * + * @param sku the sku value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags property: Application-specific metadata in the form of key-value pairs. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Application-specific metadata in the form of key-value pairs. + * + * @param tags the tags value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the administratorLoginPassword property: The password of the administrator login. + * + * @return the administratorLoginPassword value. + */ + public String administratorLoginPassword() { + return this.administratorLoginPassword; + } + + /** + * Set the administratorLoginPassword property: The password of the administrator login. + * + * @param administratorLoginPassword the administratorLoginPassword value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; + return this; + } + + /** + * Get the storage property: Storage properties of a server. + * + * @return the storage value. + */ + public Storage storage() { + return this.storage; + } + + /** + * Set the storage property: Storage properties of a server. + * + * @param storage the storage value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withStorage(Storage storage) { + this.storage = storage; + return this; + } + + /** + * Get the backup property: Backup properties of a server. + * + * @return the backup value. + */ + public Backup backup() { + return this.backup; + } + + /** + * Set the backup property: Backup properties of a server. + * + * @param backup the backup value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withBackup(Backup backup) { + this.backup = backup; + return this; + } + + /** + * Get the highAvailability property: High availability properties of a server. + * + * @return the highAvailability value. + */ + public HighAvailability highAvailability() { + return this.highAvailability; + } + + /** + * Set the highAvailability property: High availability properties of a server. + * + * @param highAvailability the highAvailability value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withHighAvailability(HighAvailability highAvailability) { + this.highAvailability = highAvailability; + return this; + } + + /** + * Get the maintenanceWindow property: Maintenance window properties of a server. + * + * @return the maintenanceWindow value. + */ + public MaintenanceWindow maintenanceWindow() { + return this.maintenanceWindow; + } + + /** + * Set the maintenanceWindow property: Maintenance window properties of a server. + * + * @param maintenanceWindow the maintenanceWindow value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { + this.maintenanceWindow = maintenanceWindow; + return this; + } + + /** + * Get the createMode property: The mode to update a new PostgreSQL server. + * + * @return the createMode value. + */ + public CreateModeForUpdate createMode() { + return this.createMode; + } + + /** + * Set the createMode property: The mode to update a new PostgreSQL server. + * + * @param createMode the createMode value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withCreateMode(CreateModeForUpdate createMode) { + this.createMode = createMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (storage() != null) { + storage().validate(); + } + if (backup() != null) { + backup().validate(); + } + if (highAvailability() != null) { + highAvailability().validate(); + } + if (maintenanceWindow() != null) { + maintenanceWindow().validate(); + } + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerHAState.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerHAState.java new file mode 100644 index 000000000000..667d33d30cb7 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerHAState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServerHAState. */ +public final class ServerHAState extends ExpandableStringEnum { + /** Static value NotEnabled for ServerHAState. */ + public static final ServerHAState NOT_ENABLED = fromString("NotEnabled"); + + /** Static value CreatingStandby for ServerHAState. */ + public static final ServerHAState CREATING_STANDBY = fromString("CreatingStandby"); + + /** Static value ReplicatingData for ServerHAState. */ + public static final ServerHAState REPLICATING_DATA = fromString("ReplicatingData"); + + /** Static value FailingOver for ServerHAState. */ + public static final ServerHAState FAILING_OVER = fromString("FailingOver"); + + /** Static value Healthy for ServerHAState. */ + public static final ServerHAState HEALTHY = fromString("Healthy"); + + /** Static value RemovingStandby for ServerHAState. */ + public static final ServerHAState REMOVING_STANDBY = fromString("RemovingStandby"); + + /** + * Creates or finds a ServerHAState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerHAState. + */ + @JsonCreator + public static ServerHAState fromString(String name) { + return fromString(name, ServerHAState.class); + } + + /** @return known ServerHAState values. */ + public static Collection values() { + return values(ServerHAState.class); + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKey.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKey.java deleted file mode 100644 index 3039ff964f93..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKey.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.ServerKeyInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of ServerKey. */ -public interface ServerKey { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the kind property: Kind of encryption protector used to protect the key. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the serverKeyType property: The key type like 'AzureKeyVault'. - * - * @return the serverKeyType value. - */ - ServerKeyType serverKeyType(); - - /** - * Gets the uri property: The URI of the key. - * - * @return the uri value. - */ - String uri(); - - /** - * Gets the creationDate property: The key creation date. - * - * @return the creationDate value. - */ - OffsetDateTime creationDate(); - - /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.ServerKeyInner object. - * - * @return the inner object. - */ - ServerKeyInner innerModel(); - - /** The entirety of the ServerKey definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The ServerKey definition stages. */ - interface DefinitionStages { - /** The first stage of the ServerKey definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the ServerKey definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies serverName, resourceGroupName. - * - * @param serverName The name of the server. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingServer(String serverName, String resourceGroupName); - } - /** - * The stage of the ServerKey definition which contains all the minimum required properties for the resource to - * be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithServerKeyType, DefinitionStages.WithUri { - /** - * Executes the create request. - * - * @return the created resource. - */ - ServerKey create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ServerKey create(Context context); - } - /** The stage of the ServerKey definition allowing to specify serverKeyType. */ - interface WithServerKeyType { - /** - * Specifies the serverKeyType property: The key type like 'AzureKeyVault'.. - * - * @param serverKeyType The key type like 'AzureKeyVault'. - * @return the next definition stage. - */ - WithCreate withServerKeyType(ServerKeyType serverKeyType); - } - /** The stage of the ServerKey definition allowing to specify uri. */ - interface WithUri { - /** - * Specifies the uri property: The URI of the key.. - * - * @param uri The URI of the key. - * @return the next definition stage. - */ - WithCreate withUri(String uri); - } - } - /** - * Begins update for the ServerKey resource. - * - * @return the stage of resource update. - */ - ServerKey.Update update(); - - /** The template for ServerKey update. */ - interface Update extends UpdateStages.WithServerKeyType, UpdateStages.WithUri { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ServerKey apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ServerKey apply(Context context); - } - /** The ServerKey update stages. */ - interface UpdateStages { - /** The stage of the ServerKey update allowing to specify serverKeyType. */ - interface WithServerKeyType { - /** - * Specifies the serverKeyType property: The key type like 'AzureKeyVault'.. - * - * @param serverKeyType The key type like 'AzureKeyVault'. - * @return the next definition stage. - */ - Update withServerKeyType(ServerKeyType serverKeyType); - } - /** The stage of the ServerKey update allowing to specify uri. */ - interface WithUri { - /** - * Specifies the uri property: The URI of the key.. - * - * @param uri The URI of the key. - * @return the next definition stage. - */ - Update withUri(String uri); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ServerKey refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ServerKey refresh(Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKeyType.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKeyType.java deleted file mode 100644 index df333e4c395a..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKeyType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ServerKeyType. */ -public final class ServerKeyType extends ExpandableStringEnum { - /** Static value AzureKeyVault for ServerKeyType. */ - public static final ServerKeyType AZURE_KEY_VAULT = fromString("AzureKeyVault"); - - /** - * Creates or finds a ServerKeyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ServerKeyType. - */ - @JsonCreator - public static ServerKeyType fromString(String name) { - return fromString(name, ServerKeyType.class); - } - - /** @return known ServerKeyType values. */ - public static Collection values() { - return values(ServerKeyType.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKeys.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKeys.java deleted file mode 100644 index d28084508d39..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerKeys.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ServerKeys. */ -public interface ServerKeys { - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - PagedIterable list(String resourceGroupName, String serverName); - - /** - * Gets a list of Server keys. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Server keys. - */ - PagedIterable list(String resourceGroupName, String serverName, Context context); - - /** - * Gets a PostgreSQL Server key. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be retrieved. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - ServerKey get(String resourceGroupName, String serverName, String keyName); - - /** - * Gets a PostgreSQL Server key. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be retrieved. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - Response getWithResponse(String resourceGroupName, String serverName, String keyName, Context context); - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String serverName, String keyName, String resourceGroupName); - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param serverName The name of the server. - * @param keyName The name of the PostgreSQL Server key to be deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String serverName, String keyName, String resourceGroupName, Context context); - - /** - * Gets a PostgreSQL Server key. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - ServerKey getById(String id); - - /** - * Gets a PostgreSQL Server key. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a PostgreSQL Server key. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes the PostgreSQL Server key with the given name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ServerKey resource. - * - * @param name resource name. - * @return the first stage of the new ServerKey definition. - */ - ServerKey.DefinitionStages.Blank define(String name); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerListResult.java index 620aabfee5d8..4a77965066b2 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerListResult.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerListResult.java @@ -17,13 +17,19 @@ public final class ServerListResult { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerListResult.class); /* - * The list of servers + * The list of flexible servers */ @JsonProperty(value = "value") private List value; + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + /** - * Get the value property: The list of servers. + * Get the value property: The list of flexible servers. * * @return the value value. */ @@ -32,7 +38,7 @@ public List value() { } /** - * Set the value property: The list of servers. + * Set the value property: The list of flexible servers. * * @param value the value value to set. * @return the ServerListResult object itself. @@ -42,6 +48,26 @@ public ServerListResult withValue(List value) { return this; } + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the ServerListResult object itself. + */ + public ServerListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerParameters.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerParameters.java deleted file mode 100644 index ec1a3f17a2d8..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerParameters.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.ConfigurationListResultInner; - -/** Resource collection API of ServerParameters. */ -public interface ServerParameters { - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - ConfigurationListResult listUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value); - - /** - * Update a list of configurations in a given server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param value The parameters for updating a list of server configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server configurations. - */ - ConfigurationListResult listUpdateConfigurations( - String resourceGroupName, String serverName, ConfigurationListResultInner value, Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPrivateEndpointConnection.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPrivateEndpointConnection.java deleted file mode 100644 index 1161d72aac17..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPrivateEndpointConnection.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A private endpoint connection under a server. */ -@Immutable -public final class ServerPrivateEndpointConnection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerPrivateEndpointConnection.class); - - /* - * Resource ID of the Private Endpoint Connection. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * Private endpoint connection properties - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private ServerPrivateEndpointConnectionProperties properties; - - /** - * Get the id property: Resource ID of the Private Endpoint Connection. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the properties property: Private endpoint connection properties. - * - * @return the properties value. - */ - public ServerPrivateEndpointConnectionProperties properties() { - return this.properties; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPrivateEndpointConnectionProperties.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPrivateEndpointConnectionProperties.java deleted file mode 100644 index 5f5c621e350c..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of a private endpoint connection. */ -@Fluent -public final class ServerPrivateEndpointConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerPrivateEndpointConnectionProperties.class); - - /* - * Private endpoint which the connection belongs to. - */ - @JsonProperty(value = "privateEndpoint") - private PrivateEndpointProperty privateEndpoint; - - /* - * Connection state of the private endpoint connection. - */ - @JsonProperty(value = "privateLinkServiceConnectionState") - private ServerPrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState; - - /* - * State of the private endpoint connection. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointProvisioningState provisioningState; - - /** - * Get the privateEndpoint property: Private endpoint which the connection belongs to. - * - * @return the privateEndpoint value. - */ - public PrivateEndpointProperty privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: Private endpoint which the connection belongs to. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the ServerPrivateEndpointConnectionProperties object itself. - */ - public ServerPrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpointProperty privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. - * - * @return the privateLinkServiceConnectionState value. - */ - public ServerPrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the ServerPrivateEndpointConnectionProperties object itself. - */ - public ServerPrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - ServerPrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: State of the private endpoint connection. - * - * @return the provisioningState value. - */ - public PrivateEndpointProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPrivateLinkServiceConnectionStateProperty.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPrivateLinkServiceConnectionStateProperty.java deleted file mode 100644 index fb7a29204732..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPrivateLinkServiceConnectionStateProperty.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ServerPrivateLinkServiceConnectionStateProperty model. */ -@Fluent -public final class ServerPrivateLinkServiceConnectionStateProperty { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ServerPrivateLinkServiceConnectionStateProperty.class); - - /* - * The private link service connection status. - */ - @JsonProperty(value = "status", required = true) - private PrivateLinkServiceConnectionStateStatus status; - - /* - * The private link service connection description. - */ - @JsonProperty(value = "description", required = true) - private String description; - - /* - * The actions required for private link service connection. - */ - @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) - private PrivateLinkServiceConnectionStateActionsRequire actionsRequired; - - /** - * Get the status property: The private link service connection status. - * - * @return the status value. - */ - public PrivateLinkServiceConnectionStateStatus status() { - return this.status; - } - - /** - * Set the status property: The private link service connection status. - * - * @param status the status value to set. - * @return the ServerPrivateLinkServiceConnectionStateProperty object itself. - */ - public ServerPrivateLinkServiceConnectionStateProperty withStatus(PrivateLinkServiceConnectionStateStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: The private link service connection description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The private link service connection description. - * - * @param description the description value to set. - * @return the ServerPrivateLinkServiceConnectionStateProperty object itself. - */ - public ServerPrivateLinkServiceConnectionStateProperty withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionsRequired property: The actions required for private link service connection. - * - * @return the actionsRequired value. - */ - public PrivateLinkServiceConnectionStateActionsRequire actionsRequired() { - return this.actionsRequired; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property status in model ServerPrivateLinkServiceConnectionStateProperty")); - } - if (description() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property description in model" - + " ServerPrivateLinkServiceConnectionStateProperty")); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForCreate.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForCreate.java deleted file mode 100644 index 965c0ac7ce50..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForCreate.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -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", - defaultImpl = ServerPropertiesForCreate.class) -@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) -}) -@Fluent -public class ServerPropertiesForCreate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerPropertiesForCreate.class); - - /* - * Server version. - */ - @JsonProperty(value = "version") - private ServerVersion version; - - /* - * Enable ssl enforcement or not when connect to server. - */ - @JsonProperty(value = "sslEnforcement") - private SslEnforcementEnum sslEnforcement; - - /* - * Enforce a minimal Tls version for the server. - */ - @JsonProperty(value = "minimalTlsVersion") - private MinimalTlsVersionEnum minimalTlsVersion; - - /* - * Status showing whether the server enabled infrastructure encryption. - */ - @JsonProperty(value = "infrastructureEncryption") - private InfrastructureEncryption infrastructureEncryption; - - /* - * Whether or not public network access is allowed for this server. Value - * is optional but if passed in, must be 'Enabled' or 'Disabled' - */ - @JsonProperty(value = "publicNetworkAccess") - private PublicNetworkAccessEnum publicNetworkAccess; - - /* - * Storage profile of a server. - */ - @JsonProperty(value = "storageProfile") - private StorageProfile storageProfile; - - /** - * Get the version property: Server version. - * - * @return the version value. - */ - public ServerVersion version() { - return this.version; - } - - /** - * Set the version property: Server version. - * - * @param version the version value to set. - * @return the ServerPropertiesForCreate object itself. - */ - public ServerPropertiesForCreate withVersion(ServerVersion version) { - this.version = version; - return this; - } - - /** - * Get the sslEnforcement property: Enable ssl enforcement or not when connect to server. - * - * @return the sslEnforcement value. - */ - public SslEnforcementEnum sslEnforcement() { - return this.sslEnforcement; - } - - /** - * Set the sslEnforcement property: Enable ssl enforcement or not when connect to server. - * - * @param sslEnforcement the sslEnforcement value to set. - * @return the ServerPropertiesForCreate object itself. - */ - public ServerPropertiesForCreate withSslEnforcement(SslEnforcementEnum sslEnforcement) { - this.sslEnforcement = sslEnforcement; - return this; - } - - /** - * Get the minimalTlsVersion property: Enforce a minimal Tls version for the server. - * - * @return the minimalTlsVersion value. - */ - public MinimalTlsVersionEnum minimalTlsVersion() { - return this.minimalTlsVersion; - } - - /** - * Set the minimalTlsVersion property: Enforce a minimal Tls version for the server. - * - * @param minimalTlsVersion the minimalTlsVersion value to set. - * @return the ServerPropertiesForCreate object itself. - */ - public ServerPropertiesForCreate withMinimalTlsVersion(MinimalTlsVersionEnum minimalTlsVersion) { - this.minimalTlsVersion = minimalTlsVersion; - return this; - } - - /** - * Get the infrastructureEncryption property: Status showing whether the server enabled infrastructure encryption. - * - * @return the infrastructureEncryption value. - */ - public InfrastructureEncryption infrastructureEncryption() { - return this.infrastructureEncryption; - } - - /** - * Set the infrastructureEncryption property: Status showing whether the server enabled infrastructure encryption. - * - * @param infrastructureEncryption the infrastructureEncryption value to set. - * @return the ServerPropertiesForCreate object itself. - */ - public ServerPropertiesForCreate withInfrastructureEncryption(InfrastructureEncryption infrastructureEncryption) { - this.infrastructureEncryption = infrastructureEncryption; - return this; - } - - /** - * Get the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * optional but if passed in, must be 'Enabled' or 'Disabled'. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccessEnum publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * optional but if passed in, must be 'Enabled' or 'Disabled'. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the ServerPropertiesForCreate object itself. - */ - public ServerPropertiesForCreate withPublicNetworkAccess(PublicNetworkAccessEnum publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Get the storageProfile property: Storage profile of a server. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageProfile() != null) { - storageProfile().validate(); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForDefaultCreate.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForDefaultCreate.java deleted file mode 100644 index e0ab8bbbb7d9..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForDefaultCreate.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import 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") -@Fluent -public final class ServerPropertiesForDefaultCreate extends ServerPropertiesForCreate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerPropertiesForDefaultCreate.class); - - /* - * 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 administratorLogin property: 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 administratorLogin property: 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 administratorLoginPassword property: The password of the administrator login. - * - * @return the administratorLoginPassword value. - */ - public String administratorLoginPassword() { - return this.administratorLoginPassword; - } - - /** - * Set the administratorLoginPassword property: 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; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForDefaultCreate withVersion(ServerVersion version) { - super.withVersion(version); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForDefaultCreate withSslEnforcement(SslEnforcementEnum sslEnforcement) { - super.withSslEnforcement(sslEnforcement); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForDefaultCreate withMinimalTlsVersion(MinimalTlsVersionEnum minimalTlsVersion) { - super.withMinimalTlsVersion(minimalTlsVersion); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForDefaultCreate withInfrastructureEncryption( - InfrastructureEncryption infrastructureEncryption) { - super.withInfrastructureEncryption(infrastructureEncryption); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForDefaultCreate withPublicNetworkAccess(PublicNetworkAccessEnum publicNetworkAccess) { - super.withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForDefaultCreate withStorageProfile(StorageProfile storageProfile) { - super.withStorageProfile(storageProfile); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (administratorLogin() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property administratorLogin in model ServerPropertiesForDefaultCreate")); - } - if (administratorLoginPassword() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property administratorLoginPassword in model" - + " ServerPropertiesForDefaultCreate")); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForGeoRestore.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForGeoRestore.java deleted file mode 100644 index 425a1302f493..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForGeoRestore.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import 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") -@Fluent -public final class ServerPropertiesForGeoRestore extends ServerPropertiesForCreate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerPropertiesForGeoRestore.class); - - /* - * The source server id to restore from. - */ - @JsonProperty(value = "sourceServerId", required = true) - private String sourceServerId; - - /** - * Get the sourceServerId property: The source server id to restore from. - * - * @return the sourceServerId value. - */ - public String sourceServerId() { - return this.sourceServerId; - } - - /** - * Set the sourceServerId property: 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; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForGeoRestore withVersion(ServerVersion version) { - super.withVersion(version); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForGeoRestore withSslEnforcement(SslEnforcementEnum sslEnforcement) { - super.withSslEnforcement(sslEnforcement); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForGeoRestore withMinimalTlsVersion(MinimalTlsVersionEnum minimalTlsVersion) { - super.withMinimalTlsVersion(minimalTlsVersion); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForGeoRestore withInfrastructureEncryption( - InfrastructureEncryption infrastructureEncryption) { - super.withInfrastructureEncryption(infrastructureEncryption); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForGeoRestore withPublicNetworkAccess(PublicNetworkAccessEnum publicNetworkAccess) { - super.withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForGeoRestore withStorageProfile(StorageProfile storageProfile) { - super.withStorageProfile(storageProfile); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (sourceServerId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceServerId in model ServerPropertiesForGeoRestore")); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForReplica.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForReplica.java deleted file mode 100644 index 0ec6e53bf4af..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForReplica.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import 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") -@Fluent -public final class ServerPropertiesForReplica extends ServerPropertiesForCreate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerPropertiesForReplica.class); - - /* - * The master server id to create replica from. - */ - @JsonProperty(value = "sourceServerId", required = true) - private String sourceServerId; - - /** - * Get the sourceServerId property: The master server id to create replica from. - * - * @return the sourceServerId value. - */ - public String sourceServerId() { - return this.sourceServerId; - } - - /** - * Set the sourceServerId property: 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; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForReplica withVersion(ServerVersion version) { - super.withVersion(version); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForReplica withSslEnforcement(SslEnforcementEnum sslEnforcement) { - super.withSslEnforcement(sslEnforcement); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForReplica withMinimalTlsVersion(MinimalTlsVersionEnum minimalTlsVersion) { - super.withMinimalTlsVersion(minimalTlsVersion); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForReplica withInfrastructureEncryption(InfrastructureEncryption infrastructureEncryption) { - super.withInfrastructureEncryption(infrastructureEncryption); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForReplica withPublicNetworkAccess(PublicNetworkAccessEnum publicNetworkAccess) { - super.withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForReplica withStorageProfile(StorageProfile storageProfile) { - super.withStorageProfile(storageProfile); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (sourceServerId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceServerId in model ServerPropertiesForReplica")); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForRestore.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForRestore.java deleted file mode 100644 index 03d8335cc0e1..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPropertiesForRestore.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; - -/** 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") -@Fluent -public final class ServerPropertiesForRestore extends ServerPropertiesForCreate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerPropertiesForRestore.class); - - /* - * 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 OffsetDateTime restorePointInTime; - - /** - * Get the sourceServerId property: The source server id to restore from. - * - * @return the sourceServerId value. - */ - public String sourceServerId() { - return this.sourceServerId; - } - - /** - * Set the sourceServerId property: 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 the restorePointInTime property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. - * - * @return the restorePointInTime value. - */ - public OffsetDateTime restorePointInTime() { - return this.restorePointInTime; - } - - /** - * Set the restorePointInTime property: 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(OffsetDateTime restorePointInTime) { - this.restorePointInTime = restorePointInTime; - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForRestore withVersion(ServerVersion version) { - super.withVersion(version); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForRestore withSslEnforcement(SslEnforcementEnum sslEnforcement) { - super.withSslEnforcement(sslEnforcement); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForRestore withMinimalTlsVersion(MinimalTlsVersionEnum minimalTlsVersion) { - super.withMinimalTlsVersion(minimalTlsVersion); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForRestore withInfrastructureEncryption(InfrastructureEncryption infrastructureEncryption) { - super.withInfrastructureEncryption(infrastructureEncryption); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForRestore withPublicNetworkAccess(PublicNetworkAccessEnum publicNetworkAccess) { - super.withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - /** {@inheritDoc} */ - @Override - public ServerPropertiesForRestore withStorageProfile(StorageProfile storageProfile) { - super.withStorageProfile(storageProfile); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (sourceServerId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceServerId in model ServerPropertiesForRestore")); - } - if (restorePointInTime() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property restorePointInTime in model ServerPropertiesForRestore")); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPublicNetworkAccessState.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPublicNetworkAccessState.java new file mode 100644 index 000000000000..8f60da1bf5ed --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerPublicNetworkAccessState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServerPublicNetworkAccessState. */ +public final class ServerPublicNetworkAccessState extends ExpandableStringEnum { + /** Static value Enabled for ServerPublicNetworkAccessState. */ + public static final ServerPublicNetworkAccessState ENABLED = fromString("Enabled"); + + /** Static value Disabled for ServerPublicNetworkAccessState. */ + public static final ServerPublicNetworkAccessState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ServerPublicNetworkAccessState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerPublicNetworkAccessState. + */ + @JsonCreator + public static ServerPublicNetworkAccessState fromString(String name) { + return fromString(name, ServerPublicNetworkAccessState.class); + } + + /** @return known ServerPublicNetworkAccessState values. */ + public static Collection values() { + return values(ServerPublicNetworkAccessState.class); + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicies.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicies.java deleted file mode 100644 index 9a7a855d5da6..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicies.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ServerSecurityAlertPolicies. */ -public interface ServerSecurityAlertPolicies { - /** - * Get a server's security alert policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the security alert policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - ServerSecurityAlertPolicy get( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName); - - /** - * Get a server's security alert policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param securityAlertPolicyName The name of the security alert policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - Response getWithResponse( - String resourceGroupName, String serverName, SecurityAlertPolicyName securityAlertPolicyName, Context context); - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * Get the server's threat detection policies. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the server's threat detection policies. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); - - /** - * Get a server's security alert policy. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - ServerSecurityAlertPolicy getById(String id); - - /** - * Get a server's security alert policy. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server's security alert policy. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ServerSecurityAlertPolicy resource. - * - * @param name resource name. - * @return the first stage of the new ServerSecurityAlertPolicy definition. - */ - ServerSecurityAlertPolicy.DefinitionStages.Blank define(SecurityAlertPolicyName name); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicy.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicy.java deleted file mode 100644 index ea4650e81fdd..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicy.java +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.ServerSecurityAlertPolicyInner; -import java.util.List; - -/** An immutable client-side representation of ServerSecurityAlertPolicy. */ -public interface ServerSecurityAlertPolicy { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the state property: Specifies the state of the policy, whether it is enabled or disabled. - * - * @return the state value. - */ - ServerSecurityAlertPolicyState state(); - - /** - * Gets the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values are: - * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly. - * - * @return the disabledAlerts value. - */ - List disabledAlerts(); - - /** - * Gets the emailAddresses property: Specifies an array of e-mail addresses to which the alert is sent. - * - * @return the emailAddresses value. - */ - List emailAddresses(); - - /** - * Gets the emailAccountAdmins property: Specifies that the alert is sent to the account administrators. - * - * @return the emailAccountAdmins value. - */ - Boolean emailAccountAdmins(); - - /** - * Gets the storageEndpoint property: 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. - */ - String storageEndpoint(); - - /** - * Gets the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection audit storage - * account. - * - * @return the storageAccountAccessKey value. - */ - String storageAccountAccessKey(); - - /** - * Gets the retentionDays property: Specifies the number of days to keep in the Threat Detection audit logs. - * - * @return the retentionDays value. - */ - Integer retentionDays(); - - /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.ServerSecurityAlertPolicyInner object. - * - * @return the inner object. - */ - ServerSecurityAlertPolicyInner innerModel(); - - /** The entirety of the ServerSecurityAlertPolicy definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The ServerSecurityAlertPolicy definition stages. */ - interface DefinitionStages { - /** The first stage of the ServerSecurityAlertPolicy definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the ServerSecurityAlertPolicy definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, serverName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @return the next definition stage. - */ - WithCreate withExistingServer(String resourceGroupName, String serverName); - } - /** - * The stage of the ServerSecurityAlertPolicy definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithState, - DefinitionStages.WithDisabledAlerts, - DefinitionStages.WithEmailAddresses, - DefinitionStages.WithEmailAccountAdmins, - DefinitionStages.WithStorageEndpoint, - DefinitionStages.WithStorageAccountAccessKey, - DefinitionStages.WithRetentionDays { - /** - * Executes the create request. - * - * @return the created resource. - */ - ServerSecurityAlertPolicy create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ServerSecurityAlertPolicy create(Context context); - } - /** The stage of the ServerSecurityAlertPolicy definition allowing to specify state. */ - interface WithState { - /** - * Specifies the state property: Specifies the state of the policy, whether it is enabled or disabled.. - * - * @param state Specifies the state of the policy, whether it is enabled or disabled. - * @return the next definition stage. - */ - WithCreate withState(ServerSecurityAlertPolicyState state); - } - /** The stage of the ServerSecurityAlertPolicy definition allowing to specify disabledAlerts. */ - interface WithDisabledAlerts { - /** - * Specifies the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values - * are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly. - * - * @param disabledAlerts Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, - * Sql_Injection_Vulnerability, Access_Anomaly. - * @return the next definition stage. - */ - WithCreate withDisabledAlerts(List disabledAlerts); - } - /** The stage of the ServerSecurityAlertPolicy definition allowing to specify emailAddresses. */ - interface WithEmailAddresses { - /** - * Specifies the emailAddresses property: Specifies an array of e-mail addresses to which the alert is - * sent.. - * - * @param emailAddresses Specifies an array of e-mail addresses to which the alert is sent. - * @return the next definition stage. - */ - WithCreate withEmailAddresses(List emailAddresses); - } - /** The stage of the ServerSecurityAlertPolicy definition allowing to specify emailAccountAdmins. */ - interface WithEmailAccountAdmins { - /** - * Specifies the emailAccountAdmins property: Specifies that the alert is sent to the account - * administrators.. - * - * @param emailAccountAdmins Specifies that the alert is sent to the account administrators. - * @return the next definition stage. - */ - WithCreate withEmailAccountAdmins(Boolean emailAccountAdmins); - } - /** The stage of the ServerSecurityAlertPolicy definition allowing to specify storageEndpoint. */ - interface WithStorageEndpoint { - /** - * Specifies the storageEndpoint property: 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 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 next definition stage. - */ - WithCreate withStorageEndpoint(String storageEndpoint); - } - /** The stage of the ServerSecurityAlertPolicy definition allowing to specify storageAccountAccessKey. */ - interface WithStorageAccountAccessKey { - /** - * Specifies the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection - * audit storage account.. - * - * @param storageAccountAccessKey Specifies the identifier key of the Threat Detection audit storage - * account. - * @return the next definition stage. - */ - WithCreate withStorageAccountAccessKey(String storageAccountAccessKey); - } - /** The stage of the ServerSecurityAlertPolicy definition allowing to specify retentionDays. */ - interface WithRetentionDays { - /** - * Specifies the retentionDays property: Specifies the number of days to keep in the Threat Detection audit - * logs.. - * - * @param retentionDays Specifies the number of days to keep in the Threat Detection audit logs. - * @return the next definition stage. - */ - WithCreate withRetentionDays(Integer retentionDays); - } - } - /** - * Begins update for the ServerSecurityAlertPolicy resource. - * - * @return the stage of resource update. - */ - ServerSecurityAlertPolicy.Update update(); - - /** The template for ServerSecurityAlertPolicy update. */ - interface Update - extends UpdateStages.WithState, - UpdateStages.WithDisabledAlerts, - UpdateStages.WithEmailAddresses, - UpdateStages.WithEmailAccountAdmins, - UpdateStages.WithStorageEndpoint, - UpdateStages.WithStorageAccountAccessKey, - UpdateStages.WithRetentionDays { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ServerSecurityAlertPolicy apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ServerSecurityAlertPolicy apply(Context context); - } - /** The ServerSecurityAlertPolicy update stages. */ - interface UpdateStages { - /** The stage of the ServerSecurityAlertPolicy update allowing to specify state. */ - interface WithState { - /** - * Specifies the state property: Specifies the state of the policy, whether it is enabled or disabled.. - * - * @param state Specifies the state of the policy, whether it is enabled or disabled. - * @return the next definition stage. - */ - Update withState(ServerSecurityAlertPolicyState state); - } - /** The stage of the ServerSecurityAlertPolicy update allowing to specify disabledAlerts. */ - interface WithDisabledAlerts { - /** - * Specifies the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values - * are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly. - * - * @param disabledAlerts Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, - * Sql_Injection_Vulnerability, Access_Anomaly. - * @return the next definition stage. - */ - Update withDisabledAlerts(List disabledAlerts); - } - /** The stage of the ServerSecurityAlertPolicy update allowing to specify emailAddresses. */ - interface WithEmailAddresses { - /** - * Specifies the emailAddresses property: Specifies an array of e-mail addresses to which the alert is - * sent.. - * - * @param emailAddresses Specifies an array of e-mail addresses to which the alert is sent. - * @return the next definition stage. - */ - Update withEmailAddresses(List emailAddresses); - } - /** The stage of the ServerSecurityAlertPolicy update allowing to specify emailAccountAdmins. */ - interface WithEmailAccountAdmins { - /** - * Specifies the emailAccountAdmins property: Specifies that the alert is sent to the account - * administrators.. - * - * @param emailAccountAdmins Specifies that the alert is sent to the account administrators. - * @return the next definition stage. - */ - Update withEmailAccountAdmins(Boolean emailAccountAdmins); - } - /** The stage of the ServerSecurityAlertPolicy update allowing to specify storageEndpoint. */ - interface WithStorageEndpoint { - /** - * Specifies the storageEndpoint property: 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 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 next definition stage. - */ - Update withStorageEndpoint(String storageEndpoint); - } - /** The stage of the ServerSecurityAlertPolicy update allowing to specify storageAccountAccessKey. */ - interface WithStorageAccountAccessKey { - /** - * Specifies the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection - * audit storage account.. - * - * @param storageAccountAccessKey Specifies the identifier key of the Threat Detection audit storage - * account. - * @return the next definition stage. - */ - Update withStorageAccountAccessKey(String storageAccountAccessKey); - } - /** The stage of the ServerSecurityAlertPolicy update allowing to specify retentionDays. */ - interface WithRetentionDays { - /** - * Specifies the retentionDays property: Specifies the number of days to keep in the Threat Detection audit - * logs.. - * - * @param retentionDays Specifies the number of days to keep in the Threat Detection audit logs. - * @return the next definition stage. - */ - Update withRetentionDays(Integer retentionDays); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ServerSecurityAlertPolicy refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ServerSecurityAlertPolicy refresh(Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicyListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicyListResult.java deleted file mode 100644 index 7559cd335cdc..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicyListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.models.ServerSecurityAlertPolicyInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of the server's security alert policies. */ -@Immutable -public final class ServerSecurityAlertPolicyListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerSecurityAlertPolicyListResult.class); - - /* - * Array of results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to retrieve next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Array of results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicyState.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicyState.java deleted file mode 100644 index 9be158c3e992..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerSecurityAlertPolicyState.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -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 final 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/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerState.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerState.java index 3c04b348395b..af228b9107b6 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerState.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerState.java @@ -19,8 +19,17 @@ public final class ServerState extends ExpandableStringEnum { /** Static value Disabled for ServerState. */ public static final ServerState DISABLED = fromString("Disabled"); - /** Static value Inaccessible for ServerState. */ - public static final ServerState INACCESSIBLE = fromString("Inaccessible"); + /** Static value Starting for ServerState. */ + public static final ServerState STARTING = fromString("Starting"); + + /** Static value Stopping for ServerState. */ + public static final ServerState STOPPING = fromString("Stopping"); + + /** Static value Stopped for ServerState. */ + public static final ServerState STOPPED = fromString("Stopped"); + + /** Static value Updating for ServerState. */ + public static final ServerState UPDATING = fromString("Updating"); /** * Creates or finds a ServerState from its string representation. diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerUpdateParameters.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerUpdateParameters.java deleted file mode 100644 index c31406e975e0..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerUpdateParameters.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Parameters allowed to update for a server. */ -@JsonFlatten -@Fluent -public class ServerUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerUpdateParameters.class); - - /* - * The Azure Active Directory identity of the server. - */ - @JsonProperty(value = "identity") - private ResourceIdentity identity; - - /* - * The SKU (pricing tier) of the server. - */ - @JsonProperty(value = "sku") - private Sku sku; - - /* - * Application-specific metadata in the form of key-value pairs. - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * 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. - */ - @JsonProperty(value = "properties.version") - private ServerVersion version; - - /* - * Enable ssl enforcement or not when connect to server. - */ - @JsonProperty(value = "properties.sslEnforcement") - private SslEnforcementEnum sslEnforcement; - - /* - * Enforce a minimal Tls version for the server. - */ - @JsonProperty(value = "properties.minimalTlsVersion") - private MinimalTlsVersionEnum minimalTlsVersion; - - /* - * Whether or not public network access is allowed for this server. Value - * is optional but if passed in, must be 'Enabled' or 'Disabled' - */ - @JsonProperty(value = "properties.publicNetworkAccess") - private PublicNetworkAccessEnum publicNetworkAccess; - - /* - * The replication role of the server. - */ - @JsonProperty(value = "properties.replicationRole") - private String replicationRole; - - /** - * Get the identity property: The Azure Active Directory identity of the server. - * - * @return the identity value. - */ - public ResourceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The Azure Active Directory identity of the server. - * - * @param identity the identity value to set. - * @return the ServerUpdateParameters object itself. - */ - public ServerUpdateParameters withIdentity(ResourceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the sku property: The SKU (pricing tier) of the server. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: 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 the tags property: Application-specific metadata in the form of key-value pairs. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: 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; - } - - /** - * Get the storageProfile property: Storage profile of a server. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: 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 administratorLoginPassword property: The password of the administrator login. - * - * @return the administratorLoginPassword value. - */ - public String administratorLoginPassword() { - return this.administratorLoginPassword; - } - - /** - * Set the administratorLoginPassword property: 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 property: The version of a server. - * - * @return the version value. - */ - public ServerVersion version() { - return this.version; - } - - /** - * Set the version property: The version of a server. - * - * @param version the version value to set. - * @return the ServerUpdateParameters object itself. - */ - public ServerUpdateParameters withVersion(ServerVersion version) { - this.version = version; - return this; - } - - /** - * Get the sslEnforcement property: Enable ssl enforcement or not when connect to server. - * - * @return the sslEnforcement value. - */ - public SslEnforcementEnum sslEnforcement() { - return this.sslEnforcement; - } - - /** - * Set the sslEnforcement property: Enable ssl enforcement or not when connect to server. - * - * @param sslEnforcement the sslEnforcement value to set. - * @return the ServerUpdateParameters object itself. - */ - public ServerUpdateParameters withSslEnforcement(SslEnforcementEnum sslEnforcement) { - this.sslEnforcement = sslEnforcement; - return this; - } - - /** - * Get the minimalTlsVersion property: Enforce a minimal Tls version for the server. - * - * @return the minimalTlsVersion value. - */ - public MinimalTlsVersionEnum minimalTlsVersion() { - return this.minimalTlsVersion; - } - - /** - * Set the minimalTlsVersion property: Enforce a minimal Tls version for the server. - * - * @param minimalTlsVersion the minimalTlsVersion value to set. - * @return the ServerUpdateParameters object itself. - */ - public ServerUpdateParameters withMinimalTlsVersion(MinimalTlsVersionEnum minimalTlsVersion) { - this.minimalTlsVersion = minimalTlsVersion; - return this; - } - - /** - * Get the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * optional but if passed in, must be 'Enabled' or 'Disabled'. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccessEnum publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: Whether or not public network access is allowed for this server. Value is - * optional but if passed in, must be 'Enabled' or 'Disabled'. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the ServerUpdateParameters object itself. - */ - public ServerUpdateParameters withPublicNetworkAccess(PublicNetworkAccessEnum publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Get the replicationRole property: The replication role of the server. - * - * @return the replicationRole value. - */ - public String replicationRole() { - return this.replicationRole; - } - - /** - * Set the replicationRole property: 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerVersion.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerVersion.java index ada4fc8487fd..53d165820753 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerVersion.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerVersion.java @@ -10,20 +10,11 @@ /** Defines values for ServerVersion. */ public final class ServerVersion extends ExpandableStringEnum { - /** Static value 9.5 for ServerVersion. */ - public static final ServerVersion NINE_FIVE = fromString("9.5"); + /** Static value 13 for ServerVersion. */ + public static final ServerVersion ONE_THREE = fromString("13"); - /** Static value 9.6 for ServerVersion. */ - public static final ServerVersion NINE_SIX = fromString("9.6"); - - /** Static value 10 for ServerVersion. */ - public static final ServerVersion ONE_ZERO = fromString("10"); - - /** Static value 10.0 for ServerVersion. */ - public static final ServerVersion ONE_ZERO_ZERO = fromString("10.0"); - - /** Static value 10.2 for ServerVersion. */ - public static final ServerVersion ONE_ZERO_TWO = fromString("10.2"); + /** Static value 12 for ServerVersion. */ + public static final ServerVersion ONE_TWO = fromString("12"); /** Static value 11 for ServerVersion. */ public static final ServerVersion ONE_ONE = fromString("11"); diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerVersionCapability.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerVersionCapability.java new file mode 100644 index 000000000000..525f8d20c30d --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/ServerVersionCapability.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Server version capabilities. */ +@Immutable +public final class ServerVersionCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerVersionCapability.class); + + /* + * server version + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The supportedVcores property. + */ + @JsonProperty(value = "supportedVcores", access = JsonProperty.Access.WRITE_ONLY) + private List supportedVcores; + + /** + * Get the name property: server version. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the supportedVcores property: The supportedVcores property. + * + * @return the supportedVcores value. + */ + public List supportedVcores() { + return this.supportedVcores; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedVcores() != null) { + supportedVcores().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Servers.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Servers.java index bb4f6c15c0c9..6f8625c3bca2 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Servers.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Servers.java @@ -101,6 +101,18 @@ public interface Servers { */ PagedIterable list(Context context); + /** + * Restarts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String serverName, RestartParameter parameters); + /** * Restarts a server. * @@ -117,12 +129,59 @@ public interface Servers { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serverName The name of the server. + * @param parameters The parameters for restarting a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String serverName, RestartParameter parameters, Context context); + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String serverName); + + /** + * Starts a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String serverName, Context context); + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String serverName); + + /** + * Stops a server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void restart(String resourceGroupName, String serverName, Context context); + void stop(String resourceGroupName, String serverName, Context context); /** * Gets information about a server. diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Sku.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Sku.java index 5e07e0fefe57..7cd6be0248e0 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Sku.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Sku.java @@ -9,44 +9,26 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Billing information related properties of a server. */ +/** Sku information related properties of a server. */ @Fluent public final class Sku { @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); /* - * The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, - * GP_Gen5_8. + * The name of the sku, typically, tier + family + cores, e.g. + * Standard_D4s_v3. */ @JsonProperty(value = "name", required = true) private String name; /* - * The tier of the particular SKU, e.g. Basic. + * The tier of the particular SKU, e.g. Burstable. */ - @JsonProperty(value = "tier") + @JsonProperty(value = "tier", required = true) 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 property: The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. + * Get the name property: The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. * * @return the name value. */ @@ -55,7 +37,7 @@ public String name() { } /** - * Set the name property: The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. + * Set the name property: The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. * * @param name the name value to set. * @return the Sku object itself. @@ -66,7 +48,7 @@ public Sku withName(String name) { } /** - * Get the tier property: The tier of the particular SKU, e.g. Basic. + * Get the tier property: The tier of the particular SKU, e.g. Burstable. * * @return the tier value. */ @@ -75,7 +57,7 @@ public SkuTier tier() { } /** - * Set the tier property: The tier of the particular SKU, e.g. Basic. + * Set the tier property: The tier of the particular SKU, e.g. Burstable. * * @param tier the tier value to set. * @return the Sku object itself. @@ -85,66 +67,6 @@ public Sku withTier(SkuTier tier) { return this; } - /** - * Get the capacity property: The scale up/out capacity, representing server's compute units. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: 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 property: The size code, to be interpreted by resource as appropriate. - * - * @return the size value. - */ - public String size() { - return this.size; - } - - /** - * Set the size property: 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 property: The family of hardware. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Set the family property: 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; - } - /** * Validates the instance. * @@ -155,5 +77,9 @@ public void validate() { throw logger .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); } + if (tier() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property tier in model Sku")); + } } } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SkuTier.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SkuTier.java index 43e65e0da45d..e8c535bc4925 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SkuTier.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SkuTier.java @@ -10,8 +10,8 @@ /** Defines values for SkuTier. */ public final class SkuTier extends ExpandableStringEnum { - /** Static value Basic for SkuTier. */ - public static final SkuTier BASIC = fromString("Basic"); + /** Static value Burstable for SkuTier. */ + public static final SkuTier BURSTABLE = fromString("Burstable"); /** Static value GeneralPurpose for SkuTier. */ public static final SkuTier GENERAL_PURPOSE = fromString("GeneralPurpose"); diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SslEnforcementEnum.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SslEnforcementEnum.java deleted file mode 100644 index 39fd54b21800..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/SslEnforcementEnum.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -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 final 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/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointProperty.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Storage.java similarity index 52% rename from sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointProperty.java rename to sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Storage.java index fc26c1038ae5..fe84e7a9cfd3 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/PrivateEndpointProperty.java +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/Storage.java @@ -9,34 +9,34 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The PrivateEndpointProperty model. */ +/** Storage properties of a server. */ @Fluent -public final class PrivateEndpointProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointProperty.class); +public final class Storage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Storage.class); /* - * Resource id of the private endpoint. + * Max storage allowed for a server. */ - @JsonProperty(value = "id") - private String id; + @JsonProperty(value = "storageSizeGB") + private Integer storageSizeGB; /** - * Get the id property: Resource id of the private endpoint. + * Get the storageSizeGB property: Max storage allowed for a server. * - * @return the id value. + * @return the storageSizeGB value. */ - public String id() { - return this.id; + public Integer storageSizeGB() { + return this.storageSizeGB; } /** - * Set the id property: Resource id of the private endpoint. + * Set the storageSizeGB property: Max storage allowed for a server. * - * @param id the id value to set. - * @return the PrivateEndpointProperty object itself. + * @param storageSizeGB the storageSizeGB value to set. + * @return the Storage object itself. */ - public PrivateEndpointProperty withId(String id) { - this.id = id; + public Storage withStorageSizeGB(Integer storageSizeGB) { + this.storageSizeGB = storageSizeGB; return this; } diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageAutogrow.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageAutogrow.java deleted file mode 100644 index 0b2d4bb38c16..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageAutogrow.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for StorageAutogrow. */ -public final class StorageAutogrow extends ExpandableStringEnum { - /** Static value Enabled for StorageAutogrow. */ - public static final StorageAutogrow ENABLED = fromString("Enabled"); - - /** Static value Disabled for StorageAutogrow. */ - public static final StorageAutogrow DISABLED = fromString("Disabled"); - - /** - * Creates or finds a StorageAutogrow from its string representation. - * - * @param name a name to look for. - * @return the corresponding StorageAutogrow. - */ - @JsonCreator - public static StorageAutogrow fromString(String name) { - return fromString(name, StorageAutogrow.class); - } - - /** @return known StorageAutogrow values. */ - public static Collection values() { - return values(StorageAutogrow.class); - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageEditionCapability.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageEditionCapability.java new file mode 100644 index 000000000000..ebfaea676e88 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageEditionCapability.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** storage edition capability. */ +@Immutable +public final class StorageEditionCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageEditionCapability.class); + + /* + * storage edition name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The supportedStorageMB property. + */ + @JsonProperty(value = "supportedStorageMB", access = JsonProperty.Access.WRITE_ONLY) + private List supportedStorageMB; + + /** + * Get the name property: storage edition name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the supportedStorageMB property: The supportedStorageMB property. + * + * @return the supportedStorageMB value. + */ + public List supportedStorageMB() { + return this.supportedStorageMB; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedStorageMB() != null) { + supportedStorageMB().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageMBCapability.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageMBCapability.java new file mode 100644 index 000000000000..14ec27f0c48b --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageMBCapability.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** storage size in MB capability. */ +@Immutable +public final class StorageMBCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageMBCapability.class); + + /* + * storage MB name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * supported IOPS + */ + @JsonProperty(value = "supportedIops", access = JsonProperty.Access.WRITE_ONLY) + private Long supportedIops; + + /* + * storage size in MB + */ + @JsonProperty(value = "storageSizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Long storageSizeMB; + + /** + * Get the name property: storage MB name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the supportedIops property: supported IOPS. + * + * @return the supportedIops value. + */ + public Long supportedIops() { + return this.supportedIops; + } + + /** + * Get the storageSizeMB property: storage size in MB. + * + * @return the storageSizeMB value. + */ + public Long storageSizeMB() { + return this.storageSizeMB; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageProfile.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageProfile.java deleted file mode 100644 index 747650fce578..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/StorageProfile.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Storage Profile properties of a server. */ -@Fluent -public final class StorageProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageProfile.class); - - /* - * Backup retention days for the server. - */ - @JsonProperty(value = "backupRetentionDays") - private Integer backupRetentionDays; - - /* - * Enable Geo-redundant or not for server backup. - */ - @JsonProperty(value = "geoRedundantBackup") - private GeoRedundantBackup geoRedundantBackup; - - /* - * Max storage allowed for a server. - */ - @JsonProperty(value = "storageMB") - private Integer storageMB; - - /* - * Enable Storage Auto Grow. - */ - @JsonProperty(value = "storageAutogrow") - private StorageAutogrow storageAutogrow; - - /** - * Get the backupRetentionDays property: Backup retention days for the server. - * - * @return the backupRetentionDays value. - */ - public Integer backupRetentionDays() { - return this.backupRetentionDays; - } - - /** - * Set the backupRetentionDays property: 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 the geoRedundantBackup property: Enable Geo-redundant or not for server backup. - * - * @return the geoRedundantBackup value. - */ - public GeoRedundantBackup geoRedundantBackup() { - return this.geoRedundantBackup; - } - - /** - * Set the geoRedundantBackup property: Enable Geo-redundant or not for server backup. - * - * @param geoRedundantBackup the geoRedundantBackup value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withGeoRedundantBackup(GeoRedundantBackup geoRedundantBackup) { - this.geoRedundantBackup = geoRedundantBackup; - return this; - } - - /** - * Get the storageMB property: Max storage allowed for a server. - * - * @return the storageMB value. - */ - public Integer storageMB() { - return this.storageMB; - } - - /** - * Set the storageMB property: 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; - } - - /** - * Get the storageAutogrow property: Enable Storage Auto Grow. - * - * @return the storageAutogrow value. - */ - public StorageAutogrow storageAutogrow() { - return this.storageAutogrow; - } - - /** - * Set the storageAutogrow property: Enable Storage Auto Grow. - * - * @param storageAutogrow the storageAutogrow value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withStorageAutogrow(StorageAutogrow storageAutogrow) { - this.storageAutogrow = storageAutogrow; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/TagsObject.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/TagsObject.java deleted file mode 100644 index cd080cecb7c5..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/TagsObject.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Tags object for patch operations. */ -@Fluent -public final class TagsObject { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsObject.class); - - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - private Map tags; - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the TagsObject object itself. - */ - public TagsObject withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VcoreCapability.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VcoreCapability.java new file mode 100644 index 000000000000..a754c8618ed7 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VcoreCapability.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vcores capability. */ +@Immutable +public final class VcoreCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VcoreCapability.class); + + /* + * vCore name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * supported vCores + */ + @JsonProperty(value = "vCores", access = JsonProperty.Access.WRITE_ONLY) + private Long vCores; + + /* + * supported IOPS + */ + @JsonProperty(value = "supportedIops", access = JsonProperty.Access.WRITE_ONLY) + private Long supportedIops; + + /* + * supported memory per vCore in MB + */ + @JsonProperty(value = "supportedMemoryPerVcoreMB", access = JsonProperty.Access.WRITE_ONLY) + private Long supportedMemoryPerVcoreMB; + + /** + * Get the name property: vCore name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the vCores property: supported vCores. + * + * @return the vCores value. + */ + public Long vCores() { + return this.vCores; + } + + /** + * Get the supportedIops property: supported IOPS. + * + * @return the supportedIops value. + */ + public Long supportedIops() { + return this.supportedIops; + } + + /** + * Get the supportedMemoryPerVcoreMB property: supported memory per vCore in MB. + * + * @return the supportedMemoryPerVcoreMB value. + */ + public Long supportedMemoryPerVcoreMB() { + return this.supportedMemoryPerVcoreMB; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRule.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRule.java deleted file mode 100644 index 50dc1696ef5c..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRule.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkRuleInner; - -/** An immutable client-side representation of VirtualNetworkRule. */ -public interface VirtualNetworkRule { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the virtualNetworkSubnetId property: The ARM resource id of the virtual network subnet. - * - * @return the virtualNetworkSubnetId value. - */ - String virtualNetworkSubnetId(); - - /** - * Gets the ignoreMissingVnetServiceEndpoint property: Create firewall rule before the virtual network has vnet - * service endpoint enabled. - * - * @return the ignoreMissingVnetServiceEndpoint value. - */ - Boolean ignoreMissingVnetServiceEndpoint(); - - /** - * Gets the state property: Virtual Network Rule State. - * - * @return the state value. - */ - VirtualNetworkRuleState state(); - - /** - * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkRuleInner object. - * - * @return the inner object. - */ - VirtualNetworkRuleInner innerModel(); - - /** The entirety of the VirtualNetworkRule definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The VirtualNetworkRule definition stages. */ - interface DefinitionStages { - /** The first stage of the VirtualNetworkRule definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the VirtualNetworkRule definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, serverName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @return the next definition stage. - */ - WithCreate withExistingServer(String resourceGroupName, String serverName); - } - /** - * The stage of the VirtualNetworkRule definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithVirtualNetworkSubnetId, DefinitionStages.WithIgnoreMissingVnetServiceEndpoint { - /** - * Executes the create request. - * - * @return the created resource. - */ - VirtualNetworkRule create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - VirtualNetworkRule create(Context context); - } - /** The stage of the VirtualNetworkRule definition allowing to specify virtualNetworkSubnetId. */ - interface WithVirtualNetworkSubnetId { - /** - * Specifies the virtualNetworkSubnetId property: The ARM resource id of the virtual network subnet.. - * - * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. - * @return the next definition stage. - */ - WithCreate withVirtualNetworkSubnetId(String virtualNetworkSubnetId); - } - /** The stage of the VirtualNetworkRule definition allowing to specify ignoreMissingVnetServiceEndpoint. */ - interface WithIgnoreMissingVnetServiceEndpoint { - /** - * Specifies the ignoreMissingVnetServiceEndpoint property: Create firewall rule before the virtual network - * has vnet service endpoint enabled.. - * - * @param ignoreMissingVnetServiceEndpoint Create firewall rule before the virtual network has vnet service - * endpoint enabled. - * @return the next definition stage. - */ - WithCreate withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint); - } - } - /** - * Begins update for the VirtualNetworkRule resource. - * - * @return the stage of resource update. - */ - VirtualNetworkRule.Update update(); - - /** The template for VirtualNetworkRule update. */ - interface Update - extends UpdateStages.WithVirtualNetworkSubnetId, UpdateStages.WithIgnoreMissingVnetServiceEndpoint { - /** - * Executes the update request. - * - * @return the updated resource. - */ - VirtualNetworkRule apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - VirtualNetworkRule apply(Context context); - } - /** The VirtualNetworkRule update stages. */ - interface UpdateStages { - /** The stage of the VirtualNetworkRule update allowing to specify virtualNetworkSubnetId. */ - interface WithVirtualNetworkSubnetId { - /** - * Specifies the virtualNetworkSubnetId property: The ARM resource id of the virtual network subnet.. - * - * @param virtualNetworkSubnetId The ARM resource id of the virtual network subnet. - * @return the next definition stage. - */ - Update withVirtualNetworkSubnetId(String virtualNetworkSubnetId); - } - /** The stage of the VirtualNetworkRule update allowing to specify ignoreMissingVnetServiceEndpoint. */ - interface WithIgnoreMissingVnetServiceEndpoint { - /** - * Specifies the ignoreMissingVnetServiceEndpoint property: Create firewall rule before the virtual network - * has vnet service endpoint enabled.. - * - * @param ignoreMissingVnetServiceEndpoint Create firewall rule before the virtual network has vnet service - * endpoint enabled. - * @return the next definition stage. - */ - Update withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - VirtualNetworkRule refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - VirtualNetworkRule refresh(Context context); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRuleListResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRuleListResult.java deleted file mode 100644 index f2d7a6e04f43..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRuleListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of virtual network rules. */ -@Immutable -public final class VirtualNetworkRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRuleListResult.class); - - /* - * Array of results. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Link to retrieve next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: Array of results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRuleState.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRuleState.java deleted file mode 100644 index 97e25b52c6d7..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRuleState.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** 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/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRules.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRules.java deleted file mode 100644 index 29749f4b28b4..000000000000 --- a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkRules.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.postgresql.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of VirtualNetworkRules. */ -public interface VirtualNetworkRules { - /** - * Gets a virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - VirtualNetworkRule get(String resourceGroupName, String serverName, String virtualNetworkRuleName); - - /** - * Gets a virtual network rule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - Response getWithResponse( - String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context); - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String serverName, String virtualNetworkRuleName); - - /** - * Deletes the virtual network rule with the given name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param virtualNetworkRuleName The name of the virtual network rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String serverName, String virtualNetworkRuleName, Context context); - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - PagedIterable listByServer(String resourceGroupName, String serverName); - - /** - * Gets a list of virtual network rules in a server. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of virtual network rules in a server. - */ - PagedIterable listByServer(String resourceGroupName, String serverName, Context context); - - /** - * Gets a virtual network rule. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - VirtualNetworkRule getById(String id); - - /** - * Gets a virtual network rule. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network rule. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the virtual network rule with the given name. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes the virtual network rule with the given name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new VirtualNetworkRule resource. - * - * @param name resource name. - * @return the first stage of the new VirtualNetworkRule definition. - */ - VirtualNetworkRule.DefinitionStages.Blank define(String name); -} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkSubnetUsageParameter.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkSubnetUsageParameter.java new file mode 100644 index 000000000000..b4ecfcdace38 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkSubnetUsageParameter.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual network subnet usage parameter. */ +@Fluent +public final class VirtualNetworkSubnetUsageParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkSubnetUsageParameter.class); + + /* + * Virtual network resource id. + */ + @JsonProperty(value = "virtualNetworkArmResourceId") + private String virtualNetworkArmResourceId; + + /** + * Get the virtualNetworkArmResourceId property: Virtual network resource id. + * + * @return the virtualNetworkArmResourceId value. + */ + public String virtualNetworkArmResourceId() { + return this.virtualNetworkArmResourceId; + } + + /** + * Set the virtualNetworkArmResourceId property: Virtual network resource id. + * + * @param virtualNetworkArmResourceId the virtualNetworkArmResourceId value to set. + * @return the VirtualNetworkSubnetUsageParameter object itself. + */ + public VirtualNetworkSubnetUsageParameter withVirtualNetworkArmResourceId(String virtualNetworkArmResourceId) { + this.virtualNetworkArmResourceId = virtualNetworkArmResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkSubnetUsageResult.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkSubnetUsageResult.java new file mode 100644 index 000000000000..b3dbe1995332 --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkSubnetUsageResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkSubnetUsageResultInner; +import java.util.List; + +/** An immutable client-side representation of VirtualNetworkSubnetUsageResult. */ +public interface VirtualNetworkSubnetUsageResult { + /** + * Gets the delegatedSubnetsUsage property: The delegatedSubnetsUsage property. + * + * @return the delegatedSubnetsUsage value. + */ + List delegatedSubnetsUsage(); + + /** + * Gets the inner com.azure.resourcemanager.postgresql.fluent.models.VirtualNetworkSubnetUsageResultInner object. + * + * @return the inner object. + */ + VirtualNetworkSubnetUsageResultInner innerModel(); +} diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkSubnetUsages.java b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkSubnetUsages.java new file mode 100644 index 000000000000..63b6c9aac64e --- /dev/null +++ b/sdk/postgresql/azure-resourcemanager-postgresql/src/main/java/com/azure/resourcemanager/postgresql/models/VirtualNetworkSubnetUsages.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresql.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualNetworkSubnetUsages. */ +public interface VirtualNetworkSubnetUsages { + /** + * Get virtual network subnet usage for a given vNet resource id. + * + * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual network subnet usage for a given vNet resource id. + */ + VirtualNetworkSubnetUsageResult execute(String locationName, VirtualNetworkSubnetUsageParameter parameters); + + /** + * Get virtual network subnet usage for a given vNet resource id. + * + * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual network subnet usage for a given vNet resource id. + */ + Response executeWithResponse( + String locationName, VirtualNetworkSubnetUsageParameter parameters, Context context); +}