diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md index c8ce8350e78a..54c7aa3f0a7d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2023-11-08) + +- 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-flexibleserver-2023-06-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md index 3b0f1c0eeaab..4218424190ed 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/README.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/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-flexibleserver-2022-12-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-flexibleserver-2023-06-01-preview. 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-postgresqlflexibleserver - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -117,7 +117,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md index 2477fd0dc9bc..02705949b740 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/SAMPLE.md @@ -42,6 +42,11 @@ - [Get](#firewallrules_get) - [ListByServer](#firewallrules_listbyserver) +## FlexibleServer + +- [StartLtrBackup](#flexibleserver_startltrbackup) +- [TriggerLtrPreBackup](#flexibleserver_triggerltrprebackup) + ## GetPrivateDnsZoneSuffix - [Execute](#getprivatednszonesuffix_execute) @@ -50,14 +55,64 @@ - [Execute](#locationbasedcapabilities_execute) +## LogFiles + +- [ListByServer](#logfiles_listbyserver) + +## LtrBackupOperations + +- [Get](#ltrbackupoperations_get) +- [ListByServer](#ltrbackupoperations_listbyserver) + +## Migrations + +- [Create](#migrations_create) +- [Delete](#migrations_delete) +- [Get](#migrations_get) +- [ListByTargetServer](#migrations_listbytargetserver) +- [Update](#migrations_update) + ## Operations - [List](#operations_list) +## PrivateEndpointConnectionOperation + +- [Delete](#privateendpointconnectionoperation_delete) +- [Update](#privateendpointconnectionoperation_update) + +## PrivateEndpointConnections + +- [Get](#privateendpointconnections_get) +- [ListByServer](#privateendpointconnections_listbyserver) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [ListByServer](#privatelinkresources_listbyserver) + +## QuotaUsages + +- [List](#quotausages_list) + ## Replicas - [ListByServer](#replicas_listbyserver) +## ResourceProvider + +- [CheckMigrationNameAvailability](#resourceprovider_checkmigrationnameavailability) + +## ServerCapabilities + +- [List](#servercapabilities_list) + +## ServerThreatProtectionSettings + +- [CreateOrUpdate](#serverthreatprotectionsettings_createorupdate) +- [Get](#serverthreatprotectionsettings_get) +- [ListByServer](#serverthreatprotectionsettings_listbyserver) + ## Servers - [Create](#servers_create) @@ -70,6 +125,14 @@ - [Stop](#servers_stop) - [Update](#servers_update) +## VirtualEndpoints + +- [Create](#virtualendpoints_create) +- [Delete](#virtualendpoints_delete) +- [Get](#virtualendpoints_get) +- [ListByServer](#virtualendpoints_listbyserver) +- [Update](#virtualendpoints_update) + ## VirtualNetworkSubnetUsage - [Execute](#virtualnetworksubnetusage_execute) @@ -81,7 +144,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; /** Samples for Administrators Create. */ public final class AdministratorsCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorAdd.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorAdd.json */ /** * Sample code: Adds an Active DIrectory Administrator for the server. @@ -108,7 +171,7 @@ public final class AdministratorsCreateSamples { /** Samples for Administrators Delete. */ public final class AdministratorsDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorDelete.json */ /** * Sample code: AdministratorDelete. @@ -130,7 +193,7 @@ public final class AdministratorsDeleteSamples { /** Samples for Administrators Get. */ public final class AdministratorsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorGet.json */ /** * Sample code: ServerGet. @@ -152,7 +215,7 @@ public final class AdministratorsGetSamples { /** Samples for Administrators ListByServer. */ public final class AdministratorsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorsListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorsListByServer.json */ /** * Sample code: AdministratorsListByServer. @@ -172,7 +235,7 @@ public final class AdministratorsListByServerSamples { /** Samples for Backups Get. */ public final class BackupsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/BackupGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupGet.json */ /** * Sample code: Get a backup for a server. @@ -195,7 +258,7 @@ public final class BackupsGetSamples { /** Samples for Backups ListByServer. */ public final class BackupsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/BackupListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupListByServer.json */ /** * Sample code: List backups for a server. @@ -217,7 +280,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvaila /** Samples for CheckNameAvailability Execute. */ public final class CheckNameAvailabilityExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CheckNameAvailability.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailability.json */ /** * Sample code: NameAvailability. @@ -244,7 +307,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvaila /** Samples for CheckNameAvailabilityWithLocation Execute. */ public final class CheckNameAvailabilityWithLocationExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CheckNameAvailabilityLocationBased.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailabilityLocationBased.json */ /** * Sample code: NameAvailability. @@ -270,7 +333,7 @@ public final class CheckNameAvailabilityWithLocationExecuteSamples { /** Samples for Configurations Get. */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationGet.json */ /** * Sample code: ConfigurationGet. @@ -291,7 +354,7 @@ public final class ConfigurationsGetSamples { /** Samples for Configurations ListByServer. */ public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationListByServer.json */ /** * Sample code: ConfigurationList. @@ -310,7 +373,7 @@ public final class ConfigurationsListByServerSamples { /** Samples for Configurations Put. */ public final class ConfigurationsPutSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. @@ -338,7 +401,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; /** Samples for Configurations Update. */ public final class ConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. @@ -363,7 +426,7 @@ public final class ConfigurationsUpdateSamples { /** Samples for Databases Create. */ public final class DatabasesCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabaseCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseCreate.json */ /** * Sample code: Create a database. @@ -388,7 +451,7 @@ public final class DatabasesCreateSamples { /** Samples for Databases Delete. */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabaseDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseDelete.json */ /** * Sample code: Delete a database. @@ -407,7 +470,7 @@ public final class DatabasesDeleteSamples { /** Samples for Databases Get. */ public final class DatabasesGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabaseGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseGet.json */ /** * Sample code: Get a database. @@ -426,7 +489,7 @@ public final class DatabasesGetSamples { /** Samples for Databases ListByServer. */ public final class DatabasesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabasesListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabasesListByServer.json */ /** * Sample code: List databases in a server. @@ -446,7 +509,7 @@ public final class DatabasesListByServerSamples { /** Samples for FirewallRules CreateOrUpdate. */ public final class FirewallRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleCreate.json */ /** * Sample code: FirewallRuleCreate. @@ -466,138 +529,914 @@ public final class FirewallRulesCreateOrUpdateSamples { } ``` -### FirewallRules_Delete +### FirewallRules_Delete + +```java +/** Samples for FirewallRules Delete. */ +public final class FirewallRulesDeleteSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleDelete.json + */ + /** + * Sample code: FirewallRuleDelete. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void firewallRuleDelete( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.firewallRules().delete("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallRules_Get + +```java +/** Samples for FirewallRules Get. */ +public final class FirewallRulesGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleGet.json + */ + /** + * Sample code: FirewallRuleList. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.firewallRules().getWithResponse("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallRules_ListByServer + +```java +/** Samples for FirewallRules ListByServer. */ +public final class FirewallRulesListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleListByServer.json + */ + /** + * Sample code: FirewallRuleList. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.firewallRules().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); + } +} +``` + +### FlexibleServer_StartLtrBackup + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; +import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest; +import java.util.Arrays; + +/** Samples for FlexibleServer StartLtrBackup. */ +public final class FlexibleServerStartLtrBackupSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionBackup.json + */ + /** + * Sample code: Sample_ExecuteBackup. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void sampleExecuteBackup( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .flexibleServers() + .startLtrBackup( + "rgLongTermRetention", + "pgsqlltrtestserver", + new LtrBackupRequest() + .withBackupSettings(new BackupSettings().withBackupName("backup1")) + .withTargetDetails(new BackupStoreDetails().withSasUriList(Arrays.asList("sasuri"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### FlexibleServer_TriggerLtrPreBackup + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; + +/** Samples for FlexibleServer TriggerLtrPreBackup. */ +public final class FlexibleServerTriggerLtrPreBackupSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionPreBackup.json + */ + /** + * Sample code: Sample_Prebackup. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void samplePrebackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .flexibleServers() + .triggerLtrPreBackupWithResponse( + "rgLongTermRetention", + "pgsqlltrtestserver", + new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")), + com.azure.core.util.Context.NONE); + } +} +``` + +### GetPrivateDnsZoneSuffix_Execute + +```java +/** Samples for GetPrivateDnsZoneSuffix Execute. */ +public final class GetPrivateDnsZoneSuffixExecuteSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json + */ + /** + * Sample code: GetPrivateDnsZoneSuffix. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getPrivateDnsZoneSuffix( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### LocationBasedCapabilities_Execute + +```java +/** Samples for LocationBasedCapabilities Execute. */ +public final class LocationBasedCapabilitiesExecuteSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CapabilitiesByLocation.json + */ + /** + * Sample code: CapabilitiesList. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void capabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.locationBasedCapabilities().execute("westus", com.azure.core.util.Context.NONE); + } +} +``` + +### LogFiles_ListByServer + +```java +/** Samples for LogFiles ListByServer. */ +public final class LogFilesListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LogFilesListByServer.json + */ + /** + * Sample code: List all server log files for a server. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void listAllServerLogFilesForAServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.logFiles().listByServer("testrg", "postgresqltestsvc1", com.azure.core.util.Context.NONE); + } +} +``` + +### LtrBackupOperations_Get + +```java +/** Samples for LtrBackupOperations Get. */ +public final class LtrBackupOperationsGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationGet.json + */ + /** + * Sample code: Sample. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void sample(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .ltrBackupOperations() + .getWithResponse("rgLongTermRetention", "pgsqlltrtestserver", "backup1", com.azure.core.util.Context.NONE); + } +} +``` + +### LtrBackupOperations_ListByServer + +```java +/** Samples for LtrBackupOperations ListByServer. */ +public final class LtrBackupOperationsListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationListByServer.json + */ + /** + * Sample code: Sample List of Long Tern Retention Operations by Flexible Server. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void sampleListOfLongTernRetentionOperationsByFlexibleServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .ltrBackupOperations() + .listByServer("rgLongTermRetention", "pgsqlltrtestserver", com.azure.core.util.Context.NONE); + } +} +``` + +### Migrations_Create + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.AdminCredentials; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationOption; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SourceType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode; +import java.util.Arrays; + +/** Samples for Migrations Create. */ +public final class MigrationsCreateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Validate_Only.json + */ + /** + * Sample code: Create Pre-migration Validation. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void createPreMigrationValidation( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withMigrationOption(MigrationOption.VALIDATE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters( + new MigrationSecretParameters() + .withAdminCredentials( + new AdminCredentials() + .withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_With_Other_Users.json + */ + /** + * Sample code: Migrations Create by passing user names. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsCreateByPassingUserNames( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters( + new MigrationSecretParameters() + .withAdminCredentials( + new AdminCredentials() + .withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder")) + .withSourceServerUsername("newadmin@testsource") + .withTargetServerUsername("targetadmin")) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .create(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create.json + */ + /** + * Sample code: Migrations_Create. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters( + new MigrationSecretParameters() + .withAdminCredentials( + new AdminCredentials() + .withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json + */ + /** + * Sample code: Create Migration with other source types for Validate and Migrate. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void createMigrationWithOtherSourceTypesForValidateAndMigrate( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withMigrationOption(MigrationOption.VALIDATE_AND_MIGRATE) + .withSourceType(SourceType.ON_PREMISES) + .withSslMode(SslMode.PREFER) + .withSourceDbServerResourceId("testsource:5432@pguser") + .withSecretParameters( + new MigrationSecretParameters() + .withAdminCredentials( + new AdminCredentials() + .withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); + } +} +``` + +### Migrations_Delete + +```java +/** Samples for Migrations Delete. */ +public final class MigrationsDeleteSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Delete.json + */ + /** + * Sample code: Migrations_Delete. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .deleteWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigration", + com.azure.core.util.Context.NONE); + } +} +``` + +### Migrations_Get + +```java +/** Samples for Migrations Get. */ +public final class MigrationsGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json + */ + /** + * Sample code: Migrations_GetMigrationWithSuccessfulValidationOnly. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithSuccessfulValidationOnly( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigrationwithsuccessfulvalidationonly", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Get.json + */ + /** + * Sample code: Migrations_Get. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigration", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json + */ + /** + * Sample code: Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithSuccessfulValidationButMigrationFailure( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigrationwithsuccessfulvalidationbutmigrationfailure", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json + */ + /** + * Sample code: Migrations_GetMigrationWithSuccessfulValidationAndMigration. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithSuccessfulValidationAndMigration( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigrationwithsuccessfulvalidationandmigration", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json + */ + /** + * Sample code: Migrations_GetMigrationWithValidationFailures. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithValidationFailures( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigrationwithvalidationfailure", + com.azure.core.util.Context.NONE); + } +} +``` + +### Migrations_ListByTargetServer + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter; + +/** Samples for Migrations ListByTargetServer. */ +public final class MigrationsListByTargetServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_ListByTargetServer.json + */ + /** + * Sample code: Migrations_ListByTargetServer. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsListByTargetServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .listByTargetServer( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + MigrationListFilter.ALL, + com.azure.core.util.Context.NONE); + } +} +``` + +### Migrations_Update + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResource; + +/** Samples for Migrations Update. */ +public final class MigrationsUpdateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Cancel.json + */ + /** + * Sample code: Cancel migration. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void cancelMigration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + MigrationResource resource = + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigration", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withCancel(CancelEnum.TRUE).apply(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Update.json + */ + /** + * Sample code: Migrations_Update. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + MigrationResource resource = + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigration", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSetupLogicalReplicationOnSourceDbIfNeeded(LogicalReplicationOnSourceDbEnum.TRUE).apply(); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/OperationList.json + */ + /** + * Sample code: OperationList. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void operationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnectionOperation_Delete + +```java +/** Samples for PrivateEndpointConnectionOperation Delete. */ +public final class PrivateEndpointConnectionOperationDeleteSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .privateEndpointConnectionOperations() + .delete( + "Default", + "test-svr", + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnectionOperation_Update + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnectionOperation Update. */ +public final class PrivateEndpointConnectionOperationUpdateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .privateEndpointConnectionOperations() + .update( + "Default", + "test-svr", + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", + new PrivateEndpointConnectionInner() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com")), + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "Default", + "test-svr", + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByServer + +```java +/** Samples for PrivateEndpointConnections ListByServer. */ +public final class PrivateEndpointConnectionsListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: Gets list of private endpoint connections on a server. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getsListOfPrivateEndpointConnectionsOnAServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.privateEndpointConnections().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesGet.json + */ + /** + * Sample code: Gets a private link resource for PostgreSQL. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getsAPrivateLinkResourceForPostgreSQL( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.privateLinkResources().getWithResponse("Default", "test-svr", "plr", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_ListByServer + +```java +/** Samples for PrivateLinkResources ListByServer. */ +public final class PrivateLinkResourcesListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesList.json + */ + /** + * Sample code: Gets private link resources for PostgreSQL. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getsPrivateLinkResourcesForPostgreSQL( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.privateLinkResources().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); + } +} +``` + +### QuotaUsages_List ```java -/** Samples for FirewallRules Delete. */ -public final class FirewallRulesDeleteSamples { +/** Samples for QuotaUsages List. */ +public final class QuotaUsagesListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/QuotaUsagesForFlexibleServers.json */ /** - * Sample code: FirewallRuleDelete. + * Sample code: List of quota usages for flexible servers. * * @param manager Entry point to PostgreSqlManager. */ - public static void firewallRuleDelete( + public static void listOfQuotaUsagesForFlexibleServers( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.firewallRules().delete("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); + manager.quotaUsages().list("westus", com.azure.core.util.Context.NONE); } } ``` -### FirewallRules_Get +### Replicas_ListByServer ```java -/** Samples for FirewallRules Get. */ -public final class FirewallRulesGetSamples { +/** Samples for Replicas ListByServer. */ +public final class ReplicasListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ReplicasListByServer.json */ /** - * Sample code: FirewallRuleList. + * Sample code: ReplicasListByServer. * * @param manager Entry point to PostgreSqlManager. */ - public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.firewallRules().getWithResponse("testrg", "testserver", "rule1", com.azure.core.util.Context.NONE); + public static void replicasListByServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.replicas().listByServer("testrg", "sourcepgservername", com.azure.core.util.Context.NONE); } } ``` -### FirewallRules_ListByServer +### ResourceProvider_CheckMigrationNameAvailability ```java -/** Samples for FirewallRules ListByServer. */ -public final class FirewallRulesListByServerSamples { +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; + +/** Samples for ResourceProvider CheckMigrationNameAvailability. */ +public final class ResourceProviderCheckMigrationNameAvailabilitySamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckMigrationNameAvailability.json */ /** - * Sample code: FirewallRuleList. + * Sample code: CheckMigrationNameAvailability. * * @param manager Entry point to PostgreSqlManager. */ - public static void firewallRuleList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.firewallRules().listByServer("testrg", "testserver", com.azure.core.util.Context.NONE); + public static void checkMigrationNameAvailability( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .resourceProviders() + .checkMigrationNameAvailabilityWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + new MigrationNameAvailabilityResourceInner() + .withName("name1") + .withType("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + com.azure.core.util.Context.NONE); } } ``` -### GetPrivateDnsZoneSuffix_Execute +### ServerCapabilities_List ```java -/** Samples for GetPrivateDnsZoneSuffix Execute. */ -public final class GetPrivateDnsZoneSuffixExecuteSamples { +/** Samples for ServerCapabilities List. */ +public final class ServerCapabilitiesListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCapabilities.json */ /** - * Sample code: GetPrivateDnsZoneSuffix. + * Sample code: ServerCapabilitiesList. * * @param manager Entry point to PostgreSqlManager. */ - public static void getPrivateDnsZoneSuffix( + public static void serverCapabilitiesList( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE); + manager.serverCapabilities().list("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); } } ``` -### LocationBasedCapabilities_Execute +### ServerThreatProtectionSettings_CreateOrUpdate ```java -/** Samples for LocationBasedCapabilities Execute. */ -public final class LocationBasedCapabilitiesExecuteSamples { +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; + +/** Samples for ServerThreatProtectionSettings CreateOrUpdate. */ +public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CapabilitiesByLocation.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsCreate.json */ /** - * Sample code: CapabilitiesList. + * Sample code: Update a server's Threat Protection settings. * * @param manager Entry point to PostgreSqlManager. */ - public static void capabilitiesList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.locationBasedCapabilities().execute("westus", com.azure.core.util.Context.NONE); + public static void updateAServerSThreatProtectionSettings( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + ServerThreatProtectionSettingsModel resource = + manager + .serverThreatProtectionSettings() + .getWithResponse( + "threatprotection-4799", + "threatprotection-6440", + ThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withState(ThreatProtectionState.ENABLED).apply(); } } ``` -### Operations_List +### ServerThreatProtectionSettings_Get ```java -/** Samples for Operations List. */ -public final class OperationsListSamples { +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; + +/** Samples for ServerThreatProtectionSettings Get. */ +public final class ServerThreatProtectionSettingsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/OperationList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsGet.json */ /** - * Sample code: OperationList. + * Sample code: Get a server's Threat Protection settings. * * @param manager Entry point to PostgreSqlManager. */ - public static void operationList(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + public static void getAServerSThreatProtectionSettings( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .serverThreatProtectionSettings() + .getWithResponse( + "threatprotection-6852", + "threatprotection-2080", + ThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE); } } ``` -### Replicas_ListByServer +### ServerThreatProtectionSettings_ListByServer ```java -/** Samples for Replicas ListByServer. */ -public final class ReplicasListByServerSamples { +/** Samples for ServerThreatProtectionSettings ListByServer. */ +public final class ServerThreatProtectionSettingsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ReplicasListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsListByServer.json */ /** - * Sample code: ReplicasListByServer. + * Sample code: Get a server's Advanced Threat Protection settings. * * @param manager Entry point to PostgreSqlManager. */ - public static void replicasListByServer( + public static void getAServerSAdvancedThreatProtectionSettings( com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { - manager.replicas().listByServer("testrg", "sourcepgservername", com.azure.core.util.Context.NONE); + manager + .serverThreatProtectionSettings() + .listByServer("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); } } ``` @@ -608,6 +1447,7 @@ public final class ReplicasListByServerSamples { import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAuthEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyType; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; +import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; @@ -621,6 +1461,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow; import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; import java.time.OffsetDateTime; @@ -630,7 +1471,7 @@ import java.util.Map; /** Samples for Servers Create. */ public final class ServersCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json */ /** * Sample code: ServerCreateWithDataEncryptionEnabled. @@ -656,12 +1497,14 @@ public final class ServersCreateSamples { .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("password") .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512)) + .withStorage(new Storage().withStorageSizeGB(512).withAutoGrow(StorageAutoGrow.DISABLED)) .withDataEncryption( new DataEncryption() .withPrimaryKeyUri("fakeTokenPlaceholder") .withPrimaryUserAssignedIdentityId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId("") .withType(ArmServerKeyType.AZURE_KEY_VAULT)) .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) .withNetwork( @@ -677,7 +1520,29 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateGeoRestore.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReviveDropped.json + */ + /** + * Sample code: ServerCreateReviveDropped. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void serverCreateReviveDropped( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .servers() + .define("pgtestsvc5-rev") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withSourceServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5") + .withPointInTimeUtc(OffsetDateTime.parse("2023-04-27T00:04:59.4078005+00:00")) + .withCreateMode(CreateMode.REVIVE_DROPPED) + .create(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ /** * Sample code: Create a database as a geo-restore in geo-paired location. @@ -691,6 +1556,24 @@ public final class ServersCreateSamples { .define("pgtestsvc5geo") .withRegion("eastus") .withExistingResourceGroup("testrg") + .withIdentity( + new UserAssignedIdentity() + .withUserAssignedIdentities( + mapOf( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity", + new UserIdentity(), + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", + new UserIdentity())) + .withType(IdentityType.USER_ASSIGNED)) + .withDataEncryption( + new DataEncryption() + .withPrimaryKeyUri("fakeTokenPlaceholder") + .withPrimaryUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity") + .withType(ArmServerKeyType.AZURE_KEY_VAULT)) .withSourceServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) @@ -699,7 +1582,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreate.json */ /** * Sample code: Create a new server. @@ -717,7 +1600,11 @@ public final class ServersCreateSamples { .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("password") .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512)) + .withStorage( + new Storage() + .withStorageSizeGB(512) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P20)) .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) .withNetwork( new Network() @@ -732,7 +1619,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithAadAuthEnabled.json */ /** * Sample code: Create a new server with active directory authentication enabled. @@ -751,7 +1638,11 @@ public final class ServersCreateSamples { .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("password") .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512)) + .withStorage( + new Storage() + .withStorageSizeGB(512) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P20)) .withAuthConfig( new AuthConfig() .withActiveDirectoryAuth(ActiveDirectoryAuthEnum.ENABLED) @@ -772,7 +1663,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateReplica.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReplica.json */ /** * Sample code: ServerCreateReplica. @@ -786,6 +1677,21 @@ public final class ServersCreateSamples { .define("pgtestsvc5rep") .withRegion("westus") .withExistingResourceGroup("testrg") + .withIdentity( + new UserAssignedIdentity() + .withUserAssignedIdentities( + mapOf( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", + new UserIdentity())) + .withType(IdentityType.USER_ASSIGNED)) + .withDataEncryption( + new DataEncryption() + .withPrimaryKeyUri("fakeTokenPlaceholder") + .withPrimaryUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId("") + .withType(ArmServerKeyType.AZURE_KEY_VAULT)) .withSourceServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) @@ -794,7 +1700,7 @@ public final class ServersCreateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreatePointInTimeRestore.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreatePointInTimeRestore.json */ /** * Sample code: Create a database as a point in time restore. @@ -835,7 +1741,7 @@ public final class ServersCreateSamples { /** Samples for Servers Delete. */ public final class ServersDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerDelete.json */ /** * Sample code: ServerDelete. @@ -854,7 +1760,20 @@ public final class ServersDeleteSamples { /** Samples for Servers GetByResourceGroup. */ public final class ServersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithPrivateEndpoints.json + */ + /** + * Sample code: ServerGetWithPrivateEndpoints. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void serverGetWithPrivateEndpoints( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc2", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGet.json */ /** * Sample code: ServerGet. @@ -866,7 +1785,7 @@ public final class ServersGetByResourceGroupSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerGetWithVnet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithVnet.json */ /** * Sample code: ServerGetWithVnet. @@ -885,7 +1804,7 @@ public final class ServersGetByResourceGroupSamples { /** Samples for Servers List. */ public final class ServersListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerList.json */ /** * Sample code: ServerList. @@ -904,7 +1823,7 @@ public final class ServersListSamples { /** Samples for Servers ListByResourceGroup. */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerListByResourceGroup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerListByResourceGroup.json */ /** * Sample code: ServerListByResourceGroup. @@ -927,7 +1846,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParamete /** Samples for Servers Restart. */ public final class ServersRestartSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerRestart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestart.json */ /** * Sample code: ServerRestart. @@ -939,7 +1858,7 @@ public final class ServersRestartSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerRestartWithFailover.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestartWithFailover.json */ /** * Sample code: ServerRestartWithFailover. @@ -965,7 +1884,7 @@ public final class ServersRestartSamples { /** Samples for Servers Start. */ public final class ServersStartSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerStart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStart.json */ /** * Sample code: ServerStart. @@ -984,7 +1903,7 @@ public final class ServersStartSamples { /** Samples for Servers Stop. */ public final class ServersStopSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerStop.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStop.json */ /** * Sample code: ServerStop. @@ -1003,17 +1922,22 @@ public final class ServersStopSamples { import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAuthEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyType; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; +import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordAuthEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption; import com.azure.resourcemanager.postgresqlflexibleserver.models.Server; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow; import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; import java.util.HashMap; @@ -1022,7 +1946,7 @@ import java.util.Map; /** Samples for Servers Update. */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithAadAuthEnabled.json */ /** * Sample code: ServerUpdateWithAadAuthEnabled. @@ -1040,7 +1964,11 @@ public final class ServersUpdateSamples { .update() .withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLoginPassword("newpassword") - .withStorage(new Storage().withStorageSizeGB(1024)) + .withStorage( + new Storage() + .withStorageSizeGB(1024) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P30)) .withBackup(new Backup().withBackupRetentionDays(20)) .withAuthConfig( new AuthConfig() @@ -1052,7 +1980,7 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json */ /** * Sample code: ServerUpdateWithDataEncryptionEnabled. @@ -1073,24 +2001,82 @@ public final class ServersUpdateSamples { new UserAssignedIdentity() .withUserAssignedIdentities( mapOf( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity", + new UserIdentity(), "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", new UserIdentity())) .withType(IdentityType.USER_ASSIGNED)) .withAdministratorLoginPassword("newpassword") - .withStorage(new Storage().withStorageSizeGB(1024)) .withBackup(new Backup().withBackupRetentionDays(20)) .withDataEncryption( new DataEncryption() .withPrimaryKeyUri("fakeTokenPlaceholder") .withPrimaryUserAssignedIdentityId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity") .withType(ArmServerKeyType.AZURE_KEY_VAULT)) .withCreateMode(CreateModeForUpdate.UPDATE) .apply(); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json + */ + /** + * Sample code: SwitchOver a replica server as planned, i.e. it will wait for replication to complete before + * promoting replica as Primary and original primary as replica. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = + manager + .servers() + .getByResourceGroupWithResponse( + "testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withReplica( + new Replica() + .withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER) + .withPromoteOption(ReplicationPromoteOption.PLANNED)) + .apply(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedSwitchover.json + */ + /** + * Sample code: SwitchOver a replica server as forced, i.e. it will replica as Primary and original primary as + * replica immediately without waiting for primary and replica to be in sync. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = + manager + .servers() + .getByResourceGroupWithResponse( + "testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withReplica( + new Replica() + .withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER) + .withPromoteOption(ReplicationPromoteOption.FORCED)) + .apply(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdate.json */ /** * Sample code: ServerUpdate. @@ -1107,14 +2093,18 @@ public final class ServersUpdateSamples { .update() .withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLoginPassword("newpassword") - .withStorage(new Storage().withStorageSizeGB(1024)) + .withStorage( + new Storage() + .withStorageSizeGB(1024) + .withAutoGrow(StorageAutoGrow.ENABLED) + .withTier(AzureManagedDiskPerformanceTiers.P30)) .withBackup(new Backup().withBackupRetentionDays(20)) .withCreateMode(CreateModeForUpdate.UPDATE) .apply(); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithMajorVersionUpgrade.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json */ /** * Sample code: ServerUpdateWithMajorVersionUpgrade. @@ -1132,7 +2122,7 @@ public final class ServersUpdateSamples { } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: ServerUpdateWithCustomerMaintenanceWindow. @@ -1158,6 +2148,59 @@ public final class ServersUpdateSamples { .apply(); } + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json + */ + /** + * Sample code: Promote a replica server as a Standalone server as forced, i.e. it will promote a replica server + * immediately without waiting for primary and replica to be in sync. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = + manager + .servers() + .getByResourceGroupWithResponse( + "testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withReplica( + new Replica() + .withPromoteMode(ReadReplicaPromoteMode.STANDALONE) + .withPromoteOption(ReplicationPromoteOption.FORCED)) + .apply(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json + */ + /** + * Sample code: Promote a replica server as a Standalone server as planned, i.e. it will wait for replication to + * complete. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = + manager + .servers() + .getByResourceGroupWithResponse( + "testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withReplica( + new Replica() + .withPromoteMode(ReadReplicaPromoteMode.STANDALONE) + .withPromoteOption(ReplicationPromoteOption.PLANNED)) + .apply(); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { @@ -1172,6 +2215,132 @@ public final class ServersUpdateSamples { } ``` +### VirtualEndpoints_Create + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; +import java.util.Arrays; + +/** Samples for VirtualEndpoints Create. */ +public final class VirtualEndpointsCreateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointCreate.json + */ + /** + * Sample code: Create a new virtual endpoint for a flexible server. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void createANewVirtualEndpointForAFlexibleServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .virtualEndpoints() + .define("pgVirtualEndpoint1") + .withExistingFlexibleServer("testrg", "pgtestsvc4") + .withEndpointType(VirtualEndpointType.READ_WRITE) + .withMembers(Arrays.asList("testPrimary1")) + .create(); + } +} +``` + +### VirtualEndpoints_Delete + +```java +/** Samples for VirtualEndpoints Delete. */ +public final class VirtualEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointDelete.json + */ + /** + * Sample code: Delete a virtual endpoint. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void deleteAVirtualEndpoint( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .virtualEndpoints() + .delete("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualEndpoints_Get + +```java +/** Samples for VirtualEndpoints Get. */ +public final class VirtualEndpointsGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsGet.json + */ + /** + * Sample code: Get a virtual endpoint. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getAVirtualEndpoint( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .virtualEndpoints() + .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualEndpoints_ListByServer + +```java +/** Samples for VirtualEndpoints ListByServer. */ +public final class VirtualEndpointsListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsListByServer.json + */ + /** + * Sample code: VirtualEndpointListByServer. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void virtualEndpointListByServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.virtualEndpoints().listByServer("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualEndpoints_Update + +```java +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; +import java.util.Arrays; + +/** Samples for VirtualEndpoints Update. */ +public final class VirtualEndpointsUpdateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointUpdate.json + */ + /** + * Sample code: Update a virtual endpoint for a server to update the. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void updateAVirtualEndpointForAServerToUpdateThe( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + VirtualEndpointResource resource = + manager + .virtualEndpoints() + .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withEndpointType(VirtualEndpointType.READ_WRITE) + .withMembers(Arrays.asList("testReplica1")) + .apply(); + } +} +``` + ### VirtualNetworkSubnetUsage_Execute ```java @@ -1180,7 +2349,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkS /** Samples for VirtualNetworkSubnetUsage Execute. */ public final class VirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/VirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualNetworkSubnetUsage.json */ /** * Sample code: VirtualNetworkSubnetUsageList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml index da70ca0073ad..66481292584a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml @@ -18,7 +18,7 @@ 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-flexibleserver-2022-12-01. + 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-flexibleserver-2023-06-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java index d20e95c7c905..2a99147be2a1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/PostgreSqlManager.java @@ -31,12 +31,24 @@ import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ConfigurationsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.DatabasesImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.FirewallRulesImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.FlexibleServersImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.LocationBasedCapabilitiesImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.LogFilesImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.LtrBackupOperationsImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.MigrationsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.OperationsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PostgreSqlManagementClientBuilder; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionOperationsImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.QuotaUsagesImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ReplicasImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerCapabilitiesImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerThreatProtectionSettingsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersImpl; +import com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualEndpointsImpl; import com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualNetworkSubnetUsagesImpl; import com.azure.resourcemanager.postgresqlflexibleserver.models.Administrators; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backups; @@ -45,11 +57,23 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.Configurations; import com.azure.resourcemanager.postgresqlflexibleserver.models.Databases; import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRules; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServers; import com.azure.resourcemanager.postgresqlflexibleserver.models.GetPrivateDnsZoneSuffixes; import com.azure.resourcemanager.postgresqlflexibleserver.models.LocationBasedCapabilities; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFiles; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupOperations; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Migrations; import com.azure.resourcemanager.postgresqlflexibleserver.models.Operations; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionOperations; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnections; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResources; +import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsages; import com.azure.resourcemanager.postgresqlflexibleserver.models.Replicas; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ResourceProviders; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerCapabilities; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettings; import com.azure.resourcemanager.postgresqlflexibleserver.models.Servers; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpoints; import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsages; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -70,6 +94,8 @@ public final class PostgreSqlManager { private LocationBasedCapabilities locationBasedCapabilities; + private ServerCapabilities serverCapabilities; + private CheckNameAvailabilities checkNameAvailabilities; private CheckNameAvailabilityWithLocations checkNameAvailabilityWithLocations; @@ -82,12 +108,34 @@ public final class PostgreSqlManager { private Servers servers; + private FlexibleServers flexibleServers; + + private LtrBackupOperations ltrBackupOperations; + + private Migrations migrations; + + private ResourceProviders resourceProviders; + private Operations operations; private GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes; + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateEndpointConnectionOperations privateEndpointConnectionOperations; + + private PrivateLinkResources privateLinkResources; + + private QuotaUsages quotaUsages; + private Replicas replicas; + private LogFiles logFiles; + + private ServerThreatProtectionSettings serverThreatProtectionSettings; + + private VirtualEndpoints virtualEndpoints; + private VirtualNetworkSubnetUsages virtualNetworkSubnetUsages; private final PostgreSqlManagementClient clientObject; @@ -255,7 +303,7 @@ public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile p .append("-") .append("com.azure.resourcemanager.postgresqlflexibleserver") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -349,6 +397,18 @@ public LocationBasedCapabilities locationBasedCapabilities() { return locationBasedCapabilities; } + /** + * Gets the resource collection API of ServerCapabilities. + * + * @return Resource collection API of ServerCapabilities. + */ + public ServerCapabilities serverCapabilities() { + if (this.serverCapabilities == null) { + this.serverCapabilities = new ServerCapabilitiesImpl(clientObject.getServerCapabilities(), this); + } + return serverCapabilities; + } + /** * Gets the resource collection API of CheckNameAvailabilities. * @@ -423,6 +483,54 @@ public Servers servers() { return servers; } + /** + * Gets the resource collection API of FlexibleServers. + * + * @return Resource collection API of FlexibleServers. + */ + public FlexibleServers flexibleServers() { + if (this.flexibleServers == null) { + this.flexibleServers = new FlexibleServersImpl(clientObject.getFlexibleServers(), this); + } + return flexibleServers; + } + + /** + * Gets the resource collection API of LtrBackupOperations. + * + * @return Resource collection API of LtrBackupOperations. + */ + public LtrBackupOperations ltrBackupOperations() { + if (this.ltrBackupOperations == null) { + this.ltrBackupOperations = new LtrBackupOperationsImpl(clientObject.getLtrBackupOperations(), this); + } + return ltrBackupOperations; + } + + /** + * Gets the resource collection API of Migrations. It manages MigrationResource. + * + * @return Resource collection API of Migrations. + */ + public Migrations migrations() { + if (this.migrations == null) { + this.migrations = new MigrationsImpl(clientObject.getMigrations(), this); + } + return migrations; + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + /** * Gets the resource collection API of Operations. * @@ -448,6 +556,57 @@ public GetPrivateDnsZoneSuffixes getPrivateDnsZoneSuffixes() { return getPrivateDnsZoneSuffixes; } + /** + * Gets the resource collection API of PrivateEndpointConnections. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateEndpointConnectionOperations. + * + * @return Resource collection API of PrivateEndpointConnectionOperations. + */ + public PrivateEndpointConnectionOperations privateEndpointConnectionOperations() { + if (this.privateEndpointConnectionOperations == null) { + this.privateEndpointConnectionOperations = + new PrivateEndpointConnectionOperationsImpl( + clientObject.getPrivateEndpointConnectionOperations(), this); + } + return privateEndpointConnectionOperations; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of QuotaUsages. + * + * @return Resource collection API of QuotaUsages. + */ + public QuotaUsages quotaUsages() { + if (this.quotaUsages == null) { + this.quotaUsages = new QuotaUsagesImpl(clientObject.getQuotaUsages(), this); + } + return quotaUsages; + } + /** * Gets the resource collection API of Replicas. * @@ -460,6 +619,44 @@ public Replicas replicas() { return replicas; } + /** + * Gets the resource collection API of LogFiles. + * + * @return Resource collection API of LogFiles. + */ + public LogFiles logFiles() { + if (this.logFiles == null) { + this.logFiles = new LogFilesImpl(clientObject.getLogFiles(), this); + } + return logFiles; + } + + /** + * Gets the resource collection API of ServerThreatProtectionSettings. It manages + * ServerThreatProtectionSettingsModel. + * + * @return Resource collection API of ServerThreatProtectionSettings. + */ + public ServerThreatProtectionSettings serverThreatProtectionSettings() { + if (this.serverThreatProtectionSettings == null) { + this.serverThreatProtectionSettings = + new ServerThreatProtectionSettingsImpl(clientObject.getServerThreatProtectionSettings(), this); + } + return serverThreatProtectionSettings; + } + + /** + * Gets the resource collection API of VirtualEndpoints. It manages VirtualEndpointResource. + * + * @return Resource collection API of VirtualEndpoints. + */ + public VirtualEndpoints virtualEndpoints() { + if (this.virtualEndpoints == null) { + this.virtualEndpoints = new VirtualEndpointsImpl(clientObject.getVirtualEndpoints(), this); + } + return virtualEndpoints; + } + /** * Gets the resource collection API of VirtualNetworkSubnetUsages. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/FlexibleServersClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/FlexibleServersClient.java new file mode 100644 index 000000000000..8c7c5ecaad4e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/FlexibleServersClient.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServersTriggerLtrPreBackupResponse; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; +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 FlexibleServersClient. */ +public interface FlexibleServersClient { + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono triggerLtrPreBackupWithResponseAsync( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters); + + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono triggerLtrPreBackupAsync( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters); + + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlexibleServersTriggerLtrPreBackupResponse triggerLtrPreBackupWithResponse( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters, Context context); + + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LtrPreBackupResponseInner triggerLtrPreBackup( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters); + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> startLtrBackupWithResponseAsync( + String resourceGroupName, String serverName, LtrBackupRequest parameters); + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 {@link PollerFlux} for polling of response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, LtrBackupResponseInner> beginStartLtrBackupAsync( + String resourceGroupName, String serverName, LtrBackupRequest parameters); + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 {@link SyncPoller} for polling of response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LtrBackupResponseInner> beginStartLtrBackup( + String resourceGroupName, String serverName, LtrBackupRequest parameters); + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 the {@link SyncPoller} for polling of response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LtrBackupResponseInner> beginStartLtrBackup( + String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context); + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono startLtrBackupAsync( + String resourceGroupName, String serverName, LtrBackupRequest parameters); + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LtrBackupResponseInner startLtrBackup(String resourceGroupName, String serverName, LtrBackupRequest parameters); + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LtrBackupResponseInner startLtrBackup( + String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LocationBasedCapabilitiesClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LocationBasedCapabilitiesClient.java index a9bd53c69600..26e40020b46b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LocationBasedCapabilitiesClient.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LocationBasedCapabilitiesClient.java @@ -9,7 +9,7 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner; /** An instance of this class provides access to all the operations defined in LocationBasedCapabilitiesClient. */ public interface LocationBasedCapabilitiesClient { @@ -23,7 +23,7 @@ public interface LocationBasedCapabilitiesClient { * @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux executeAsync(String locationName); + PagedFlux executeAsync(String locationName); /** * Get capabilities at specified location in a given subscription. @@ -36,7 +36,7 @@ public interface LocationBasedCapabilitiesClient { * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable execute(String locationName); + PagedIterable execute(String locationName); /** * Get capabilities at specified location in a given subscription. @@ -50,5 +50,5 @@ public interface LocationBasedCapabilitiesClient { * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable execute(String locationName, Context context); + PagedIterable execute(String locationName, Context context); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LogFilesClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LogFilesClient.java new file mode 100644 index 000000000000..695d001bdcc4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LogFilesClient.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner; + +/** An instance of this class provides access to all the operations defined in LogFilesClient. */ +public interface LogFilesClient { + /** + * List all the server 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 logFiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByServerAsync(String resourceGroupName, String serverName); + + /** + * List all the server 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 logFiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * List all the server 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 logFiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LtrBackupOperationsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LtrBackupOperationsClient.java new file mode 100644 index 000000000000..da2f7cfadc19 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/LtrBackupOperationsClient.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LtrBackupOperationsClient. */ +public interface LtrBackupOperationsClient { + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @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 result of the give long term retention backup operation for the flexible server along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String backupName); + + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @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 result of the give long term retention backup operation for the flexible server on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String serverName, String backupName); + + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @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 result of the give long term retention backup operation for the flexible server along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serverName, String backupName, Context context); + + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @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 result of the give long term retention backup operation for the flexible server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LtrServerBackupOperationInner get(String resourceGroupName, String serverName, String backupName); + + /** + * Gets the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByServerAsync(String resourceGroupName, String serverName); + + /** + * Gets the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * Gets the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer( + String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/MigrationsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/MigrationsClient.java new file mode 100644 index 000000000000..7f35bd814f62 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/MigrationsClient.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceForPatch; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MigrationsClient. */ +public interface MigrationsClient { + /** + * Creates a new migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for creating a migration. + * @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 migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceInner parameters); + + /** + * Creates a new migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for creating a migration. + * @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 migration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceInner parameters); + + /** + * Creates a new migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for creating a migration. + * @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 migration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceInner parameters, + Context context); + + /** + * Creates a new migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for creating a migration. + * @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 migration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationResourceInner create( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceInner parameters); + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 details of a migration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName); + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 details of a migration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName); + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 details of a migration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context); + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 details of a migration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationResourceInner get( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName); + + /** + * Updates an existing migration. The request body can contain one to many of the mutable properties present in the + * migration definition. Certain property updates initiate migration state transitions. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for updating a migration. + * @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 migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceForPatch parameters); + + /** + * Updates an existing migration. The request body can contain one to many of the mutable properties present in the + * migration definition. Certain property updates initiate migration state transitions. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for updating a migration. + * @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 migration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceForPatch parameters); + + /** + * Updates an existing migration. The request body can contain one to many of the mutable properties present in the + * migration definition. Certain property updates initiate migration state transitions. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for updating a migration. + * @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 migration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceForPatch parameters, + Context context); + + /** + * Updates an existing migration. The request body can contain one to many of the mutable properties present in the + * migration definition. Certain property updates initiate migration state transitions. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for updating a migration. + * @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 migration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationResourceInner update( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceForPatch parameters); + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName); + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName); + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context); + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName); + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations. + * @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 migration resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByTargetServerAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationListFilter migrationListFilter); + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database 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 migration resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByTargetServerAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName); + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database 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 migration resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTargetServer( + String subscriptionId, String resourceGroupName, String targetDbServerName); + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations. + * @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 migration resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTargetServer( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationListFilter migrationListFilter, + Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java index f4253b4194d8..20bf4159ae69 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PostgreSqlManagementClient.java @@ -10,7 +10,7 @@ /** The interface for PostgreSqlManagementClient class. */ public interface PostgreSqlManagementClient { /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -65,6 +65,13 @@ public interface PostgreSqlManagementClient { */ LocationBasedCapabilitiesClient getLocationBasedCapabilities(); + /** + * Gets the ServerCapabilitiesClient object to access its operations. + * + * @return the ServerCapabilitiesClient object. + */ + ServerCapabilitiesClient getServerCapabilities(); + /** * Gets the CheckNameAvailabilitiesClient object to access its operations. * @@ -107,6 +114,34 @@ public interface PostgreSqlManagementClient { */ ServersClient getServers(); + /** + * Gets the FlexibleServersClient object to access its operations. + * + * @return the FlexibleServersClient object. + */ + FlexibleServersClient getFlexibleServers(); + + /** + * Gets the LtrBackupOperationsClient object to access its operations. + * + * @return the LtrBackupOperationsClient object. + */ + LtrBackupOperationsClient getLtrBackupOperations(); + + /** + * Gets the MigrationsClient object to access its operations. + * + * @return the MigrationsClient object. + */ + MigrationsClient getMigrations(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + /** * Gets the OperationsClient object to access its operations. * @@ -121,6 +156,34 @@ public interface PostgreSqlManagementClient { */ GetPrivateDnsZoneSuffixesClient getGetPrivateDnsZoneSuffixes(); + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateEndpointConnectionOperationsClient object to access its operations. + * + * @return the PrivateEndpointConnectionOperationsClient object. + */ + PrivateEndpointConnectionOperationsClient getPrivateEndpointConnectionOperations(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the QuotaUsagesClient object to access its operations. + * + * @return the QuotaUsagesClient object. + */ + QuotaUsagesClient getQuotaUsages(); + /** * Gets the ReplicasClient object to access its operations. * @@ -128,6 +191,27 @@ public interface PostgreSqlManagementClient { */ ReplicasClient getReplicas(); + /** + * Gets the LogFilesClient object to access its operations. + * + * @return the LogFilesClient object. + */ + LogFilesClient getLogFiles(); + + /** + * Gets the ServerThreatProtectionSettingsClient object to access its operations. + * + * @return the ServerThreatProtectionSettingsClient object. + */ + ServerThreatProtectionSettingsClient getServerThreatProtectionSettings(); + + /** + * Gets the VirtualEndpointsClient object to access its operations. + * + * @return the VirtualEndpointsClient object. + */ + VirtualEndpointsClient getVirtualEndpoints(); + /** * Gets the VirtualNetworkSubnetUsagesClient object to access its operations. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PrivateEndpointConnectionOperationsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PrivateEndpointConnectionOperationsClient.java new file mode 100644 index 000000000000..6d8cd4ea56c7 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PrivateEndpointConnectionOperationsClient.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +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 PrivateEndpointConnectionOperationsClient. + */ +public interface PrivateEndpointConnectionOperationsClient { + /** + * 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync( + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PrivateEndpointConnectionInner> beginUpdateAsync( + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginUpdate( + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginUpdate( + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync( + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner update( + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner update( + 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 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync( + 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 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync( + 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 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PrivateEndpointConnectionsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..3e40ed5815e0 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import reactor.core.publisher.Mono; + +/** 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync( + 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. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync( + 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serverName, String privateEndpointConnectionName, 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 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 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByServerAsync(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. + * @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer( + String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PrivateLinkResourcesClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..080eb5684421 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import reactor.core.publisher.Mono; + +/** 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByServerAsync(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. + * @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync( + 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. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serverName, String groupName, 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); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/QuotaUsagesClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/QuotaUsagesClient.java new file mode 100644 index 000000000000..f9a978a97761 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/QuotaUsagesClient.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.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; + +/** An instance of this class provides access to all the operations defined in QuotaUsagesClient. */ +public interface QuotaUsagesClient { + /** + * Get quota usages 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 quota usages at specified location in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String locationName); + + /** + * Get quota usages 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 quota usages at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String locationName); + + /** + * Get quota usages 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 quota usages at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String locationName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ResourceProvidersClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ResourceProvidersClient.java new file mode 100644 index 000000000000..5edf25d9e7ff --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ResourceProvidersClient.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @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 migration name's availability along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> checkMigrationNameAvailabilityWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters); + + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @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 migration name's availability on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono checkMigrationNameAvailabilityAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters); + + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @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 migration name's availability along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkMigrationNameAvailabilityWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters, + Context context); + + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @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 migration name's availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationNameAvailabilityResourceInner checkMigrationNameAvailability( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ServerCapabilitiesClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ServerCapabilitiesClient.java new file mode 100644 index 000000000000..9c48b8acce17 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ServerCapabilitiesClient.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner; + +/** An instance of this class provides access to all the operations defined in ServerCapabilitiesClient. */ +public interface ServerCapabilitiesClient { + /** + * Get capabilities for a flexible 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 capabilities for a flexible server as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String serverName); + + /** + * Get capabilities for a flexible 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 capabilities for a flexible server as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName); + + /** + * Get capabilities for a flexible 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 capabilities for a flexible server as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ServerThreatProtectionSettingsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ServerThreatProtectionSettingsClient.java new file mode 100644 index 000000000000..a9044c6125d5 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/ServerThreatProtectionSettingsClient.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +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.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; +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 ServerThreatProtectionSettingsClient. */ +public interface ServerThreatProtectionSettingsClient { + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByServerAsync(String resourceGroupName, String serverName); + + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer( + String resourceGroupName, String serverName, Context context); + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName); + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName); + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName, Context context); + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerThreatProtectionSettingsModelInner get( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName); + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters); + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 {@link PollerFlux} for polling of server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ServerThreatProtectionSettingsModelInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters); + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 {@link SyncPoller} for polling of server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerThreatProtectionSettingsModelInner> + beginCreateOrUpdate( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters); + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 {@link SyncPoller} for polling of server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServerThreatProtectionSettingsModelInner> + beginCreateOrUpdate( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters, + Context context); + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters); + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerThreatProtectionSettingsModelInner createOrUpdate( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters); + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerThreatProtectionSettingsModelInner createOrUpdate( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters, + Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/VirtualEndpointsClient.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/VirtualEndpointsClient.java new file mode 100644 index 000000000000..5d48c025fb37 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/VirtualEndpointsClient.java @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +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.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResourceForPatch; +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 VirtualEndpointsClient. */ +public interface VirtualEndpointsClient { + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 virtual endpoint for a server along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createWithResponseAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters); + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 {@link PollerFlux} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, VirtualEndpointResourceInner> beginCreateAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters); + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 {@link SyncPoller} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualEndpointResourceInner> beginCreate( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters); + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 {@link SyncPoller} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualEndpointResourceInner> beginCreate( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters, + Context context); + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 virtual endpoint for a server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters); + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualEndpointResourceInner create( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters); + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualEndpointResourceInner create( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters, + Context context); + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters); + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 the {@link PollerFlux} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, VirtualEndpointResourceInner> beginUpdateAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters); + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 the {@link SyncPoller} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualEndpointResourceInner> beginUpdate( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters); + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 the {@link SyncPoller} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualEndpointResourceInner> beginUpdate( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters, + Context context); + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters); + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualEndpointResourceInner update( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters); + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualEndpointResourceInner update( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters, + Context context); + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync( + String resourceGroupName, String serverName, String virtualEndpointName); + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serverName, String virtualEndpointName); + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serverName, String virtualEndpointName); + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serverName, String virtualEndpointName, Context context); + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String serverName, String virtualEndpointName); + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtualEndpointName); + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtualEndpointName, Context context); + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtual endpoint along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String virtualEndpointName); + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtual endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync( + String resourceGroupName, String serverName, String virtualEndpointName); + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtual endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serverName, String virtualEndpointName, Context context); + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtual endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualEndpointResourceInner get(String resourceGroupName, String serverName, String virtualEndpointName); + + /** + * List all the servers in a given resource group. + * + * @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 endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByServerAsync(String resourceGroupName, String serverName); + + /** + * List all the servers in a given resource group. + * + * @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 endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * List all the servers in a given resource group. + * + * @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 endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByServer( + String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/CapabilityPropertiesInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/CapabilityPropertiesInner.java deleted file mode 100644 index e0ecfaae1617..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/CapabilityPropertiesInner.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.postgresqlflexibleserver.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HyperscaleNodeEditionCapability; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Location capabilities. */ -@Immutable -public final class CapabilityPropertiesInner { - /* - * zone name - */ - @JsonProperty(value = "zone", access = JsonProperty.Access.WRITE_ONLY) - private String zone; - - /* - * Supported high availability mode - */ - @JsonProperty(value = "supportedHAMode", access = JsonProperty.Access.WRITE_ONLY) - private List supportedHAMode; - - /* - * A value indicating whether a new server in this region can have geo-backups to paired region. - */ - @JsonProperty(value = "geoBackupSupported", access = JsonProperty.Access.WRITE_ONLY) - private Boolean geoBackupSupported; - - /* - * A value indicating whether a new server in this region can support multi zone HA. - */ - @JsonProperty(value = "zoneRedundantHaSupported", access = JsonProperty.Access.WRITE_ONLY) - private Boolean zoneRedundantHaSupported; - - /* - * A value indicating whether a new server in this region can have geo-backups to paired region. - */ - @JsonProperty(value = "zoneRedundantHaAndGeoBackupSupported", access = JsonProperty.Access.WRITE_ONLY) - private Boolean zoneRedundantHaAndGeoBackupSupported; - - /* - * The supportedFlexibleServerEditions property. - */ - @JsonProperty(value = "supportedFlexibleServerEditions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedFlexibleServerEditions; - - /* - * The supportedHyperscaleNodeEditions property. - */ - @JsonProperty(value = "supportedHyperscaleNodeEditions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedHyperscaleNodeEditions; - - /* - * A value indicating whether fast provisioning is supported in this region. - */ - @JsonProperty(value = "fastProvisioningSupported", access = JsonProperty.Access.WRITE_ONLY) - private Boolean fastProvisioningSupported; - - /* - * The supportedFastProvisioningEditions property. - */ - @JsonProperty(value = "supportedFastProvisioningEditions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedFastProvisioningEditions; - - /* - * The status - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** Creates an instance of CapabilityPropertiesInner class. */ - public CapabilityPropertiesInner() { - } - - /** - * Get the zone property: zone name. - * - * @return the zone value. - */ - public String zone() { - return this.zone; - } - - /** - * Get the supportedHAMode property: Supported high availability mode. - * - * @return the supportedHAMode value. - */ - public List supportedHAMode() { - return this.supportedHAMode; - } - - /** - * Get the geoBackupSupported property: A value indicating whether a new server in this region can have geo-backups - * to paired region. - * - * @return the geoBackupSupported value. - */ - public Boolean geoBackupSupported() { - return this.geoBackupSupported; - } - - /** - * Get the zoneRedundantHaSupported property: A value indicating whether a new server in this region can support - * multi zone HA. - * - * @return the zoneRedundantHaSupported value. - */ - public Boolean zoneRedundantHaSupported() { - return this.zoneRedundantHaSupported; - } - - /** - * Get the zoneRedundantHaAndGeoBackupSupported property: A value indicating whether a new server in this region can - * have geo-backups to paired region. - * - * @return the zoneRedundantHaAndGeoBackupSupported value. - */ - public Boolean zoneRedundantHaAndGeoBackupSupported() { - return this.zoneRedundantHaAndGeoBackupSupported; - } - - /** - * Get the supportedFlexibleServerEditions property: The supportedFlexibleServerEditions property. - * - * @return the supportedFlexibleServerEditions value. - */ - public List supportedFlexibleServerEditions() { - return this.supportedFlexibleServerEditions; - } - - /** - * Get the supportedHyperscaleNodeEditions property: The supportedHyperscaleNodeEditions property. - * - * @return the supportedHyperscaleNodeEditions value. - */ - public List supportedHyperscaleNodeEditions() { - return this.supportedHyperscaleNodeEditions; - } - - /** - * Get the fastProvisioningSupported property: A value indicating whether fast provisioning is supported in this - * region. - * - * @return the fastProvisioningSupported value. - */ - public Boolean fastProvisioningSupported() { - return this.fastProvisioningSupported; - } - - /** - * Get the supportedFastProvisioningEditions property: The supportedFastProvisioningEditions property. - * - * @return the supportedFastProvisioningEditions value. - */ - public List supportedFastProvisioningEditions() { - return this.supportedFastProvisioningEditions; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedFlexibleServerEditions() != null) { - supportedFlexibleServerEditions().forEach(e -> e.validate()); - } - if (supportedHyperscaleNodeEditions() != null) { - supportedHyperscaleNodeEditions().forEach(e -> e.validate()); - } - if (supportedFastProvisioningEditions() != null) { - supportedFastProvisioningEditions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FlexibleServerCapabilityInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FlexibleServerCapabilityInner.java new file mode 100644 index 000000000000..de5d3fc021a3 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/FlexibleServerCapabilityInner.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityBase; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability; +import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoBackupSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OnlineResizeSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RestrictedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrowthSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Capability for the PostgreSQL server. */ +@Fluent +public final class FlexibleServerCapabilityInner extends CapabilityBase { + /* + * Name of flexible servers capability + */ + @JsonProperty(value = "name") + private String name; + + /* + * List of supported flexible server editions + */ + @JsonProperty(value = "supportedServerEditions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedServerEditions; + + /* + * The list of server versions supported for this capability. + */ + @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedServerVersions; + + /* + * Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported. + * "Disabled" stands for fast provisioning is not supported. + */ + @JsonProperty(value = "fastProvisioningSupported", access = JsonProperty.Access.WRITE_ONLY) + private FastProvisioningSupportedEnum fastProvisioningSupported; + + /* + * List of supported server editions for fast provisioning + */ + @JsonProperty(value = "supportedFastProvisioningEditions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedFastProvisioningEditions; + + /* + * Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands + * for geo-back is not supported. + */ + @JsonProperty(value = "geoBackupSupported", access = JsonProperty.Access.WRITE_ONLY) + private GeoBackupSupportedEnum geoBackupSupported; + + /* + * A value indicating whether Zone Redundant HA is supported in this region. "Enabled" means zone redundant HA is + * supported. "Disabled" stands for zone redundant HA is not supported. + */ + @JsonProperty(value = "zoneRedundantHaSupported", access = JsonProperty.Access.WRITE_ONLY) + private ZoneRedundantHaSupportedEnum zoneRedundantHaSupported; + + /* + * A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. "Enabled" means zone + * redundant HA and geo-backup is supported. "Disabled" stands for zone redundant HA and geo-backup is not + * supported. + */ + @JsonProperty(value = "zoneRedundantHaAndGeoBackupSupported", access = JsonProperty.Access.WRITE_ONLY) + private ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSupported; + + /* + * A value indicating whether storage auto-grow is supported in this region. "Enabled" means storage auto-grow is + * supported. "Disabled" stands for storage auto-grow is not supported. + */ + @JsonProperty(value = "storageAutoGrowthSupported", access = JsonProperty.Access.WRITE_ONLY) + private StorageAutoGrowthSupportedEnum storageAutoGrowthSupported; + + /* + * A value indicating whether online resize is supported in this region for the given subscription. "Enabled" means + * storage online resize is supported. "Disabled" means storage online resize is not supported. + */ + @JsonProperty(value = "onlineResizeSupported", access = JsonProperty.Access.WRITE_ONLY) + private OnlineResizeSupportedEnum onlineResizeSupported; + + /* + * A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands + * for region is not restricted. + */ + @JsonProperty(value = "restricted", access = JsonProperty.Access.WRITE_ONLY) + private RestrictedEnum restricted; + + /** Creates an instance of FlexibleServerCapabilityInner class. */ + public FlexibleServerCapabilityInner() { + } + + /** + * Get the name property: Name of flexible servers capability. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of flexible servers capability. + * + * @param name the name value to set. + * @return the FlexibleServerCapabilityInner object itself. + */ + public FlexibleServerCapabilityInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the supportedServerEditions property: List of supported flexible server editions. + * + * @return the supportedServerEditions value. + */ + public List supportedServerEditions() { + return this.supportedServerEditions; + } + + /** + * Get the supportedServerVersions property: The list of server versions supported for this capability. + * + * @return the supportedServerVersions value. + */ + public List supportedServerVersions() { + return this.supportedServerVersions; + } + + /** + * Get the fastProvisioningSupported property: Gets a value indicating whether fast provisioning is supported. + * "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported. + * + * @return the fastProvisioningSupported value. + */ + public FastProvisioningSupportedEnum fastProvisioningSupported() { + return this.fastProvisioningSupported; + } + + /** + * Get the supportedFastProvisioningEditions property: List of supported server editions for fast provisioning. + * + * @return the supportedFastProvisioningEditions value. + */ + public List supportedFastProvisioningEditions() { + return this.supportedFastProvisioningEditions; + } + + /** + * Get the geoBackupSupported property: Determines if geo-backup is supported in this region. "Enabled" means + * geo-backup is supported. "Disabled" stands for geo-back is not supported. + * + * @return the geoBackupSupported value. + */ + public GeoBackupSupportedEnum geoBackupSupported() { + return this.geoBackupSupported; + } + + /** + * Get the zoneRedundantHaSupported property: A value indicating whether Zone Redundant HA is supported in this + * region. "Enabled" means zone redundant HA is supported. "Disabled" stands for zone redundant HA is not supported. + * + * @return the zoneRedundantHaSupported value. + */ + public ZoneRedundantHaSupportedEnum zoneRedundantHaSupported() { + return this.zoneRedundantHaSupported; + } + + /** + * Get the zoneRedundantHaAndGeoBackupSupported property: A value indicating whether Zone Redundant HA and + * Geo-backup is supported in this region. "Enabled" means zone redundant HA and geo-backup is supported. "Disabled" + * stands for zone redundant HA and geo-backup is not supported. + * + * @return the zoneRedundantHaAndGeoBackupSupported value. + */ + public ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSupported() { + return this.zoneRedundantHaAndGeoBackupSupported; + } + + /** + * Get the storageAutoGrowthSupported property: A value indicating whether storage auto-grow is supported in this + * region. "Enabled" means storage auto-grow is supported. "Disabled" stands for storage auto-grow is not supported. + * + * @return the storageAutoGrowthSupported value. + */ + public StorageAutoGrowthSupportedEnum storageAutoGrowthSupported() { + return this.storageAutoGrowthSupported; + } + + /** + * Get the onlineResizeSupported property: A value indicating whether online resize is supported in this region for + * the given subscription. "Enabled" means storage online resize is supported. "Disabled" means storage online + * resize is not supported. + * + * @return the onlineResizeSupported value. + */ + public OnlineResizeSupportedEnum onlineResizeSupported() { + return this.onlineResizeSupported; + } + + /** + * Get the restricted property: A value indicating whether this region is restricted. "Enabled" means region is + * restricted. "Disabled" stands for region is not restricted. + * + * @return the restricted value. + */ + public RestrictedEnum restricted() { + return this.restricted; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (supportedServerEditions() != null) { + supportedServerEditions().forEach(e -> e.validate()); + } + if (supportedServerVersions() != null) { + supportedServerVersions().forEach(e -> e.validate()); + } + if (supportedFastProvisioningEditions() != null) { + supportedFastProvisioningEditions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java new file mode 100644 index 000000000000..e8848a5d625f --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileInner.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Represents a logFile. */ +@Fluent +public final class LogFileInner extends ProxyResource { + /* + * The properties of a logFile. + */ + @JsonProperty(value = "properties") + private LogFileProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of LogFileInner class. */ + public LogFileInner() { + } + + /** + * Get the innerProperties property: The properties of a logFile. + * + * @return the innerProperties value. + */ + private LogFileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the createdTime property: Creation timestamp of the log file. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.innerProperties() == null ? null : this.innerProperties().createdTime(); + } + + /** + * Set the createdTime property: Creation timestamp of the log file. + * + * @param createdTime the createdTime value to set. + * @return the LogFileInner object itself. + */ + public LogFileInner withCreatedTime(OffsetDateTime createdTime) { + if (this.innerProperties() == null) { + this.innerProperties = new LogFileProperties(); + } + this.innerProperties().withCreatedTime(createdTime); + return this; + } + + /** + * Get the lastModifiedTime property: Last modified timestamp of the log file. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Set the lastModifiedTime property: Last modified timestamp of the log file. + * + * @param lastModifiedTime the lastModifiedTime value to set. + * @return the LogFileInner object itself. + */ + public LogFileInner withLastModifiedTime(OffsetDateTime lastModifiedTime) { + if (this.innerProperties() == null) { + this.innerProperties = new LogFileProperties(); + } + this.innerProperties().withLastModifiedTime(lastModifiedTime); + return this; + } + + /** + * Get the sizeInKb property: The size in kb of the logFile. + * + * @return the sizeInKb value. + */ + public Long sizeInKb() { + return this.innerProperties() == null ? null : this.innerProperties().sizeInKb(); + } + + /** + * Set the sizeInKb property: The size in kb of the logFile. + * + * @param sizeInKb the sizeInKb value to set. + * @return the LogFileInner object itself. + */ + public LogFileInner withSizeInKb(Long sizeInKb) { + if (this.innerProperties() == null) { + this.innerProperties = new LogFileProperties(); + } + this.innerProperties().withSizeInKb(sizeInKb); + return this; + } + + /** + * Get the type property: Type of the log file. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Type of the log file. + * + * @param type the type value to set. + * @return the LogFileInner object itself. + */ + public LogFileInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new LogFileProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the url property: The url to download the log file from. + * + * @return the url value. + */ + public String url() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LogFileProperties(); + } + this.innerProperties().withUrl(url); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java new file mode 100644 index 000000000000..310837942f8f --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LogFileProperties.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of a logFile. */ +@Fluent +public final class LogFileProperties { + /* + * Creation timestamp of the log file. + */ + @JsonProperty(value = "createdTime") + private OffsetDateTime createdTime; + + /* + * Last modified timestamp of the log file. + */ + @JsonProperty(value = "lastModifiedTime") + private OffsetDateTime lastModifiedTime; + + /* + * The size in kb of the logFile. + */ + @JsonProperty(value = "sizeInKb") + private Long sizeInKb; + + /* + * Type of the log file. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The url to download the log file from. + */ + @JsonProperty(value = "url") + private String url; + + /** Creates an instance of LogFileProperties class. */ + public LogFileProperties() { + } + + /** + * Get the createdTime property: Creation timestamp of the log file. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Set the createdTime property: Creation timestamp of the log file. + * + * @param createdTime the createdTime value to set. + * @return the LogFileProperties object itself. + */ + public LogFileProperties withCreatedTime(OffsetDateTime createdTime) { + this.createdTime = createdTime; + return this; + } + + /** + * Get the lastModifiedTime property: Last modified timestamp of the log file. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Set the lastModifiedTime property: Last modified timestamp of the log file. + * + * @param lastModifiedTime the lastModifiedTime value to set. + * @return the LogFileProperties object itself. + */ + public LogFileProperties withLastModifiedTime(OffsetDateTime lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + return this; + } + + /** + * Get the sizeInKb property: The size in kb of the logFile. + * + * @return the sizeInKb value. + */ + public Long sizeInKb() { + return this.sizeInKb; + } + + /** + * Set the sizeInKb property: The size in kb of the logFile. + * + * @param sizeInKb the sizeInKb value to set. + * @return the LogFileProperties object itself. + */ + public LogFileProperties withSizeInKb(Long sizeInKb) { + this.sizeInKb = sizeInKb; + return this; + } + + /** + * Get the type property: Type of the log file. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the log file. + * + * @param type the type value to set. + * @return the LogFileProperties object itself. + */ + public LogFileProperties withType(String type) { + this.type = type; + 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 LogFileProperties object itself. + */ + public LogFileProperties 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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java new file mode 100644 index 000000000000..8c4a2c0237b0 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupOperationResponseProperties.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Response for the backup request. */ +@Fluent +public final class LtrBackupOperationResponseProperties { + /* + * Size of datasource in bytes + */ + @JsonProperty(value = "datasourceSizeInBytes") + private Long datasourceSizeInBytes; + + /* + * Data transferred in bytes + */ + @JsonProperty(value = "dataTransferredInBytes") + private Long dataTransferredInBytes; + + /* + * Name of Backup operation + */ + @JsonProperty(value = "backupName") + private String backupName; + + /* + * Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this + * Recovery point. e.g. Versions, DataFormat etc + */ + @JsonProperty(value = "backupMetadata") + private String backupMetadata; + + /* + * Service-set extensible enum indicating the status of operation + */ + @JsonProperty(value = "status", required = true) + private ExecutionStatus status; + + /* + * Start time of the operation. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * End time of the operation. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * PercentageCompleted + */ + @JsonProperty(value = "percentComplete") + private Double percentComplete; + + /* + * The error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /* + * The error message. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /** Creates an instance of LtrBackupOperationResponseProperties class. */ + public LtrBackupOperationResponseProperties() { + } + + /** + * Get the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + public Long datasourceSizeInBytes() { + return this.datasourceSizeInBytes; + } + + /** + * Set the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @param datasourceSizeInBytes the datasourceSizeInBytes value to set. + * @return the LtrBackupOperationResponseProperties object itself. + */ + public LtrBackupOperationResponseProperties withDatasourceSizeInBytes(Long datasourceSizeInBytes) { + this.datasourceSizeInBytes = datasourceSizeInBytes; + return this; + } + + /** + * Get the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + public Long dataTransferredInBytes() { + return this.dataTransferredInBytes; + } + + /** + * Set the dataTransferredInBytes property: Data transferred in bytes. + * + * @param dataTransferredInBytes the dataTransferredInBytes value to set. + * @return the LtrBackupOperationResponseProperties object itself. + */ + public LtrBackupOperationResponseProperties withDataTransferredInBytes(Long dataTransferredInBytes) { + this.dataTransferredInBytes = dataTransferredInBytes; + return this; + } + + /** + * Get the backupName property: Name of Backup operation. + * + * @return the backupName value. + */ + public String backupName() { + return this.backupName; + } + + /** + * Set the backupName property: Name of Backup operation. + * + * @param backupName the backupName value to set. + * @return the LtrBackupOperationResponseProperties object itself. + */ + public LtrBackupOperationResponseProperties withBackupName(String backupName) { + this.backupName = backupName; + return this; + } + + /** + * Get the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a + * successful restore using this Recovery point. e.g. Versions, DataFormat etc. + * + * @return the backupMetadata value. + */ + public String backupMetadata() { + return this.backupMetadata; + } + + /** + * Set the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a + * successful restore using this Recovery point. e.g. Versions, DataFormat etc. + * + * @param backupMetadata the backupMetadata value to set. + * @return the LtrBackupOperationResponseProperties object itself. + */ + public LtrBackupOperationResponseProperties withBackupMetadata(String backupMetadata) { + this.backupMetadata = backupMetadata; + return this; + } + + /** + * Get the status property: Service-set extensible enum indicating the status of operation. + * + * @return the status value. + */ + public ExecutionStatus status() { + return this.status; + } + + /** + * Set the status property: Service-set extensible enum indicating the status of operation. + * + * @param status the status value to set. + * @return the LtrBackupOperationResponseProperties object itself. + */ + public LtrBackupOperationResponseProperties withStatus(ExecutionStatus status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: Start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of the operation. + * + * @param startTime the startTime value to set. + * @return the LtrBackupOperationResponseProperties object itself. + */ + public LtrBackupOperationResponseProperties withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: End time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: End time of the operation. + * + * @param endTime the endTime value to set. + * @return the LtrBackupOperationResponseProperties object itself. + */ + public LtrBackupOperationResponseProperties withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the percentComplete property: PercentageCompleted. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: PercentageCompleted. + * + * @param percentComplete the percentComplete value to set. + * @return the LtrBackupOperationResponseProperties object itself. + */ + public LtrBackupOperationResponseProperties withPercentComplete(Double percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * 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 LtrBackupOperationResponseProperties")); + } + if (startTime() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startTime in model LtrBackupOperationResponseProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LtrBackupOperationResponseProperties.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java new file mode 100644 index 000000000000..cae25402c0bb --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrBackupResponseInner.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Response for the LTR backup API call. */ +@Fluent +public final class LtrBackupResponseInner { + /* + * Long Term Retention Backup Operation Resource Properties + */ + @JsonProperty(value = "properties") + private LtrBackupOperationResponseProperties innerProperties; + + /** Creates an instance of LtrBackupResponseInner class. */ + public LtrBackupResponseInner() { + } + + /** + * Get the innerProperties property: Long Term Retention Backup Operation Resource Properties. + * + * @return the innerProperties value. + */ + private LtrBackupOperationResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + public Long datasourceSizeInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().datasourceSizeInBytes(); + } + + /** + * Set the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @param datasourceSizeInBytes the datasourceSizeInBytes value to set. + * @return the LtrBackupResponseInner object itself. + */ + public LtrBackupResponseInner withDatasourceSizeInBytes(Long datasourceSizeInBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withDatasourceSizeInBytes(datasourceSizeInBytes); + return this; + } + + /** + * Get the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + public Long dataTransferredInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTransferredInBytes(); + } + + /** + * Set the dataTransferredInBytes property: Data transferred in bytes. + * + * @param dataTransferredInBytes the dataTransferredInBytes value to set. + * @return the LtrBackupResponseInner object itself. + */ + public LtrBackupResponseInner withDataTransferredInBytes(Long dataTransferredInBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withDataTransferredInBytes(dataTransferredInBytes); + return this; + } + + /** + * Get the backupName property: Name of Backup operation. + * + * @return the backupName value. + */ + public String backupName() { + return this.innerProperties() == null ? null : this.innerProperties().backupName(); + } + + /** + * Set the backupName property: Name of Backup operation. + * + * @param backupName the backupName value to set. + * @return the LtrBackupResponseInner object itself. + */ + public LtrBackupResponseInner withBackupName(String backupName) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withBackupName(backupName); + return this; + } + + /** + * Get the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a + * successful restore using this Recovery point. e.g. Versions, DataFormat etc. + * + * @return the backupMetadata value. + */ + public String backupMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().backupMetadata(); + } + + /** + * Set the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a + * successful restore using this Recovery point. e.g. Versions, DataFormat etc. + * + * @param backupMetadata the backupMetadata value to set. + * @return the LtrBackupResponseInner object itself. + */ + public LtrBackupResponseInner withBackupMetadata(String backupMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withBackupMetadata(backupMetadata); + return this; + } + + /** + * Get the status property: Service-set extensible enum indicating the status of operation. + * + * @return the status value. + */ + public ExecutionStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Service-set extensible enum indicating the status of operation. + * + * @param status the status value to set. + * @return the LtrBackupResponseInner object itself. + */ + public LtrBackupResponseInner withStatus(ExecutionStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the startTime property: Start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.innerProperties() == null ? null : this.innerProperties().startTime(); + } + + /** + * Set the startTime property: Start time of the operation. + * + * @param startTime the startTime value to set. + * @return the LtrBackupResponseInner object itself. + */ + public LtrBackupResponseInner withStartTime(OffsetDateTime startTime) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withStartTime(startTime); + return this; + } + + /** + * Get the endTime property: End time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.innerProperties() == null ? null : this.innerProperties().endTime(); + } + + /** + * Set the endTime property: End time of the operation. + * + * @param endTime the endTime value to set. + * @return the LtrBackupResponseInner object itself. + */ + public LtrBackupResponseInner withEndTime(OffsetDateTime endTime) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withEndTime(endTime); + return this; + } + + /** + * Get the percentComplete property: PercentageCompleted. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.innerProperties() == null ? null : this.innerProperties().percentComplete(); + } + + /** + * Set the percentComplete property: PercentageCompleted. + * + * @param percentComplete the percentComplete value to set. + * @return the LtrBackupResponseInner object itself. + */ + public LtrBackupResponseInner withPercentComplete(Double percentComplete) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withPercentComplete(percentComplete); + return this; + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.innerProperties() == null ? null : this.innerProperties().errorCode(); + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java new file mode 100644 index 000000000000..addae5eee73a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for the LTR pre-backup API call. */ +@Fluent +public final class LtrPreBackupResponseInner { + /* + * Additional Properties for the pre backup response + */ + @JsonProperty(value = "properties", required = true) + private LtrPreBackupResponseProperties innerProperties = new LtrPreBackupResponseProperties(); + + /** Creates an instance of LtrPreBackupResponseInner class. */ + public LtrPreBackupResponseInner() { + } + + /** + * Get the innerProperties property: Additional Properties for the pre backup response. + * + * @return the innerProperties value. + */ + private LtrPreBackupResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the numberOfContainers property: Number of storage containers the plugin will use during backup. More than + * one containers may be used for size limitations, parallelism, or redundancy etc. + * + * @return the numberOfContainers value. + */ + public int numberOfContainers() { + return this.innerProperties() == null ? 0 : this.innerProperties().numberOfContainers(); + } + + /** + * Set the numberOfContainers property: Number of storage containers the plugin will use during backup. More than + * one containers may be used for size limitations, parallelism, or redundancy etc. + * + * @param numberOfContainers the numberOfContainers value to set. + * @return the LtrPreBackupResponseInner object itself. + */ + public LtrPreBackupResponseInner withNumberOfContainers(int numberOfContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrPreBackupResponseProperties(); + } + this.innerProperties().withNumberOfContainers(numberOfContainers); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LtrPreBackupResponseInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LtrPreBackupResponseInner.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java new file mode 100644 index 000000000000..968c034704f4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrPreBackupResponseProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for the pre-backup request. */ +@Fluent +public final class LtrPreBackupResponseProperties { + /* + * Number of storage containers the plugin will use during backup. More than one containers may be used for size + * limitations, parallelism, or redundancy etc. + */ + @JsonProperty(value = "numberOfContainers", required = true) + private int numberOfContainers; + + /** Creates an instance of LtrPreBackupResponseProperties class. */ + public LtrPreBackupResponseProperties() { + } + + /** + * Get the numberOfContainers property: Number of storage containers the plugin will use during backup. More than + * one containers may be used for size limitations, parallelism, or redundancy etc. + * + * @return the numberOfContainers value. + */ + public int numberOfContainers() { + return this.numberOfContainers; + } + + /** + * Set the numberOfContainers property: Number of storage containers the plugin will use during backup. More than + * one containers may be used for size limitations, parallelism, or redundancy etc. + * + * @param numberOfContainers the numberOfContainers value to set. + * @return the LtrPreBackupResponseProperties object itself. + */ + public LtrPreBackupResponseProperties withNumberOfContainers(int numberOfContainers) { + this.numberOfContainers = numberOfContainers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java new file mode 100644 index 000000000000..39f221b5c5e3 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/LtrServerBackupOperationInner.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Response for the LTR backup Operation API call. */ +@Fluent +public final class LtrServerBackupOperationInner extends ProxyResource { + /* + * Long Term Retention Backup Operation Resource Properties + */ + @JsonProperty(value = "properties") + private LtrBackupOperationResponseProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of LtrServerBackupOperationInner class. */ + public LtrServerBackupOperationInner() { + } + + /** + * Get the innerProperties property: Long Term Retention Backup Operation Resource Properties. + * + * @return the innerProperties value. + */ + private LtrBackupOperationResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + public Long datasourceSizeInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().datasourceSizeInBytes(); + } + + /** + * Set the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @param datasourceSizeInBytes the datasourceSizeInBytes value to set. + * @return the LtrServerBackupOperationInner object itself. + */ + public LtrServerBackupOperationInner withDatasourceSizeInBytes(Long datasourceSizeInBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withDatasourceSizeInBytes(datasourceSizeInBytes); + return this; + } + + /** + * Get the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + public Long dataTransferredInBytes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTransferredInBytes(); + } + + /** + * Set the dataTransferredInBytes property: Data transferred in bytes. + * + * @param dataTransferredInBytes the dataTransferredInBytes value to set. + * @return the LtrServerBackupOperationInner object itself. + */ + public LtrServerBackupOperationInner withDataTransferredInBytes(Long dataTransferredInBytes) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withDataTransferredInBytes(dataTransferredInBytes); + return this; + } + + /** + * Get the backupName property: Name of Backup operation. + * + * @return the backupName value. + */ + public String backupName() { + return this.innerProperties() == null ? null : this.innerProperties().backupName(); + } + + /** + * Set the backupName property: Name of Backup operation. + * + * @param backupName the backupName value to set. + * @return the LtrServerBackupOperationInner object itself. + */ + public LtrServerBackupOperationInner withBackupName(String backupName) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withBackupName(backupName); + return this; + } + + /** + * Get the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a + * successful restore using this Recovery point. e.g. Versions, DataFormat etc. + * + * @return the backupMetadata value. + */ + public String backupMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().backupMetadata(); + } + + /** + * Set the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform a + * successful restore using this Recovery point. e.g. Versions, DataFormat etc. + * + * @param backupMetadata the backupMetadata value to set. + * @return the LtrServerBackupOperationInner object itself. + */ + public LtrServerBackupOperationInner withBackupMetadata(String backupMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withBackupMetadata(backupMetadata); + return this; + } + + /** + * Get the status property: Service-set extensible enum indicating the status of operation. + * + * @return the status value. + */ + public ExecutionStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Service-set extensible enum indicating the status of operation. + * + * @param status the status value to set. + * @return the LtrServerBackupOperationInner object itself. + */ + public LtrServerBackupOperationInner withStatus(ExecutionStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the startTime property: Start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.innerProperties() == null ? null : this.innerProperties().startTime(); + } + + /** + * Set the startTime property: Start time of the operation. + * + * @param startTime the startTime value to set. + * @return the LtrServerBackupOperationInner object itself. + */ + public LtrServerBackupOperationInner withStartTime(OffsetDateTime startTime) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withStartTime(startTime); + return this; + } + + /** + * Get the endTime property: End time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.innerProperties() == null ? null : this.innerProperties().endTime(); + } + + /** + * Set the endTime property: End time of the operation. + * + * @param endTime the endTime value to set. + * @return the LtrServerBackupOperationInner object itself. + */ + public LtrServerBackupOperationInner withEndTime(OffsetDateTime endTime) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withEndTime(endTime); + return this; + } + + /** + * Get the percentComplete property: PercentageCompleted. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.innerProperties() == null ? null : this.innerProperties().percentComplete(); + } + + /** + * Set the percentComplete property: PercentageCompleted. + * + * @param percentComplete the percentComplete value to set. + * @return the LtrServerBackupOperationInner object itself. + */ + public LtrServerBackupOperationInner withPercentComplete(Double percentComplete) { + if (this.innerProperties() == null) { + this.innerProperties = new LtrBackupOperationResponseProperties(); + } + this.innerProperties().withPercentComplete(percentComplete); + return this; + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.innerProperties() == null ? null : this.innerProperties().errorCode(); + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java new file mode 100644 index 000000000000..80c281290c36 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationNameAvailabilityResourceInner.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents a migration name's availability. */ +@Fluent +public final class MigrationNameAvailabilityResourceInner { + /* + * The resource name to verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * Indicates whether the resource name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /* + * Migration name availability reason + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private MigrationNameAvailabilityReason reason; + + /* + * Migration name availability message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** Creates an instance of MigrationNameAvailabilityResourceInner class. */ + public MigrationNameAvailabilityResourceInner() { + } + + /** + * Get the name property: The resource name to verify. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The resource name to verify. + * + * @param name the name value to set. + * @return the MigrationNameAvailabilityResourceInner object itself. + */ + public MigrationNameAvailabilityResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the resource. + * + * @param type the type value to set. + * @return the MigrationNameAvailabilityResourceInner object itself. + */ + public MigrationNameAvailabilityResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the nameAvailable property: Indicates whether the resource name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: Migration name availability reason. + * + * @return the reason value. + */ + public MigrationNameAvailabilityReason reason() { + return this.reason; + } + + /** + * Get the message property: Migration name availability message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model MigrationNameAvailabilityResourceInner")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model MigrationNameAvailabilityResourceInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrationNameAvailabilityResourceInner.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java new file mode 100644 index 000000000000..b47dbfdcf8ec --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceInner.java @@ -0,0 +1,572 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationOption; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationStatus; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SourceType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents a migration resource. */ +@Fluent +public final class MigrationResourceInner extends Resource { + /* + * Migration resource properties. + */ + @JsonProperty(value = "properties") + private MigrationResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of MigrationResourceInner class. */ + public MigrationResourceInner() { + } + + /** + * Get the innerProperties property: Migration resource properties. + * + * @return the innerProperties value. + */ + private MigrationResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public MigrationResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrationResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the migrationId property: ID for migration, a GUID. + * + * @return the migrationId value. + */ + public String migrationId() { + return this.innerProperties() == null ? null : this.innerProperties().migrationId(); + } + + /** + * Get the currentStatus property: Current status of migration. + * + * @return the currentStatus value. + */ + public MigrationStatus currentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().currentStatus(); + } + + /** + * Get the migrationMode property: There are two types of migration modes Online and Offline. + * + * @return the migrationMode value. + */ + public MigrationMode migrationMode() { + return this.innerProperties() == null ? null : this.innerProperties().migrationMode(); + } + + /** + * Set the migrationMode property: There are two types of migration modes Online and Offline. + * + * @param migrationMode the migrationMode value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withMigrationMode(MigrationMode migrationMode) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withMigrationMode(migrationMode); + return this; + } + + /** + * Get the migrationOption property: This indicates the supported Migration option for the migration. + * + * @return the migrationOption value. + */ + public MigrationOption migrationOption() { + return this.innerProperties() == null ? null : this.innerProperties().migrationOption(); + } + + /** + * Set the migrationOption property: This indicates the supported Migration option for the migration. + * + * @param migrationOption the migrationOption value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withMigrationOption(MigrationOption migrationOption) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withMigrationOption(migrationOption); + return this; + } + + /** + * Get the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM or + * PostgreSQLSingleServer. + * + * @return the sourceType value. + */ + public SourceType sourceType() { + return this.innerProperties() == null ? null : this.innerProperties().sourceType(); + } + + /** + * Set the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM or + * PostgreSQLSingleServer. + * + * @param sourceType the sourceType value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withSourceType(SourceType sourceType) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withSourceType(sourceType); + return this; + } + + /** + * Get the sslMode property: SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and + * Prefer for other source types. + * + * @return the sslMode value. + */ + public SslMode sslMode() { + return this.innerProperties() == null ? null : this.innerProperties().sslMode(); + } + + /** + * Set the sslMode property: SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and + * Prefer for other source types. + * + * @param sslMode the sslMode value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withSslMode(SslMode sslMode) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withSslMode(sslMode); + return this; + } + + /** + * Get the sourceDbServerMetadata property: Metadata of the source database server. + * + * @return the sourceDbServerMetadata value. + */ + public DbServerMetadata sourceDbServerMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().sourceDbServerMetadata(); + } + + /** + * Get the targetDbServerMetadata property: Metadata of the target database server. + * + * @return the targetDbServerMetadata value. + */ + public DbServerMetadata targetDbServerMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().targetDbServerMetadata(); + } + + /** + * Get the sourceDbServerResourceId property: ResourceId of the source database server in case the sourceType is + * PostgreSQLSingleServer. For other source types this should be ipaddress:port@username or hostname:port@username. + * + * @return the sourceDbServerResourceId value. + */ + public String sourceDbServerResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().sourceDbServerResourceId(); + } + + /** + * Set the sourceDbServerResourceId property: ResourceId of the source database server in case the sourceType is + * PostgreSQLSingleServer. For other source types this should be ipaddress:port@username or hostname:port@username. + * + * @param sourceDbServerResourceId the sourceDbServerResourceId value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withSourceDbServerResourceId(String sourceDbServerResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withSourceDbServerResourceId(sourceDbServerResourceId); + return this; + } + + /** + * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @return the sourceDbServerFullyQualifiedDomainName value. + */ + public String sourceDbServerFullyQualifiedDomainName() { + return this.innerProperties() == null ? null : this.innerProperties().sourceDbServerFullyQualifiedDomainName(); + } + + /** + * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withSourceDbServerFullyQualifiedDomainName( + String sourceDbServerFullyQualifiedDomainName) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withSourceDbServerFullyQualifiedDomainName(sourceDbServerFullyQualifiedDomainName); + return this; + } + + /** + * Get the targetDbServerResourceId property: ResourceId of the source database server. + * + * @return the targetDbServerResourceId value. + */ + public String targetDbServerResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetDbServerResourceId(); + } + + /** + * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @return the targetDbServerFullyQualifiedDomainName value. + */ + public String targetDbServerFullyQualifiedDomainName() { + return this.innerProperties() == null ? null : this.innerProperties().targetDbServerFullyQualifiedDomainName(); + } + + /** + * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withTargetDbServerFullyQualifiedDomainName( + String targetDbServerFullyQualifiedDomainName) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withTargetDbServerFullyQualifiedDomainName(targetDbServerFullyQualifiedDomainName); + return this; + } + + /** + * Get the secretParameters property: Migration secret parameters. + * + * @return the secretParameters value. + */ + public MigrationSecretParameters secretParameters() { + return this.innerProperties() == null ? null : this.innerProperties().secretParameters(); + } + + /** + * Set the secretParameters property: Migration secret parameters. + * + * @param secretParameters the secretParameters value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withSecretParameters(MigrationSecretParameters secretParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withSecretParameters(secretParameters); + return this; + } + + /** + * Get the dbsToMigrate property: Number of databases to migrate. + * + * @return the dbsToMigrate value. + */ + public List dbsToMigrate() { + return this.innerProperties() == null ? null : this.innerProperties().dbsToMigrate(); + } + + /** + * Set the dbsToMigrate property: Number of databases to migrate. + * + * @param dbsToMigrate the dbsToMigrate value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withDbsToMigrate(List dbsToMigrate) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withDbsToMigrate(dbsToMigrate); + return this; + } + + /** + * Get the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @return the setupLogicalReplicationOnSourceDbIfNeeded value. + */ + public LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded() { + return this.innerProperties() == null + ? null + : this.innerProperties().setupLogicalReplicationOnSourceDbIfNeeded(); + } + + /** + * Set the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @param setupLogicalReplicationOnSourceDbIfNeeded the setupLogicalReplicationOnSourceDbIfNeeded value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withSetupLogicalReplicationOnSourceDbIfNeeded( + LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withSetupLogicalReplicationOnSourceDbIfNeeded(setupLogicalReplicationOnSourceDbIfNeeded); + return this; + } + + /** + * Get the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten, + * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the + * database already exists. + * + * @return the overwriteDbsInTarget value. + */ + public OverwriteDbsInTargetEnum overwriteDbsInTarget() { + return this.innerProperties() == null ? null : this.innerProperties().overwriteDbsInTarget(); + } + + /** + * Set the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten, + * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the + * database already exists. + * + * @param overwriteDbsInTarget the overwriteDbsInTarget value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withOverwriteDbsInTarget(overwriteDbsInTarget); + return this; + } + + /** + * Get the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @return the migrationWindowStartTimeInUtc value. + */ + public OffsetDateTime migrationWindowStartTimeInUtc() { + return this.innerProperties() == null ? null : this.innerProperties().migrationWindowStartTimeInUtc(); + } + + /** + * Set the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @param migrationWindowStartTimeInUtc the migrationWindowStartTimeInUtc value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withMigrationWindowStartTimeInUtc(migrationWindowStartTimeInUtc); + return this; + } + + /** + * Get the migrationWindowEndTimeInUtc property: End time in UTC for migration window. + * + * @return the migrationWindowEndTimeInUtc value. + */ + public OffsetDateTime migrationWindowEndTimeInUtc() { + return this.innerProperties() == null ? null : this.innerProperties().migrationWindowEndTimeInUtc(); + } + + /** + * Set the migrationWindowEndTimeInUtc property: End time in UTC for migration window. + * + * @param migrationWindowEndTimeInUtc the migrationWindowEndTimeInUtc value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withMigrationWindowEndTimeInUtc(OffsetDateTime migrationWindowEndTimeInUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withMigrationWindowEndTimeInUtc(migrationWindowEndTimeInUtc); + return this; + } + + /** + * Get the startDataMigration property: Indicates whether the data migration should start right away. + * + * @return the startDataMigration value. + */ + public StartDataMigrationEnum startDataMigration() { + return this.innerProperties() == null ? null : this.innerProperties().startDataMigration(); + } + + /** + * Set the startDataMigration property: Indicates whether the data migration should start right away. + * + * @param startDataMigration the startDataMigration value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withStartDataMigration(StartDataMigrationEnum startDataMigration) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withStartDataMigration(startDataMigration); + return this; + } + + /** + * Get the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True. + * + * @return the triggerCutover value. + */ + public TriggerCutoverEnum triggerCutover() { + return this.innerProperties() == null ? null : this.innerProperties().triggerCutover(); + } + + /** + * Set the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True. + * + * @param triggerCutover the triggerCutover value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withTriggerCutover(TriggerCutoverEnum triggerCutover) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withTriggerCutover(triggerCutover); + return this; + } + + /** + * Get the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send + * triggerCutover flag as True and database names in this array. + * + * @return the dbsToTriggerCutoverOn value. + */ + public List dbsToTriggerCutoverOn() { + return this.innerProperties() == null ? null : this.innerProperties().dbsToTriggerCutoverOn(); + } + + /** + * Set the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send + * triggerCutover flag as True and database names in this array. + * + * @param dbsToTriggerCutoverOn the dbsToTriggerCutoverOn value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withDbsToTriggerCutoverOn(dbsToTriggerCutoverOn); + return this; + } + + /** + * Get the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @return the cancel value. + */ + public CancelEnum cancel() { + return this.innerProperties() == null ? null : this.innerProperties().cancel(); + } + + /** + * Set the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @param cancel the cancel value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withCancel(CancelEnum cancel) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withCancel(cancel); + return this; + } + + /** + * Get the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag + * as True and database names in this array. + * + * @return the dbsToCancelMigrationOn value. + */ + public List dbsToCancelMigrationOn() { + return this.innerProperties() == null ? null : this.innerProperties().dbsToCancelMigrationOn(); + } + + /** + * Set the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag + * as True and database names in this array. + * + * @param dbsToCancelMigrationOn the dbsToCancelMigrationOn value to set. + * @return the MigrationResourceInner object itself. + */ + public MigrationResourceInner withDbsToCancelMigrationOn(List dbsToCancelMigrationOn) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourceProperties(); + } + this.innerProperties().withDbsToCancelMigrationOn(dbsToCancelMigrationOn); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java new file mode 100644 index 000000000000..2d8893dba1a8 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourceProperties.java @@ -0,0 +1,622 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationOption; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationStatus; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SourceType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Migration resource properties. */ +@Fluent +public final class MigrationResourceProperties { + /* + * ID for migration, a GUID. + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /* + * Current status of migration + */ + @JsonProperty(value = "currentStatus", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus currentStatus; + + /* + * There are two types of migration modes Online and Offline + */ + @JsonProperty(value = "migrationMode") + private MigrationMode migrationMode; + + /* + * This indicates the supported Migration option for the migration + */ + @JsonProperty(value = "migrationOption") + private MigrationOption migrationOption; + + /* + * migration source server type : OnPremises, AWS, GCP, AzureVM or PostgreSQLSingleServer + */ + @JsonProperty(value = "sourceType") + private SourceType sourceType; + + /* + * SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and Prefer for other source + * types + */ + @JsonProperty(value = "sslMode") + private SslMode sslMode; + + /* + * Metadata of the source database server + */ + @JsonProperty(value = "sourceDbServerMetadata", access = JsonProperty.Access.WRITE_ONLY) + private DbServerMetadata sourceDbServerMetadata; + + /* + * Metadata of the target database server + */ + @JsonProperty(value = "targetDbServerMetadata", access = JsonProperty.Access.WRITE_ONLY) + private DbServerMetadata targetDbServerMetadata; + + /* + * ResourceId of the source database server in case the sourceType is PostgreSQLSingleServer. For other source + * types this should be ipaddress:port@username or hostname:port@username + */ + @JsonProperty(value = "sourceDbServerResourceId") + private String sourceDbServerResourceId; + + /* + * Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always + * use it for connection + */ + @JsonProperty(value = "sourceDbServerFullyQualifiedDomainName") + private String sourceDbServerFullyQualifiedDomainName; + + /* + * ResourceId of the source database server + */ + @JsonProperty(value = "targetDbServerResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String targetDbServerResourceId; + + /* + * Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always + * use it for connection + */ + @JsonProperty(value = "targetDbServerFullyQualifiedDomainName") + private String targetDbServerFullyQualifiedDomainName; + + /* + * Migration secret parameters + */ + @JsonProperty(value = "secretParameters") + private MigrationSecretParameters secretParameters; + + /* + * Number of databases to migrate + */ + @JsonProperty(value = "dbsToMigrate") + private List dbsToMigrate; + + /* + * Indicates whether to setup LogicalReplicationOnSourceDb, if needed + */ + @JsonProperty(value = "setupLogicalReplicationOnSourceDbIfNeeded") + private LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded; + + /* + * Indicates whether the databases on the target server can be overwritten, if already present. If set to False, + * the migration workflow will wait for a confirmation, if it detects that the database already exists. + */ + @JsonProperty(value = "overwriteDbsInTarget") + private OverwriteDbsInTargetEnum overwriteDbsInTarget; + + /* + * Start time in UTC for migration window + */ + @JsonProperty(value = "migrationWindowStartTimeInUtc") + private OffsetDateTime migrationWindowStartTimeInUtc; + + /* + * End time in UTC for migration window + */ + @JsonProperty(value = "migrationWindowEndTimeInUtc") + private OffsetDateTime migrationWindowEndTimeInUtc; + + /* + * Indicates whether the data migration should start right away + */ + @JsonProperty(value = "startDataMigration") + private StartDataMigrationEnum startDataMigration; + + /* + * To trigger cutover for entire migration we need to send this flag as True + */ + @JsonProperty(value = "triggerCutover") + private TriggerCutoverEnum triggerCutover; + + /* + * When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in + * this array + */ + @JsonProperty(value = "dbsToTriggerCutoverOn") + private List dbsToTriggerCutoverOn; + + /* + * To trigger cancel for entire migration we need to send this flag as True + */ + @JsonProperty(value = "cancel") + private CancelEnum cancel; + + /* + * When you want to trigger cancel for specific databases send cancel flag as True and database names in this array + */ + @JsonProperty(value = "dbsToCancelMigrationOn") + private List dbsToCancelMigrationOn; + + /** Creates an instance of MigrationResourceProperties class. */ + public MigrationResourceProperties() { + } + + /** + * Get the migrationId property: ID for migration, a GUID. + * + * @return the migrationId value. + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get the currentStatus property: Current status of migration. + * + * @return the currentStatus value. + */ + public MigrationStatus currentStatus() { + return this.currentStatus; + } + + /** + * Get the migrationMode property: There are two types of migration modes Online and Offline. + * + * @return the migrationMode value. + */ + public MigrationMode migrationMode() { + return this.migrationMode; + } + + /** + * Set the migrationMode property: There are two types of migration modes Online and Offline. + * + * @param migrationMode the migrationMode value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withMigrationMode(MigrationMode migrationMode) { + this.migrationMode = migrationMode; + return this; + } + + /** + * Get the migrationOption property: This indicates the supported Migration option for the migration. + * + * @return the migrationOption value. + */ + public MigrationOption migrationOption() { + return this.migrationOption; + } + + /** + * Set the migrationOption property: This indicates the supported Migration option for the migration. + * + * @param migrationOption the migrationOption value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withMigrationOption(MigrationOption migrationOption) { + this.migrationOption = migrationOption; + return this; + } + + /** + * Get the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM or + * PostgreSQLSingleServer. + * + * @return the sourceType value. + */ + public SourceType sourceType() { + return this.sourceType; + } + + /** + * Set the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM or + * PostgreSQLSingleServer. + * + * @param sourceType the sourceType value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withSourceType(SourceType sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get the sslMode property: SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and + * Prefer for other source types. + * + * @return the sslMode value. + */ + public SslMode sslMode() { + return this.sslMode; + } + + /** + * Set the sslMode property: SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and + * Prefer for other source types. + * + * @param sslMode the sslMode value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withSslMode(SslMode sslMode) { + this.sslMode = sslMode; + return this; + } + + /** + * Get the sourceDbServerMetadata property: Metadata of the source database server. + * + * @return the sourceDbServerMetadata value. + */ + public DbServerMetadata sourceDbServerMetadata() { + return this.sourceDbServerMetadata; + } + + /** + * Get the targetDbServerMetadata property: Metadata of the target database server. + * + * @return the targetDbServerMetadata value. + */ + public DbServerMetadata targetDbServerMetadata() { + return this.targetDbServerMetadata; + } + + /** + * Get the sourceDbServerResourceId property: ResourceId of the source database server in case the sourceType is + * PostgreSQLSingleServer. For other source types this should be ipaddress:port@username or hostname:port@username. + * + * @return the sourceDbServerResourceId value. + */ + public String sourceDbServerResourceId() { + return this.sourceDbServerResourceId; + } + + /** + * Set the sourceDbServerResourceId property: ResourceId of the source database server in case the sourceType is + * PostgreSQLSingleServer. For other source types this should be ipaddress:port@username or hostname:port@username. + * + * @param sourceDbServerResourceId the sourceDbServerResourceId value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withSourceDbServerResourceId(String sourceDbServerResourceId) { + this.sourceDbServerResourceId = sourceDbServerResourceId; + return this; + } + + /** + * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @return the sourceDbServerFullyQualifiedDomainName value. + */ + public String sourceDbServerFullyQualifiedDomainName() { + return this.sourceDbServerFullyQualifiedDomainName; + } + + /** + * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withSourceDbServerFullyQualifiedDomainName( + String sourceDbServerFullyQualifiedDomainName) { + this.sourceDbServerFullyQualifiedDomainName = sourceDbServerFullyQualifiedDomainName; + return this; + } + + /** + * Get the targetDbServerResourceId property: ResourceId of the source database server. + * + * @return the targetDbServerResourceId value. + */ + public String targetDbServerResourceId() { + return this.targetDbServerResourceId; + } + + /** + * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @return the targetDbServerFullyQualifiedDomainName value. + */ + public String targetDbServerFullyQualifiedDomainName() { + return this.targetDbServerFullyQualifiedDomainName; + } + + /** + * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withTargetDbServerFullyQualifiedDomainName( + String targetDbServerFullyQualifiedDomainName) { + this.targetDbServerFullyQualifiedDomainName = targetDbServerFullyQualifiedDomainName; + return this; + } + + /** + * Get the secretParameters property: Migration secret parameters. + * + * @return the secretParameters value. + */ + public MigrationSecretParameters secretParameters() { + return this.secretParameters; + } + + /** + * Set the secretParameters property: Migration secret parameters. + * + * @param secretParameters the secretParameters value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withSecretParameters(MigrationSecretParameters secretParameters) { + this.secretParameters = secretParameters; + return this; + } + + /** + * Get the dbsToMigrate property: Number of databases to migrate. + * + * @return the dbsToMigrate value. + */ + public List dbsToMigrate() { + return this.dbsToMigrate; + } + + /** + * Set the dbsToMigrate property: Number of databases to migrate. + * + * @param dbsToMigrate the dbsToMigrate value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withDbsToMigrate(List dbsToMigrate) { + this.dbsToMigrate = dbsToMigrate; + return this; + } + + /** + * Get the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @return the setupLogicalReplicationOnSourceDbIfNeeded value. + */ + public LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded() { + return this.setupLogicalReplicationOnSourceDbIfNeeded; + } + + /** + * Set the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @param setupLogicalReplicationOnSourceDbIfNeeded the setupLogicalReplicationOnSourceDbIfNeeded value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withSetupLogicalReplicationOnSourceDbIfNeeded( + LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded) { + this.setupLogicalReplicationOnSourceDbIfNeeded = setupLogicalReplicationOnSourceDbIfNeeded; + return this; + } + + /** + * Get the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten, + * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the + * database already exists. + * + * @return the overwriteDbsInTarget value. + */ + public OverwriteDbsInTargetEnum overwriteDbsInTarget() { + return this.overwriteDbsInTarget; + } + + /** + * Set the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten, + * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the + * database already exists. + * + * @param overwriteDbsInTarget the overwriteDbsInTarget value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget) { + this.overwriteDbsInTarget = overwriteDbsInTarget; + return this; + } + + /** + * Get the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @return the migrationWindowStartTimeInUtc value. + */ + public OffsetDateTime migrationWindowStartTimeInUtc() { + return this.migrationWindowStartTimeInUtc; + } + + /** + * Set the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @param migrationWindowStartTimeInUtc the migrationWindowStartTimeInUtc value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc) { + this.migrationWindowStartTimeInUtc = migrationWindowStartTimeInUtc; + return this; + } + + /** + * Get the migrationWindowEndTimeInUtc property: End time in UTC for migration window. + * + * @return the migrationWindowEndTimeInUtc value. + */ + public OffsetDateTime migrationWindowEndTimeInUtc() { + return this.migrationWindowEndTimeInUtc; + } + + /** + * Set the migrationWindowEndTimeInUtc property: End time in UTC for migration window. + * + * @param migrationWindowEndTimeInUtc the migrationWindowEndTimeInUtc value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withMigrationWindowEndTimeInUtc(OffsetDateTime migrationWindowEndTimeInUtc) { + this.migrationWindowEndTimeInUtc = migrationWindowEndTimeInUtc; + return this; + } + + /** + * Get the startDataMigration property: Indicates whether the data migration should start right away. + * + * @return the startDataMigration value. + */ + public StartDataMigrationEnum startDataMigration() { + return this.startDataMigration; + } + + /** + * Set the startDataMigration property: Indicates whether the data migration should start right away. + * + * @param startDataMigration the startDataMigration value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withStartDataMigration(StartDataMigrationEnum startDataMigration) { + this.startDataMigration = startDataMigration; + return this; + } + + /** + * Get the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True. + * + * @return the triggerCutover value. + */ + public TriggerCutoverEnum triggerCutover() { + return this.triggerCutover; + } + + /** + * Set the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True. + * + * @param triggerCutover the triggerCutover value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withTriggerCutover(TriggerCutoverEnum triggerCutover) { + this.triggerCutover = triggerCutover; + return this; + } + + /** + * Get the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send + * triggerCutover flag as True and database names in this array. + * + * @return the dbsToTriggerCutoverOn value. + */ + public List dbsToTriggerCutoverOn() { + return this.dbsToTriggerCutoverOn; + } + + /** + * Set the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send + * triggerCutover flag as True and database names in this array. + * + * @param dbsToTriggerCutoverOn the dbsToTriggerCutoverOn value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn) { + this.dbsToTriggerCutoverOn = dbsToTriggerCutoverOn; + return this; + } + + /** + * Get the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @return the cancel value. + */ + public CancelEnum cancel() { + return this.cancel; + } + + /** + * Set the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @param cancel the cancel value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withCancel(CancelEnum cancel) { + this.cancel = cancel; + return this; + } + + /** + * Get the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag + * as True and database names in this array. + * + * @return the dbsToCancelMigrationOn value. + */ + public List dbsToCancelMigrationOn() { + return this.dbsToCancelMigrationOn; + } + + /** + * Set the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag + * as True and database names in this array. + * + * @param dbsToCancelMigrationOn the dbsToCancelMigrationOn value to set. + * @return the MigrationResourceProperties object itself. + */ + public MigrationResourceProperties withDbsToCancelMigrationOn(List dbsToCancelMigrationOn) { + this.dbsToCancelMigrationOn = dbsToCancelMigrationOn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (currentStatus() != null) { + currentStatus().validate(); + } + if (sourceDbServerMetadata() != null) { + sourceDbServerMetadata().validate(); + } + if (targetDbServerMetadata() != null) { + targetDbServerMetadata().validate(); + } + if (secretParameters() != null) { + secretParameters().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java new file mode 100644 index 000000000000..978b1cc4a324 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/MigrationResourcePropertiesForPatch.java @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Migration resource properties for patch. */ +@Fluent +public final class MigrationResourcePropertiesForPatch { + /* + * ResourceId of the source database server + */ + @JsonProperty(value = "sourceDbServerResourceId") + private String sourceDbServerResourceId; + + /* + * Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always + * use it for connection + */ + @JsonProperty(value = "sourceDbServerFullyQualifiedDomainName") + private String sourceDbServerFullyQualifiedDomainName; + + /* + * Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always + * use it for connection + */ + @JsonProperty(value = "targetDbServerFullyQualifiedDomainName") + private String targetDbServerFullyQualifiedDomainName; + + /* + * Migration secret parameters + */ + @JsonProperty(value = "secretParameters") + private MigrationSecretParameters secretParameters; + + /* + * Number of databases to migrate + */ + @JsonProperty(value = "dbsToMigrate") + private List dbsToMigrate; + + /* + * Indicates whether to setup LogicalReplicationOnSourceDb, if needed + */ + @JsonProperty(value = "setupLogicalReplicationOnSourceDbIfNeeded") + private LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded; + + /* + * Indicates whether the databases on the target server can be overwritten, if already present. If set to False, + * the migration workflow will wait for a confirmation, if it detects that the database already exists. + */ + @JsonProperty(value = "overwriteDbsInTarget") + private OverwriteDbsInTargetEnum overwriteDbsInTarget; + + /* + * Start time in UTC for migration window + */ + @JsonProperty(value = "migrationWindowStartTimeInUtc") + private OffsetDateTime migrationWindowStartTimeInUtc; + + /* + * Indicates whether the data migration should start right away + */ + @JsonProperty(value = "startDataMigration") + private StartDataMigrationEnum startDataMigration; + + /* + * To trigger cutover for entire migration we need to send this flag as True + */ + @JsonProperty(value = "triggerCutover") + private TriggerCutoverEnum triggerCutover; + + /* + * When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in + * this array + */ + @JsonProperty(value = "dbsToTriggerCutoverOn") + private List dbsToTriggerCutoverOn; + + /* + * To trigger cancel for entire migration we need to send this flag as True + */ + @JsonProperty(value = "cancel") + private CancelEnum cancel; + + /* + * When you want to trigger cancel for specific databases send cancel flag as True and database names in this array + */ + @JsonProperty(value = "dbsToCancelMigrationOn") + private List dbsToCancelMigrationOn; + + /* + * There are two types of migration modes Online and Offline + */ + @JsonProperty(value = "migrationMode") + private MigrationMode migrationMode; + + /** Creates an instance of MigrationResourcePropertiesForPatch class. */ + public MigrationResourcePropertiesForPatch() { + } + + /** + * Get the sourceDbServerResourceId property: ResourceId of the source database server. + * + * @return the sourceDbServerResourceId value. + */ + public String sourceDbServerResourceId() { + return this.sourceDbServerResourceId; + } + + /** + * Set the sourceDbServerResourceId property: ResourceId of the source database server. + * + * @param sourceDbServerResourceId the sourceDbServerResourceId value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withSourceDbServerResourceId(String sourceDbServerResourceId) { + this.sourceDbServerResourceId = sourceDbServerResourceId; + return this; + } + + /** + * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @return the sourceDbServerFullyQualifiedDomainName value. + */ + public String sourceDbServerFullyQualifiedDomainName() { + return this.sourceDbServerFullyQualifiedDomainName; + } + + /** + * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withSourceDbServerFullyQualifiedDomainName( + String sourceDbServerFullyQualifiedDomainName) { + this.sourceDbServerFullyQualifiedDomainName = sourceDbServerFullyQualifiedDomainName; + return this; + } + + /** + * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @return the targetDbServerFullyQualifiedDomainName value. + */ + public String targetDbServerFullyQualifiedDomainName() { + return this.targetDbServerFullyQualifiedDomainName; + } + + /** + * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withTargetDbServerFullyQualifiedDomainName( + String targetDbServerFullyQualifiedDomainName) { + this.targetDbServerFullyQualifiedDomainName = targetDbServerFullyQualifiedDomainName; + return this; + } + + /** + * Get the secretParameters property: Migration secret parameters. + * + * @return the secretParameters value. + */ + public MigrationSecretParameters secretParameters() { + return this.secretParameters; + } + + /** + * Set the secretParameters property: Migration secret parameters. + * + * @param secretParameters the secretParameters value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withSecretParameters(MigrationSecretParameters secretParameters) { + this.secretParameters = secretParameters; + return this; + } + + /** + * Get the dbsToMigrate property: Number of databases to migrate. + * + * @return the dbsToMigrate value. + */ + public List dbsToMigrate() { + return this.dbsToMigrate; + } + + /** + * Set the dbsToMigrate property: Number of databases to migrate. + * + * @param dbsToMigrate the dbsToMigrate value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withDbsToMigrate(List dbsToMigrate) { + this.dbsToMigrate = dbsToMigrate; + return this; + } + + /** + * Get the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @return the setupLogicalReplicationOnSourceDbIfNeeded value. + */ + public LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded() { + return this.setupLogicalReplicationOnSourceDbIfNeeded; + } + + /** + * Set the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @param setupLogicalReplicationOnSourceDbIfNeeded the setupLogicalReplicationOnSourceDbIfNeeded value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withSetupLogicalReplicationOnSourceDbIfNeeded( + LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded) { + this.setupLogicalReplicationOnSourceDbIfNeeded = setupLogicalReplicationOnSourceDbIfNeeded; + return this; + } + + /** + * Get the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten, + * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the + * database already exists. + * + * @return the overwriteDbsInTarget value. + */ + public OverwriteDbsInTargetEnum overwriteDbsInTarget() { + return this.overwriteDbsInTarget; + } + + /** + * Set the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten, + * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the + * database already exists. + * + * @param overwriteDbsInTarget the overwriteDbsInTarget value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget) { + this.overwriteDbsInTarget = overwriteDbsInTarget; + return this; + } + + /** + * Get the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @return the migrationWindowStartTimeInUtc value. + */ + public OffsetDateTime migrationWindowStartTimeInUtc() { + return this.migrationWindowStartTimeInUtc; + } + + /** + * Set the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @param migrationWindowStartTimeInUtc the migrationWindowStartTimeInUtc value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withMigrationWindowStartTimeInUtc( + OffsetDateTime migrationWindowStartTimeInUtc) { + this.migrationWindowStartTimeInUtc = migrationWindowStartTimeInUtc; + return this; + } + + /** + * Get the startDataMigration property: Indicates whether the data migration should start right away. + * + * @return the startDataMigration value. + */ + public StartDataMigrationEnum startDataMigration() { + return this.startDataMigration; + } + + /** + * Set the startDataMigration property: Indicates whether the data migration should start right away. + * + * @param startDataMigration the startDataMigration value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withStartDataMigration(StartDataMigrationEnum startDataMigration) { + this.startDataMigration = startDataMigration; + return this; + } + + /** + * Get the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True. + * + * @return the triggerCutover value. + */ + public TriggerCutoverEnum triggerCutover() { + return this.triggerCutover; + } + + /** + * Set the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True. + * + * @param triggerCutover the triggerCutover value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withTriggerCutover(TriggerCutoverEnum triggerCutover) { + this.triggerCutover = triggerCutover; + return this; + } + + /** + * Get the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send + * triggerCutover flag as True and database names in this array. + * + * @return the dbsToTriggerCutoverOn value. + */ + public List dbsToTriggerCutoverOn() { + return this.dbsToTriggerCutoverOn; + } + + /** + * Set the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send + * triggerCutover flag as True and database names in this array. + * + * @param dbsToTriggerCutoverOn the dbsToTriggerCutoverOn value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn) { + this.dbsToTriggerCutoverOn = dbsToTriggerCutoverOn; + return this; + } + + /** + * Get the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @return the cancel value. + */ + public CancelEnum cancel() { + return this.cancel; + } + + /** + * Set the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @param cancel the cancel value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withCancel(CancelEnum cancel) { + this.cancel = cancel; + return this; + } + + /** + * Get the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag + * as True and database names in this array. + * + * @return the dbsToCancelMigrationOn value. + */ + public List dbsToCancelMigrationOn() { + return this.dbsToCancelMigrationOn; + } + + /** + * Set the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag + * as True and database names in this array. + * + * @param dbsToCancelMigrationOn the dbsToCancelMigrationOn value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withDbsToCancelMigrationOn(List dbsToCancelMigrationOn) { + this.dbsToCancelMigrationOn = dbsToCancelMigrationOn; + return this; + } + + /** + * Get the migrationMode property: There are two types of migration modes Online and Offline. + * + * @return the migrationMode value. + */ + public MigrationMode migrationMode() { + return this.migrationMode; + } + + /** + * Set the migrationMode property: There are two types of migration modes Online and Offline. + * + * @param migrationMode the migrationMode value to set. + * @return the MigrationResourcePropertiesForPatch object itself. + */ + public MigrationResourcePropertiesForPatch withMigrationMode(MigrationMode migrationMode) { + this.migrationMode = migrationMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretParameters() != null) { + secretParameters().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..8b54833b2be1 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..20869f08a461 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateEndpointConnectionProperties.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.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The group ids for the private endpoint resource. + */ + @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) + private List groupIds; + + /* + * The private endpoint resource. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState 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) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..8c2b001aa37c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateLinkResourceInner class. */ + public PrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..73c198b89ebb --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + + /** + * 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; + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java new file mode 100644 index 000000000000..049b10f05dfc --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/QuotaUsageInner.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.models.NameProperty; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Quota usage for flexible servers. */ +@Fluent +public final class QuotaUsageInner { + /* + * Name of quota usage for flexible servers + */ + @JsonProperty(value = "name") + private NameProperty name; + + /* + * Quota limit + */ + @JsonProperty(value = "limit") + private Long limit; + + /* + * Quota unit + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Current Quota usage value + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /* + * Fully qualified ARM resource Id + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of QuotaUsageInner class. */ + public QuotaUsageInner() { + } + + /** + * Get the name property: Name of quota usage for flexible servers. + * + * @return the name value. + */ + public NameProperty name() { + return this.name; + } + + /** + * Set the name property: Name of quota usage for flexible servers. + * + * @param name the name value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withName(NameProperty name) { + this.name = name; + return this; + } + + /** + * Get the limit property: Quota limit. + * + * @return the limit value. + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit property: Quota limit. + * + * @param limit the limit value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the unit property: Quota unit. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Quota unit. + * + * @param unit the unit value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the currentValue property: Current Quota usage value. + * + * @return the currentValue value. + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: Current Quota usage value. + * + * @param currentValue the currentValue value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the id property: Fully qualified ARM resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ARM resource Id. + * + * @param id the id value to set. + * @return the QuotaUsageInner object itself. + */ + public QuotaUsageInner withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java index 7eb9c114a370..65861e8965d0 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerInner.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica; import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerState; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; @@ -22,6 +23,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Represents a server. */ @@ -390,8 +392,8 @@ public ServerInner withMaintenanceWindow(MaintenanceWindow maintenanceWindow) { /** * Get the sourceServerResourceId property: The source server resource ID to restore from. It's required when - * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. This property is returned only for Replica - * server. + * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned + * only for Replica server. * * @return the sourceServerResourceId value. */ @@ -401,8 +403,8 @@ public String sourceServerResourceId() { /** * Set the sourceServerResourceId property: The source server resource ID to restore from. It's required when - * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. This property is returned only for Replica - * server. + * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned + * only for Replica server. * * @param sourceServerResourceId the sourceServerResourceId value to set. * @return the ServerInner object itself. @@ -417,7 +419,7 @@ public ServerInner withSourceServerResourceId(String sourceServerResourceId) { /** * Get the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'. + * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'. * * @return the pointInTimeUtc value. */ @@ -427,7 +429,7 @@ public OffsetDateTime pointInTimeUtc() { /** * Set the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'. + * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'. * * @param pointInTimeUtc the pointInTimeUtc value to set. * @return the ServerInner object itself. @@ -495,6 +497,31 @@ public Integer replicaCapacity() { return this.innerProperties() == null ? null : this.innerProperties().replicaCapacity(); } + /** + * Get the replica property: Replica properties of a server. These Replica properties are required to be passed only + * in case you want to Promote a server. + * + * @return the replica value. + */ + public Replica replica() { + return this.innerProperties() == null ? null : this.innerProperties().replica(); + } + + /** + * Set the replica property: Replica properties of a server. These Replica properties are required to be passed only + * in case you want to Promote a server. + * + * @param replica the replica value to set. + * @return the ServerInner object itself. + */ + public ServerInner withReplica(Replica replica) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerProperties(); + } + this.innerProperties().withReplica(replica); + return this; + } + /** * Get the createMode property: The mode to create a new PostgreSQL server. * @@ -518,6 +545,16 @@ public ServerInner withCreateMode(CreateMode createMode) { return this; } + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the specified + * resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + /** * Validates the instance. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java index 24a349740ce0..b7e3ae8ff691 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerProperties.java @@ -12,12 +12,14 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica; import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerState; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.List; /** The properties of a server. */ @Fluent @@ -104,14 +106,14 @@ public final class ServerProperties { /* * The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or - * 'GeoRestore' or 'Replica'. This property is returned only for Replica server + * 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned only for Replica server */ @JsonProperty(value = "sourceServerResourceId") private String sourceServerResourceId; /* * Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when - * 'createMode' is 'PointInTimeRestore' or 'GeoRestore'. + * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'. */ @JsonProperty(value = "pointInTimeUTC") private OffsetDateTime pointInTimeUtc; @@ -134,12 +136,25 @@ public final class ServerProperties { @JsonProperty(value = "replicaCapacity", access = JsonProperty.Access.WRITE_ONLY) private Integer replicaCapacity; + /* + * Replica properties of a server. These Replica properties are required to be passed only in case you want to + * Promote a server. + */ + @JsonProperty(value = "replica") + private Replica replica; + /* * The mode to create a new PostgreSQL server. */ @JsonProperty(value = "createMode") private CreateMode createMode; + /* + * List of private endpoint connections associated with the specified resource. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + /** Creates an instance of ServerProperties class. */ public ServerProperties() { } @@ -377,8 +392,8 @@ public ServerProperties withMaintenanceWindow(MaintenanceWindow maintenanceWindo /** * Get the sourceServerResourceId property: The source server resource ID to restore from. It's required when - * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. This property is returned only for Replica - * server. + * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned + * only for Replica server. * * @return the sourceServerResourceId value. */ @@ -388,8 +403,8 @@ public String sourceServerResourceId() { /** * Set the sourceServerResourceId property: The source server resource ID to restore from. It's required when - * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. This property is returned only for Replica - * server. + * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned + * only for Replica server. * * @param sourceServerResourceId the sourceServerResourceId value to set. * @return the ServerProperties object itself. @@ -401,7 +416,7 @@ public ServerProperties withSourceServerResourceId(String sourceServerResourceId /** * Get the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'. + * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'. * * @return the pointInTimeUtc value. */ @@ -411,7 +426,7 @@ public OffsetDateTime pointInTimeUtc() { /** * Set the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'. + * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'. * * @param pointInTimeUtc the pointInTimeUtc value to set. * @return the ServerProperties object itself. @@ -470,6 +485,28 @@ public Integer replicaCapacity() { return this.replicaCapacity; } + /** + * Get the replica property: Replica properties of a server. These Replica properties are required to be passed only + * in case you want to Promote a server. + * + * @return the replica value. + */ + public Replica replica() { + return this.replica; + } + + /** + * Set the replica property: Replica properties of a server. These Replica properties are required to be passed only + * in case you want to Promote a server. + * + * @param replica the replica value to set. + * @return the ServerProperties object itself. + */ + public ServerProperties withReplica(Replica replica) { + this.replica = replica; + return this; + } + /** * Get the createMode property: The mode to create a new PostgreSQL server. * @@ -490,6 +527,16 @@ public ServerProperties withCreateMode(CreateMode createMode) { return this; } + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the specified + * resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Validates the instance. * @@ -517,5 +564,11 @@ public void validate() { if (maintenanceWindow() != null) { maintenanceWindow().validate(); } + if (replica() != null) { + replica().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java index 0d1e315707ae..c52dbad894d1 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerPropertiesForUpdate.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica; import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; @@ -27,7 +28,7 @@ public final class ServerPropertiesForUpdate { private String administratorLoginPassword; /* - * PostgreSQL Server version. + * PostgreSQL Server version. Version 16 is currently not supported for MVU. */ @JsonProperty(value = "version") private ServerVersion version; @@ -80,6 +81,13 @@ public final class ServerPropertiesForUpdate { @JsonProperty(value = "replicationRole") private ReplicationRole replicationRole; + /* + * Replica properties of a server. These Replica properties are required to be passed only in case you want to + * Promote a server. + */ + @JsonProperty(value = "replica") + private Replica replica; + /* * Network properties of a server. These are required to be passed only in case if server is a private access * server. @@ -112,7 +120,7 @@ public ServerPropertiesForUpdate withAdministratorLoginPassword(String administr } /** - * Get the version property: PostgreSQL Server version. + * Get the version property: PostgreSQL Server version. Version 16 is currently not supported for MVU. * * @return the version value. */ @@ -121,7 +129,7 @@ public ServerVersion version() { } /** - * Set the version property: PostgreSQL Server version. + * Set the version property: PostgreSQL Server version. Version 16 is currently not supported for MVU. * * @param version the version value to set. * @return the ServerPropertiesForUpdate object itself. @@ -291,6 +299,28 @@ public ServerPropertiesForUpdate withReplicationRole(ReplicationRole replication return this; } + /** + * Get the replica property: Replica properties of a server. These Replica properties are required to be passed only + * in case you want to Promote a server. + * + * @return the replica value. + */ + public Replica replica() { + return this.replica; + } + + /** + * Set the replica property: Replica properties of a server. These Replica properties are required to be passed only + * in case you want to Promote a server. + * + * @param replica the replica value to set. + * @return the ServerPropertiesForUpdate object itself. + */ + public ServerPropertiesForUpdate withReplica(Replica replica) { + this.replica = replica; + return this; + } + /** * Get the network property: Network properties of a server. These are required to be passed only in case if server * is a private access server. @@ -337,6 +367,9 @@ public void validate() { if (dataEncryption() != null) { dataEncryption().validate(); } + if (replica() != null) { + replica().validate(); + } if (network() != null) { network().validate(); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionProperties.java new file mode 100644 index 000000000000..a28c43777536 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of server Threat Protection state. */ +@Fluent +public final class ServerThreatProtectionProperties { + /* + * Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has not been applied + * yet on the specific server. + */ + @JsonProperty(value = "state", required = true) + private ThreatProtectionState state; + + /* + * Specifies the UTC creation time of the policy. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /** Creates an instance of ServerThreatProtectionProperties class. */ + public ServerThreatProtectionProperties() { + } + + /** + * Get the state property: Specifies the state of the Threat Protection, whether it is enabled or disabled or a + * state has not been applied yet on the specific server. + * + * @return the state value. + */ + public ThreatProtectionState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the Threat Protection, whether it is enabled or disabled or a + * state has not been applied yet on the specific server. + * + * @param state the state value to set. + * @return the ServerThreatProtectionProperties object itself. + */ + public ServerThreatProtectionProperties withState(ThreatProtectionState state) { + this.state = state; + return this; + } + + /** + * Get the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (state() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property state in model ServerThreatProtectionProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServerThreatProtectionProperties.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionSettingsModelInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionSettingsModelInner.java new file mode 100644 index 000000000000..9316bf0e15af --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/ServerThreatProtectionSettingsModelInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Server's Advanced Threat Protection settings. */ +@Fluent +public final class ServerThreatProtectionSettingsModelInner extends ProxyResource { + /* + * Advanced Threat Protection properties. + */ + @JsonProperty(value = "properties") + private ServerThreatProtectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ServerThreatProtectionSettingsModelInner class. */ + public ServerThreatProtectionSettingsModelInner() { + } + + /** + * Get the innerProperties property: Advanced Threat Protection properties. + * + * @return the innerProperties value. + */ + private ServerThreatProtectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the state property: Specifies the state of the Threat Protection, whether it is enabled or disabled or a + * state has not been applied yet on the specific server. + * + * @return the state value. + */ + public ThreatProtectionState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: Specifies the state of the Threat Protection, whether it is enabled or disabled or a + * state has not been applied yet on the specific server. + * + * @param state the state value to set. + * @return the ServerThreatProtectionSettingsModelInner object itself. + */ + public ServerThreatProtectionSettingsModelInner withState(ThreatProtectionState state) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerThreatProtectionProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceInner.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceInner.java new file mode 100644 index 000000000000..1c1fb0608e51 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceInner.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResourceForPatch; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a virtual endpoint for a server. */ +@Fluent +public final class VirtualEndpointResourceInner extends VirtualEndpointResourceForPatch { + /* + * Fully qualified resource ID for the resource. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The name of the resource + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of VirtualEndpointResourceInner class. */ + public VirtualEndpointResourceInner() { + } + + /** + * Get the id property: Fully qualified resource ID for the resource. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public VirtualEndpointResourceInner withEndpointType(VirtualEndpointType endpointType) { + super.withEndpointType(endpointType); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualEndpointResourceInner withMembers(List members) { + super.withMembers(members); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceProperties.java new file mode 100644 index 000000000000..7881bcba5c66 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/fluent/models/VirtualEndpointResourceProperties.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.postgresqlflexibleserver.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a virtual endpoint. */ +@Fluent +public final class VirtualEndpointResourceProperties { + /* + * The endpoint type for the virtual endpoint. + */ + @JsonProperty(value = "endpointType") + private VirtualEndpointType endpointType; + + /* + * List of members for a virtual endpoint + */ + @JsonProperty(value = "members") + private List members; + + /* + * List of virtual endpoints for a server + */ + @JsonProperty(value = "virtualEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private List virtualEndpoints; + + /** Creates an instance of VirtualEndpointResourceProperties class. */ + public VirtualEndpointResourceProperties() { + } + + /** + * Get the endpointType property: The endpoint type for the virtual endpoint. + * + * @return the endpointType value. + */ + public VirtualEndpointType endpointType() { + return this.endpointType; + } + + /** + * Set the endpointType property: The endpoint type for the virtual endpoint. + * + * @param endpointType the endpointType value to set. + * @return the VirtualEndpointResourceProperties object itself. + */ + public VirtualEndpointResourceProperties withEndpointType(VirtualEndpointType endpointType) { + this.endpointType = endpointType; + return this; + } + + /** + * Get the members property: List of members for a virtual endpoint. + * + * @return the members value. + */ + public List members() { + return this.members; + } + + /** + * Set the members property: List of members for a virtual endpoint. + * + * @param members the members value to set. + * @return the VirtualEndpointResourceProperties object itself. + */ + public VirtualEndpointResourceProperties withMembers(List members) { + this.members = members; + return this; + } + + /** + * Get the virtualEndpoints property: List of virtual endpoints for a server. + * + * @return the virtualEndpoints value. + */ + public List virtualEndpoints() { + return this.virtualEndpoints; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CapabilityPropertiesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java similarity index 50% rename from sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CapabilityPropertiesImpl.java rename to sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java index 4698faa775da..baf6aa401c2d 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/CapabilityPropertiesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServerCapabilityImpl.java @@ -4,53 +4,48 @@ package com.azure.resourcemanager.postgresqlflexibleserver.implementation; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityProperties; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityStatus; import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerCapability; import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HyperscaleNodeEditionCapability; +import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoBackupSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OnlineResizeSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.RestrictedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrowthSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum; import java.util.Collections; import java.util.List; -public final class CapabilityPropertiesImpl implements CapabilityProperties { - private CapabilityPropertiesInner innerObject; +public final class FlexibleServerCapabilityImpl implements FlexibleServerCapability { + private FlexibleServerCapabilityInner innerObject; private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; - CapabilityPropertiesImpl( - CapabilityPropertiesInner innerObject, + FlexibleServerCapabilityImpl( + FlexibleServerCapabilityInner innerObject, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public String zone() { - return this.innerModel().zone(); - } - - public List supportedHAMode() { - List inner = this.innerModel().supportedHAMode(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public CapabilityStatus status() { + return this.innerModel().status(); } - public Boolean geoBackupSupported() { - return this.innerModel().geoBackupSupported(); + public String reason() { + return this.innerModel().reason(); } - public Boolean zoneRedundantHaSupported() { - return this.innerModel().zoneRedundantHaSupported(); + public String name() { + return this.innerModel().name(); } - public Boolean zoneRedundantHaAndGeoBackupSupported() { - return this.innerModel().zoneRedundantHaAndGeoBackupSupported(); - } - - public List supportedFlexibleServerEditions() { - List inner = this.innerModel().supportedFlexibleServerEditions(); + public List supportedServerEditions() { + List inner = this.innerModel().supportedServerEditions(); if (inner != null) { return Collections.unmodifiableList(inner); } else { @@ -58,8 +53,8 @@ public List supportedFlexibleServerEditions() { } } - public List supportedHyperscaleNodeEditions() { - List inner = this.innerModel().supportedHyperscaleNodeEditions(); + public List supportedServerVersions() { + List inner = this.innerModel().supportedServerVersions(); if (inner != null) { return Collections.unmodifiableList(inner); } else { @@ -67,7 +62,7 @@ public List supportedHyperscaleNodeEditions() { } } - public Boolean fastProvisioningSupported() { + public FastProvisioningSupportedEnum fastProvisioningSupported() { return this.innerModel().fastProvisioningSupported(); } @@ -80,11 +75,31 @@ public List supportedFastProvisioningEditions } } - public String status() { - return this.innerModel().status(); + public GeoBackupSupportedEnum geoBackupSupported() { + return this.innerModel().geoBackupSupported(); + } + + public ZoneRedundantHaSupportedEnum zoneRedundantHaSupported() { + return this.innerModel().zoneRedundantHaSupported(); + } + + public ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSupported() { + return this.innerModel().zoneRedundantHaAndGeoBackupSupported(); + } + + public StorageAutoGrowthSupportedEnum storageAutoGrowthSupported() { + return this.innerModel().storageAutoGrowthSupported(); + } + + public OnlineResizeSupportedEnum onlineResizeSupported() { + return this.innerModel().onlineResizeSupported(); + } + + public RestrictedEnum restricted() { + return this.innerModel().restricted(); } - public CapabilityPropertiesInner innerModel() { + public FlexibleServerCapabilityInner innerModel() { return this.innerObject; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java new file mode 100644 index 000000000000..5d05bac0cfc6 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersClientImpl.java @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.FlexibleServersClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServersTriggerLtrPreBackupResponse; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; +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 FlexibleServersClient. */ +public final class FlexibleServersClientImpl implements FlexibleServersClient { + /** The proxy service used to perform REST calls. */ + private final FlexibleServersService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of FlexibleServersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FlexibleServersClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy.create(FlexibleServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientFlexibleServers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface FlexibleServersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrPreBackup") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono triggerLtrPreBackup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @BodyParam("application/json") LtrPreBackupRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/startLtrBackup") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startLtrBackup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @BodyParam("application/json") LtrBackupRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono triggerLtrPreBackupWithResponseAsync( + String resourceGroupName, String serverName, LtrPreBackupRequest 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 (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 + .triggerLtrPreBackup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerLtrPreBackupWithResponseAsync( + String resourceGroupName, String serverName, LtrPreBackupRequest 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 (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 + .triggerLtrPreBackup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + parameters, + accept, + context); + } + + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono triggerLtrPreBackupAsync( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters) { + return triggerLtrPreBackupWithResponseAsync(resourceGroupName, serverName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlexibleServersTriggerLtrPreBackupResponse triggerLtrPreBackupWithResponse( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters, Context context) { + return triggerLtrPreBackupWithResponseAsync(resourceGroupName, serverName, parameters, context).block(); + } + + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LtrPreBackupResponseInner triggerLtrPreBackup( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters) { + return triggerLtrPreBackupWithResponse(resourceGroupName, serverName, parameters, Context.NONE).getValue(); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startLtrBackupWithResponseAsync( + String resourceGroupName, String serverName, LtrBackupRequest 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 (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 + .startLtrBackup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startLtrBackupWithResponseAsync( + String resourceGroupName, String serverName, LtrBackupRequest 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 (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 + .startLtrBackup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + parameters, + accept, + context); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 {@link PollerFlux} for polling of response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, LtrBackupResponseInner> beginStartLtrBackupAsync( + String resourceGroupName, String serverName, LtrBackupRequest parameters) { + Mono>> mono = + startLtrBackupWithResponseAsync(resourceGroupName, serverName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LtrBackupResponseInner.class, + LtrBackupResponseInner.class, + this.client.getContext()); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 the {@link PollerFlux} for polling of response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LtrBackupResponseInner> beginStartLtrBackupAsync( + String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startLtrBackupWithResponseAsync(resourceGroupName, serverName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LtrBackupResponseInner.class, + LtrBackupResponseInner.class, + context); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 {@link SyncPoller} for polling of response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LtrBackupResponseInner> beginStartLtrBackup( + String resourceGroupName, String serverName, LtrBackupRequest parameters) { + return this.beginStartLtrBackupAsync(resourceGroupName, serverName, parameters).getSyncPoller(); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 the {@link SyncPoller} for polling of response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LtrBackupResponseInner> beginStartLtrBackup( + String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) { + return this.beginStartLtrBackupAsync(resourceGroupName, serverName, parameters, context).getSyncPoller(); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startLtrBackupAsync( + String resourceGroupName, String serverName, LtrBackupRequest parameters) { + return beginStartLtrBackupAsync(resourceGroupName, serverName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startLtrBackupAsync( + String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) { + return beginStartLtrBackupAsync(resourceGroupName, serverName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LtrBackupResponseInner startLtrBackup( + String resourceGroupName, String serverName, LtrBackupRequest parameters) { + return startLtrBackupAsync(resourceGroupName, serverName, parameters).block(); + } + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LtrBackupResponseInner startLtrBackup( + String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) { + return startLtrBackupAsync(resourceGroupName, serverName, parameters, context).block(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.java new file mode 100644 index 000000000000..db85a88f9734 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/FlexibleServersImpl.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.FlexibleServersClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServers; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServersTriggerLtrPreBackupResponse; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupResponse; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupResponse; + +public final class FlexibleServersImpl implements FlexibleServers { + private static final ClientLogger LOGGER = new ClientLogger(FlexibleServersImpl.class); + + private final FlexibleServersClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public FlexibleServersImpl( + FlexibleServersClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response triggerLtrPreBackupWithResponse( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters, Context context) { + FlexibleServersTriggerLtrPreBackupResponse inner = + this.serviceClient().triggerLtrPreBackupWithResponse(resourceGroupName, serverName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LtrPreBackupResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LtrPreBackupResponse triggerLtrPreBackup( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters) { + LtrPreBackupResponseInner inner = + this.serviceClient().triggerLtrPreBackup(resourceGroupName, serverName, parameters); + if (inner != null) { + return new LtrPreBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public LtrBackupResponse startLtrBackup(String resourceGroupName, String serverName, LtrBackupRequest parameters) { + LtrBackupResponseInner inner = this.serviceClient().startLtrBackup(resourceGroupName, serverName, parameters); + if (inner != null) { + return new LtrBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public LtrBackupResponse startLtrBackup( + String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context) { + LtrBackupResponseInner inner = + this.serviceClient().startLtrBackup(resourceGroupName, serverName, parameters, context); + if (inner != null) { + return new LtrBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private FlexibleServersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java index 1d3556eb07ea..e3af7907c2eb 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesClientImpl.java @@ -26,7 +26,7 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LocationBasedCapabilitiesClient; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner; import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilitiesListResult; import reactor.core.publisher.Mono; @@ -93,7 +93,7 @@ Mono> executeNext( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeSinglePageAsync(String locationName) { + private Mono> executeSinglePageAsync(String locationName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -121,7 +121,7 @@ private Mono> executeSinglePageAsync(St locationName, accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -145,7 +145,7 @@ private Mono> executeSinglePageAsync(St * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeSinglePageAsync( + private Mono> executeSinglePageAsync( String locationName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -193,7 +193,7 @@ private Mono> executeSinglePageAsync( * @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux executeAsync(String locationName) { + public PagedFlux executeAsync(String locationName) { return new PagedFlux<>( () -> executeSinglePageAsync(locationName), nextLink -> executeNextSinglePageAsync(nextLink)); } @@ -209,7 +209,7 @@ public PagedFlux executeAsync(String locationName) { * @return capabilities at specified location in a given subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux executeAsync(String locationName, Context context) { + private PagedFlux executeAsync(String locationName, Context context) { return new PagedFlux<>( () -> executeSinglePageAsync(locationName, context), nextLink -> executeNextSinglePageAsync(nextLink, context)); @@ -226,7 +226,7 @@ private PagedFlux executeAsync(String locationName, C * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable execute(String locationName) { + public PagedIterable execute(String locationName) { return new PagedIterable<>(executeAsync(locationName)); } @@ -242,7 +242,7 @@ public PagedIterable execute(String locationName) { * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable execute(String locationName, Context context) { + public PagedIterable execute(String locationName, Context context) { return new PagedIterable<>(executeAsync(locationName, context)); } @@ -254,10 +254,11 @@ public PagedIterable execute(String locationName, Con * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeNextSinglePageAsync(String nextLink) { + private Mono> executeNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -270,7 +271,7 @@ private Mono> executeNextSinglePageAsyn final String accept = "application/json"; return FluxUtil .withContext(context -> service.executeNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -291,10 +292,11 @@ private Mono> executeNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> executeNextSinglePageAsync( + private Mono> executeNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java index ea794b02808b..f05bef6bedf8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LocationBasedCapabilitiesImpl.java @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LocationBasedCapabilitiesClient; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityProperties; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerCapability; import com.azure.resourcemanager.postgresqlflexibleserver.models.LocationBasedCapabilities; public final class LocationBasedCapabilitiesImpl implements LocationBasedCapabilities { @@ -26,14 +26,14 @@ public LocationBasedCapabilitiesImpl( 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) { + PagedIterable inner = this.serviceClient().execute(locationName); + return Utils.mapPage(inner, inner1 -> new FlexibleServerCapabilityImpl(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())); + public PagedIterable execute(String locationName, Context context) { + PagedIterable inner = this.serviceClient().execute(locationName, context); + return Utils.mapPage(inner, inner1 -> new FlexibleServerCapabilityImpl(inner1, this.manager())); } private LocationBasedCapabilitiesClient serviceClient() { diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java new file mode 100644 index 000000000000..972c57d60e67 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFileImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFile; +import java.time.OffsetDateTime; + +public final class LogFileImpl implements LogFile { + private LogFileInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + LogFileImpl( + LogFileInner innerObject, com.azure.resourcemanager.postgresqlflexibleserver.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime createdTime() { + return this.innerModel().createdTime(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public Long sizeInKb() { + return this.innerModel().sizeInKb(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String url() { + return this.innerModel().url(); + } + + public LogFileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java new file mode 100644 index 000000000000..f6f737caa3cb --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesClientImpl.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.resourcemanager.postgresqlflexibleserver.fluent.LogFilesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner; +import com.azure.resourcemanager.postgresqlflexibleserver.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 { + /** 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") + public interface LogFilesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{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); + + @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); + } + + /** + * List all the server 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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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())); + } + + /** + * List all the server 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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the server 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 logFiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); + } + + /** + * List all the server 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 logFiles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync(String resourceGroupName, String serverName, Context context) { + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the server 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 logFiles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + } + + /** + * List all the server 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 logFiles as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 logFiles along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.java new file mode 100644 index 000000000000..5395cb92d993 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LogFilesImpl.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.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.LogFilesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFile; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogFiles; + +public final class LogFilesImpl implements LogFiles { + private static final ClientLogger LOGGER = new ClientLogger(LogFilesImpl.class); + + private final LogFilesClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public LogFilesImpl( + LogFilesClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java new file mode 100644 index 000000000000..332107034880 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsClientImpl.java @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.resourcemanager.postgresqlflexibleserver.fluent.LtrBackupOperationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrServerBackupOperationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LtrBackupOperationsClient. */ +public final class LtrBackupOperationsClientImpl implements LtrBackupOperationsClient { + /** The proxy service used to perform REST calls. */ + private final LtrBackupOperationsService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of LtrBackupOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LtrBackupOperationsClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy.create(LtrBackupOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientLtrBackupOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface LtrBackupOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations/{backupName}") + @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, + @PathParam("backupName") String backupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/ltrBackupOperations") + @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); + + @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 result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 result of the give long term retention backup operation for the flexible server along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String backupName) { + 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 (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + backupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @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 result of the give long term retention backup operation for the flexible server along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String backupName, 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 (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + backupName, + accept, + context); + } + + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 result of the give long term retention backup operation for the flexible server on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serverName, String backupName) { + return getWithResponseAsync(resourceGroupName, serverName, backupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @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 result of the give long term retention backup operation for the flexible server along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serverName, String backupName, Context context) { + return getWithResponseAsync(resourceGroupName, serverName, backupName, context).block(); + } + + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 result of the give long term retention backup operation for the flexible server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LtrServerBackupOperationInner get(String resourceGroupName, String serverName, String backupName) { + return getWithResponse(resourceGroupName, serverName, backupName, Context.NONE).getValue(); + } + + /** + * Gets the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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 the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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 the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); + } + + /** + * Gets the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server as paginated + * response with {@link PagedFlux}. + */ + @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 result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + } + + /** + * Gets the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server as paginated + * response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 long term retention backup operations for server along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 long term retention backup operations for server along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java new file mode 100644 index 000000000000..e5f797dcfb7a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupOperationsImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.LtrBackupOperationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupOperations; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrServerBackupOperation; + +public final class LtrBackupOperationsImpl implements LtrBackupOperations { + private static final ClientLogger LOGGER = new ClientLogger(LtrBackupOperationsImpl.class); + + private final LtrBackupOperationsClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public LtrBackupOperationsImpl( + LtrBackupOperationsClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serverName, String backupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serverName, backupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LtrServerBackupOperationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LtrServerBackupOperation get(String resourceGroupName, String serverName, String backupName) { + LtrServerBackupOperationInner inner = this.serviceClient().get(resourceGroupName, serverName, backupName); + if (inner != null) { + return new LtrServerBackupOperationImpl(inner, 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 LtrServerBackupOperationImpl(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 LtrServerBackupOperationImpl(inner1, this.manager())); + } + + private LtrBackupOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java new file mode 100644 index 000000000000..f83d22134bb3 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrBackupResponseImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupResponse; +import java.time.OffsetDateTime; + +public final class LtrBackupResponseImpl implements LtrBackupResponse { + private LtrBackupResponseInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + LtrBackupResponseImpl( + LtrBackupResponseInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Long datasourceSizeInBytes() { + return this.innerModel().datasourceSizeInBytes(); + } + + public Long dataTransferredInBytes() { + return this.innerModel().dataTransferredInBytes(); + } + + public String backupName() { + return this.innerModel().backupName(); + } + + public String backupMetadata() { + return this.innerModel().backupMetadata(); + } + + public ExecutionStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public String errorCode() { + return this.innerModel().errorCode(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public LtrBackupResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java new file mode 100644 index 000000000000..52e93387b43e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrPreBackupResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupResponse; + +public final class LtrPreBackupResponseImpl implements LtrPreBackupResponse { + private LtrPreBackupResponseInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + LtrPreBackupResponseImpl( + LtrPreBackupResponseInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public int numberOfContainers() { + return this.innerModel().numberOfContainers(); + } + + public LtrPreBackupResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.java new file mode 100644 index 000000000000..b2e21b253eef --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/LtrServerBackupOperationImpl.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrServerBackupOperation; +import java.time.OffsetDateTime; + +public final class LtrServerBackupOperationImpl implements LtrServerBackupOperation { + private LtrServerBackupOperationInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + LtrServerBackupOperationImpl( + LtrServerBackupOperationInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public Long datasourceSizeInBytes() { + return this.innerModel().datasourceSizeInBytes(); + } + + public Long dataTransferredInBytes() { + return this.innerModel().dataTransferredInBytes(); + } + + public String backupName() { + return this.innerModel().backupName(); + } + + public String backupMetadata() { + return this.innerModel().backupMetadata(); + } + + public ExecutionStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public String errorCode() { + return this.innerModel().errorCode(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public LtrServerBackupOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.java new file mode 100644 index 000000000000..21300cb9457a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationNameAvailabilityResourceImpl.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.postgresqlflexibleserver.implementation; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityReason; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityResource; + +public final class MigrationNameAvailabilityResourceImpl implements MigrationNameAvailabilityResource { + private MigrationNameAvailabilityResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + MigrationNameAvailabilityResourceImpl( + MigrationNameAvailabilityResourceInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public MigrationNameAvailabilityReason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public MigrationNameAvailabilityResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java new file mode 100644 index 000000000000..de1d60afc3c9 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationResourceImpl.java @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationOption; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceForPatch; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationStatus; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SourceType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class MigrationResourceImpl + implements MigrationResource, MigrationResource.Definition, MigrationResource.Update { + private MigrationResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.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 location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String migrationId() { + return this.innerModel().migrationId(); + } + + public MigrationStatus currentStatus() { + return this.innerModel().currentStatus(); + } + + public MigrationMode migrationMode() { + return this.innerModel().migrationMode(); + } + + public MigrationOption migrationOption() { + return this.innerModel().migrationOption(); + } + + public SourceType sourceType() { + return this.innerModel().sourceType(); + } + + public SslMode sslMode() { + return this.innerModel().sslMode(); + } + + public DbServerMetadata sourceDbServerMetadata() { + return this.innerModel().sourceDbServerMetadata(); + } + + public DbServerMetadata targetDbServerMetadata() { + return this.innerModel().targetDbServerMetadata(); + } + + public String sourceDbServerResourceId() { + return this.innerModel().sourceDbServerResourceId(); + } + + public String sourceDbServerFullyQualifiedDomainName() { + return this.innerModel().sourceDbServerFullyQualifiedDomainName(); + } + + public String targetDbServerResourceId() { + return this.innerModel().targetDbServerResourceId(); + } + + public String targetDbServerFullyQualifiedDomainName() { + return this.innerModel().targetDbServerFullyQualifiedDomainName(); + } + + public MigrationSecretParameters secretParameters() { + return this.innerModel().secretParameters(); + } + + public List dbsToMigrate() { + List inner = this.innerModel().dbsToMigrate(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded() { + return this.innerModel().setupLogicalReplicationOnSourceDbIfNeeded(); + } + + public OverwriteDbsInTargetEnum overwriteDbsInTarget() { + return this.innerModel().overwriteDbsInTarget(); + } + + public OffsetDateTime migrationWindowStartTimeInUtc() { + return this.innerModel().migrationWindowStartTimeInUtc(); + } + + public OffsetDateTime migrationWindowEndTimeInUtc() { + return this.innerModel().migrationWindowEndTimeInUtc(); + } + + public StartDataMigrationEnum startDataMigration() { + return this.innerModel().startDataMigration(); + } + + public TriggerCutoverEnum triggerCutover() { + return this.innerModel().triggerCutover(); + } + + public List dbsToTriggerCutoverOn() { + List inner = this.innerModel().dbsToTriggerCutoverOn(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CancelEnum cancel() { + return this.innerModel().cancel(); + } + + public List dbsToCancelMigrationOn() { + List inner = this.innerModel().dbsToCancelMigrationOn(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MigrationResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } + + private String subscriptionId; + + private String resourceGroupName; + + private String targetDbServerName; + + private String migrationName; + + private MigrationResourceForPatch updateParameters; + + public MigrationResourceImpl withExistingFlexibleServer( + String subscriptionId, String resourceGroupName, String targetDbServerName) { + this.subscriptionId = subscriptionId; + this.resourceGroupName = resourceGroupName; + this.targetDbServerName = targetDbServerName; + return this; + } + + public MigrationResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getMigrations() + .createWithResponse( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public MigrationResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMigrations() + .createWithResponse( + subscriptionId, resourceGroupName, targetDbServerName, migrationName, this.innerModel(), context) + .getValue(); + return this; + } + + MigrationResourceImpl( + String name, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = new MigrationResourceInner(); + this.serviceManager = serviceManager; + this.migrationName = name; + } + + public MigrationResourceImpl update() { + this.updateParameters = new MigrationResourceForPatch(); + return this; + } + + public MigrationResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMigrations() + .updateWithResponse( + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + updateParameters, + Context.NONE) + .getValue(); + return this; + } + + public MigrationResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMigrations() + .updateWithResponse( + subscriptionId, resourceGroupName, targetDbServerName, migrationName, updateParameters, context) + .getValue(); + return this; + } + + MigrationResourceImpl( + MigrationResourceInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.subscriptionId = Utils.getValueFromIdByName(innerObject.id(), "subscriptions"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.targetDbServerName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); + this.migrationName = Utils.getValueFromIdByName(innerObject.id(), "migrations"); + } + + public MigrationResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMigrations() + .getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, Context.NONE) + .getValue(); + return this; + } + + public MigrationResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMigrations() + .getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context) + .getValue(); + return this; + } + + public MigrationResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MigrationResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MigrationResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public MigrationResourceImpl withMigrationMode(MigrationMode migrationMode) { + if (isInCreateMode()) { + this.innerModel().withMigrationMode(migrationMode); + return this; + } else { + this.updateParameters.withMigrationMode(migrationMode); + return this; + } + } + + public MigrationResourceImpl withMigrationOption(MigrationOption migrationOption) { + this.innerModel().withMigrationOption(migrationOption); + return this; + } + + public MigrationResourceImpl withSourceType(SourceType sourceType) { + this.innerModel().withSourceType(sourceType); + return this; + } + + public MigrationResourceImpl withSslMode(SslMode sslMode) { + this.innerModel().withSslMode(sslMode); + return this; + } + + public MigrationResourceImpl withSourceDbServerResourceId(String sourceDbServerResourceId) { + if (isInCreateMode()) { + this.innerModel().withSourceDbServerResourceId(sourceDbServerResourceId); + return this; + } else { + this.updateParameters.withSourceDbServerResourceId(sourceDbServerResourceId); + return this; + } + } + + public MigrationResourceImpl withSourceDbServerFullyQualifiedDomainName( + String sourceDbServerFullyQualifiedDomainName) { + if (isInCreateMode()) { + this.innerModel().withSourceDbServerFullyQualifiedDomainName(sourceDbServerFullyQualifiedDomainName); + return this; + } else { + this.updateParameters.withSourceDbServerFullyQualifiedDomainName(sourceDbServerFullyQualifiedDomainName); + return this; + } + } + + public MigrationResourceImpl withTargetDbServerFullyQualifiedDomainName( + String targetDbServerFullyQualifiedDomainName) { + if (isInCreateMode()) { + this.innerModel().withTargetDbServerFullyQualifiedDomainName(targetDbServerFullyQualifiedDomainName); + return this; + } else { + this.updateParameters.withTargetDbServerFullyQualifiedDomainName(targetDbServerFullyQualifiedDomainName); + return this; + } + } + + public MigrationResourceImpl withSecretParameters(MigrationSecretParameters secretParameters) { + if (isInCreateMode()) { + this.innerModel().withSecretParameters(secretParameters); + return this; + } else { + this.updateParameters.withSecretParameters(secretParameters); + return this; + } + } + + public MigrationResourceImpl withDbsToMigrate(List dbsToMigrate) { + if (isInCreateMode()) { + this.innerModel().withDbsToMigrate(dbsToMigrate); + return this; + } else { + this.updateParameters.withDbsToMigrate(dbsToMigrate); + return this; + } + } + + public MigrationResourceImpl withSetupLogicalReplicationOnSourceDbIfNeeded( + LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded) { + if (isInCreateMode()) { + this.innerModel().withSetupLogicalReplicationOnSourceDbIfNeeded(setupLogicalReplicationOnSourceDbIfNeeded); + return this; + } else { + this + .updateParameters + .withSetupLogicalReplicationOnSourceDbIfNeeded(setupLogicalReplicationOnSourceDbIfNeeded); + return this; + } + } + + public MigrationResourceImpl withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget) { + if (isInCreateMode()) { + this.innerModel().withOverwriteDbsInTarget(overwriteDbsInTarget); + return this; + } else { + this.updateParameters.withOverwriteDbsInTarget(overwriteDbsInTarget); + return this; + } + } + + public MigrationResourceImpl withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc) { + if (isInCreateMode()) { + this.innerModel().withMigrationWindowStartTimeInUtc(migrationWindowStartTimeInUtc); + return this; + } else { + this.updateParameters.withMigrationWindowStartTimeInUtc(migrationWindowStartTimeInUtc); + return this; + } + } + + public MigrationResourceImpl withMigrationWindowEndTimeInUtc(OffsetDateTime migrationWindowEndTimeInUtc) { + this.innerModel().withMigrationWindowEndTimeInUtc(migrationWindowEndTimeInUtc); + return this; + } + + public MigrationResourceImpl withStartDataMigration(StartDataMigrationEnum startDataMigration) { + if (isInCreateMode()) { + this.innerModel().withStartDataMigration(startDataMigration); + return this; + } else { + this.updateParameters.withStartDataMigration(startDataMigration); + return this; + } + } + + public MigrationResourceImpl withTriggerCutover(TriggerCutoverEnum triggerCutover) { + if (isInCreateMode()) { + this.innerModel().withTriggerCutover(triggerCutover); + return this; + } else { + this.updateParameters.withTriggerCutover(triggerCutover); + return this; + } + } + + public MigrationResourceImpl withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn) { + if (isInCreateMode()) { + this.innerModel().withDbsToTriggerCutoverOn(dbsToTriggerCutoverOn); + return this; + } else { + this.updateParameters.withDbsToTriggerCutoverOn(dbsToTriggerCutoverOn); + return this; + } + } + + public MigrationResourceImpl withCancel(CancelEnum cancel) { + if (isInCreateMode()) { + this.innerModel().withCancel(cancel); + return this; + } else { + this.updateParameters.withCancel(cancel); + return this; + } + } + + public MigrationResourceImpl withDbsToCancelMigrationOn(List dbsToCancelMigrationOn) { + if (isInCreateMode()) { + this.innerModel().withDbsToCancelMigrationOn(dbsToCancelMigrationOn); + return this; + } else { + this.updateParameters.withDbsToCancelMigrationOn(dbsToCancelMigrationOn); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java new file mode 100644 index 000000000000..a95d22c2f150 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsClientImpl.java @@ -0,0 +1,1207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.MigrationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceForPatch; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MigrationsClient. */ +public final class MigrationsClientImpl implements MigrationsClient { + /** The proxy service used to perform REST calls. */ + private final MigrationsService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of MigrationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MigrationsClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy.create(MigrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientMigrations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface MigrationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetDbServerName") String targetDbServerName, + @PathParam("migrationName") String migrationName, + @BodyParam("application/json") MigrationResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}") + @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("targetDbServerName") String targetDbServerName, + @PathParam("migrationName") String migrationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetDbServerName") String targetDbServerName, + @PathParam("migrationName") String migrationName, + @BodyParam("application/json") MigrationResourceForPatch parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetDbServerName") String targetDbServerName, + @PathParam("migrationName") String migrationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTargetServer( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetDbServerName") String targetDbServerName, + @QueryParam("migrationListFilter") MigrationListFilter migrationListFilter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTargetServerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a new migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for creating a migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName 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 + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for creating a migration. + * @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 migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName 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 + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters, + accept, + context); + } + + /** + * Creates a new migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for creating a migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceInner parameters) { + return createWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for creating a migration. + * @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 migration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceInner parameters, + Context context) { + return createWithResponseAsync( + subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters, context) + .block(); + } + + /** + * Creates a new migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for creating a migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationResourceInner create( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceInner parameters) { + return createWithResponse( + subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters, Context.NONE) + .getValue(); + } + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a migration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 details of a migration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + accept, + context); + } + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a migration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) { + return getWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 details of a migration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context) { + return getWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context) + .block(); + } + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a migration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationResourceInner get( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) { + return getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, Context.NONE) + .getValue(); + } + + /** + * Updates an existing migration. The request body can contain one to many of the mutable properties present in the + * migration definition. Certain property updates initiate migration state transitions. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for updating a migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceForPatch parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName 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 + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing migration. The request body can contain one to many of the mutable properties present in the + * migration definition. Certain property updates initiate migration state transitions. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for updating a migration. + * @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 migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceForPatch parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName 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 + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + parameters, + accept, + context); + } + + /** + * Updates an existing migration. The request body can contain one to many of the mutable properties present in the + * migration definition. Certain property updates initiate migration state transitions. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for updating a migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceForPatch parameters) { + return updateWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates an existing migration. The request body can contain one to many of the mutable properties present in the + * migration definition. Certain property updates initiate migration state transitions. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for updating a migration. + * @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 migration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceForPatch parameters, + Context context) { + return updateWithResponseAsync( + subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters, context) + .block(); + } + + /** + * Updates an existing migration. The request body can contain one to many of the mutable properties present in the + * migration definition. Certain property updates initiate migration state transitions. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @param parameters The required parameters for updating a migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationResourceInner update( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + MigrationResourceForPatch parameters) { + return updateWithResponse( + subscriptionId, resourceGroupName, targetDbServerName, migrationName, parameters, Context.NONE) + .getValue(); + } + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationName, + accept, + context); + } + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) { + return deleteWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context) { + return deleteWithResponseAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context) + .block(); + } + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) { + deleteWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, Context.NONE); + } + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTargetServerSinglePageAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationListFilter migrationListFilter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTargetServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationListFilter, + 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())); + } + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations. + * @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 migration resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTargetServerSinglePageAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationListFilter migrationListFilter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTargetServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + migrationListFilter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByTargetServerAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationListFilter migrationListFilter) { + return new PagedFlux<>( + () -> + listByTargetServerSinglePageAsync( + subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter), + nextLink -> listByTargetServerNextSinglePageAsync(nextLink)); + } + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database 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 migration resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByTargetServerAsync( + String subscriptionId, String resourceGroupName, String targetDbServerName) { + final MigrationListFilter migrationListFilter = null; + return new PagedFlux<>( + () -> + listByTargetServerSinglePageAsync( + subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter), + nextLink -> listByTargetServerNextSinglePageAsync(nextLink)); + } + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations. + * @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 migration resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTargetServerAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationListFilter migrationListFilter, + Context context) { + return new PagedFlux<>( + () -> + listByTargetServerSinglePageAsync( + subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter, context), + nextLink -> listByTargetServerNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database 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 migration resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTargetServer( + String subscriptionId, String resourceGroupName, String targetDbServerName) { + final MigrationListFilter migrationListFilter = null; + return new PagedIterable<>( + listByTargetServerAsync(subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter)); + } + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations. + * @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 migration resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTargetServer( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationListFilter migrationListFilter, + Context context) { + return new PagedIterable<>( + listByTargetServerAsync( + subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 migration resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTargetServerNextSinglePageAsync(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.listByTargetServerNext(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 URL to get the next list of items + *

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 migration resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTargetServerNextSinglePageAsync( + 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 + .listByTargetServerNext(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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java new file mode 100644 index 000000000000..79b8bc8ee00b --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/MigrationsImpl.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.MigrationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Migrations; + +public final class MigrationsImpl implements Migrations { + private static final ClientLogger LOGGER = new ClientLogger(MigrationsImpl.class); + + private final MigrationsClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public MigrationsImpl( + MigrationsClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MigrationResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MigrationResource get( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) { + MigrationResourceInner inner = + this.serviceClient().get(subscriptionId, resourceGroupName, targetDbServerName, migrationName); + if (inner != null) { + return new MigrationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context); + } + + public void delete( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName) { + this.serviceClient().delete(subscriptionId, resourceGroupName, targetDbServerName, migrationName); + } + + public PagedIterable listByTargetServer( + String subscriptionId, String resourceGroupName, String targetDbServerName) { + PagedIterable inner = + this.serviceClient().listByTargetServer(subscriptionId, resourceGroupName, targetDbServerName); + return Utils.mapPage(inner, inner1 -> new MigrationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByTargetServer( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationListFilter migrationListFilter, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByTargetServer( + subscriptionId, resourceGroupName, targetDbServerName, migrationListFilter, context); + return Utils.mapPage(inner, inner1 -> new MigrationResourceImpl(inner1, this.manager())); + } + + public MigrationResource getById(String id) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 targetDbServerName = Utils.getValueFromIdByName(id, "flexibleServers"); + if (targetDbServerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String migrationName = Utils.getValueFromIdByName(id, "migrations"); + if (migrationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'migrations'.", id))); + } + return this + .getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 targetDbServerName = Utils.getValueFromIdByName(id, "flexibleServers"); + if (targetDbServerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String migrationName = Utils.getValueFromIdByName(id, "migrations"); + if (migrationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'migrations'.", id))); + } + return this.getWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context); + } + + public void deleteById(String id) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 targetDbServerName = Utils.getValueFromIdByName(id, "flexibleServers"); + if (targetDbServerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String migrationName = Utils.getValueFromIdByName(id, "migrations"); + if (migrationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'migrations'.", id))); + } + this.deleteWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String subscriptionId = Utils.getValueFromIdByName(id, "subscriptions"); + if (subscriptionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subscriptions'.", 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 targetDbServerName = Utils.getValueFromIdByName(id, "flexibleServers"); + if (targetDbServerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String migrationName = Utils.getValueFromIdByName(id, "migrations"); + if (migrationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'migrations'.", id))); + } + return this.deleteWithResponse(subscriptionId, resourceGroupName, targetDbServerName, migrationName, context); + } + + private MigrationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } + + public MigrationResourceImpl define(String name) { + return new MigrationResourceImpl(name, this.manager()); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientBuilder.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientBuilder.java index de27dc0ecf10..d348f8ddbe6a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientBuilder.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientBuilder.java @@ -18,12 +18,12 @@ @ServiceClientBuilder(serviceClients = {PostgreSqlManagementClientImpl.class}) public final class PostgreSqlManagementClientBuilder { /* - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The ID of the target subscription. + * Sets The ID of the target subscription. The value must be an UUID. * * @param subscriptionId the subscriptionId value. * @return the PostgreSqlManagementClientBuilder. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java index 1a56154fc0d4..ca5d0ca35e94 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PostgreSqlManagementClientImpl.java @@ -29,12 +29,24 @@ import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ConfigurationsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.DatabasesClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.FirewallRulesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.FlexibleServersClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LocationBasedCapabilitiesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LogFilesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.LtrBackupOperationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.MigrationsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.OperationsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PostgreSqlManagementClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PrivateEndpointConnectionOperationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.QuotaUsagesClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ReplicasClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ServerCapabilitiesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ServerThreatProtectionSettingsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ServersClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.VirtualEndpointsClient; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.VirtualNetworkSubnetUsagesClient; import java.io.IOException; import java.lang.reflect.Type; @@ -48,11 +60,11 @@ /** Initializes a new instance of the PostgreSqlManagementClientImpl type. */ @ServiceClient(builder = PostgreSqlManagementClientBuilder.class) public final class PostgreSqlManagementClientImpl implements PostgreSqlManagementClient { - /** The ID of the target subscription. */ + /** The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -156,6 +168,18 @@ public LocationBasedCapabilitiesClient getLocationBasedCapabilities() { return this.locationBasedCapabilities; } + /** The ServerCapabilitiesClient object to access its operations. */ + private final ServerCapabilitiesClient serverCapabilities; + + /** + * Gets the ServerCapabilitiesClient object to access its operations. + * + * @return the ServerCapabilitiesClient object. + */ + public ServerCapabilitiesClient getServerCapabilities() { + return this.serverCapabilities; + } + /** The CheckNameAvailabilitiesClient object to access its operations. */ private final CheckNameAvailabilitiesClient checkNameAvailabilities; @@ -228,6 +252,54 @@ public ServersClient getServers() { return this.servers; } + /** The FlexibleServersClient object to access its operations. */ + private final FlexibleServersClient flexibleServers; + + /** + * Gets the FlexibleServersClient object to access its operations. + * + * @return the FlexibleServersClient object. + */ + public FlexibleServersClient getFlexibleServers() { + return this.flexibleServers; + } + + /** The LtrBackupOperationsClient object to access its operations. */ + private final LtrBackupOperationsClient ltrBackupOperations; + + /** + * Gets the LtrBackupOperationsClient object to access its operations. + * + * @return the LtrBackupOperationsClient object. + */ + public LtrBackupOperationsClient getLtrBackupOperations() { + return this.ltrBackupOperations; + } + + /** The MigrationsClient object to access its operations. */ + private final MigrationsClient migrations; + + /** + * Gets the MigrationsClient object to access its operations. + * + * @return the MigrationsClient object. + */ + public MigrationsClient getMigrations() { + return this.migrations; + } + + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -252,6 +324,54 @@ public GetPrivateDnsZoneSuffixesClient getGetPrivateDnsZoneSuffixes() { return this.getPrivateDnsZoneSuffixes; } + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateEndpointConnectionOperationsClient object to access its operations. */ + private final PrivateEndpointConnectionOperationsClient privateEndpointConnectionOperations; + + /** + * Gets the PrivateEndpointConnectionOperationsClient object to access its operations. + * + * @return the PrivateEndpointConnectionOperationsClient object. + */ + public PrivateEndpointConnectionOperationsClient getPrivateEndpointConnectionOperations() { + return this.privateEndpointConnectionOperations; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The QuotaUsagesClient object to access its operations. */ + private final QuotaUsagesClient quotaUsages; + + /** + * Gets the QuotaUsagesClient object to access its operations. + * + * @return the QuotaUsagesClient object. + */ + public QuotaUsagesClient getQuotaUsages() { + return this.quotaUsages; + } + /** The ReplicasClient object to access its operations. */ private final ReplicasClient replicas; @@ -264,6 +384,42 @@ public ReplicasClient getReplicas() { return this.replicas; } + /** 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 ServerThreatProtectionSettingsClient object to access its operations. */ + private final ServerThreatProtectionSettingsClient serverThreatProtectionSettings; + + /** + * Gets the ServerThreatProtectionSettingsClient object to access its operations. + * + * @return the ServerThreatProtectionSettingsClient object. + */ + public ServerThreatProtectionSettingsClient getServerThreatProtectionSettings() { + return this.serverThreatProtectionSettings; + } + + /** The VirtualEndpointsClient object to access its operations. */ + private final VirtualEndpointsClient virtualEndpoints; + + /** + * Gets the VirtualEndpointsClient object to access its operations. + * + * @return the VirtualEndpointsClient object. + */ + public VirtualEndpointsClient getVirtualEndpoints() { + return this.virtualEndpoints; + } + /** The VirtualNetworkSubnetUsagesClient object to access its operations. */ private final VirtualNetworkSubnetUsagesClient virtualNetworkSubnetUsages; @@ -283,7 +439,7 @@ public VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ PostgreSqlManagementClientImpl( @@ -298,19 +454,31 @@ public VirtualNetworkSubnetUsagesClient getVirtualNetworkSubnetUsages() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-12-01"; + this.apiVersion = "2023-06-01-preview"; this.administrators = new AdministratorsClientImpl(this); this.backups = new BackupsClientImpl(this); this.locationBasedCapabilities = new LocationBasedCapabilitiesClientImpl(this); + this.serverCapabilities = new ServerCapabilitiesClientImpl(this); this.checkNameAvailabilities = new CheckNameAvailabilitiesClientImpl(this); this.checkNameAvailabilityWithLocations = new CheckNameAvailabilityWithLocationsClientImpl(this); this.configurations = new ConfigurationsClientImpl(this); this.databases = new DatabasesClientImpl(this); this.firewallRules = new FirewallRulesClientImpl(this); this.servers = new ServersClientImpl(this); + this.flexibleServers = new FlexibleServersClientImpl(this); + this.ltrBackupOperations = new LtrBackupOperationsClientImpl(this); + this.migrations = new MigrationsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); this.operations = new OperationsClientImpl(this); this.getPrivateDnsZoneSuffixes = new GetPrivateDnsZoneSuffixesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateEndpointConnectionOperations = new PrivateEndpointConnectionOperationsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.quotaUsages = new QuotaUsagesClientImpl(this); this.replicas = new ReplicasClientImpl(this); + this.logFiles = new LogFilesClientImpl(this); + this.serverThreatProtectionSettings = new ServerThreatProtectionSettingsClientImpl(this); + this.virtualEndpoints = new VirtualEndpointsClientImpl(this); this.virtualNetworkSubnetUsages = new VirtualNetworkSubnetUsagesClientImpl(this); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..a3d343b3b5e6 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpoint; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnection; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.List; + +public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsClientImpl.java new file mode 100644 index 000000000000..f11b26fa3703 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsClientImpl.java @@ -0,0 +1,696 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +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.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.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PrivateEndpointConnectionOperationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +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 PrivateEndpointConnectionOperationsClient. + */ +public final class PrivateEndpointConnectionOperationsClientImpl implements PrivateEndpointConnectionOperationsClient { + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionOperationsService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionOperationsClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientPrivateEndpointConnectionOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface PrivateEndpointConnectionOperationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201, 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("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({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, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + 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 (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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + privateEndpointConnectionName, + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + 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 (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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + privateEndpointConnectionName, + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, PrivateEndpointConnectionInner> beginUpdateAsync( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginUpdateAsync( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginUpdate( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return this + .beginUpdateAsync(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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginUpdate( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return this + .beginUpdateAsync(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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginUpdateAsync(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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginUpdateAsync(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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner update( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return updateAsync(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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner update( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return updateAsync(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 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 (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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + privateEndpointConnectionName, + 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 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 the {@link Response} on successful completion of {@link Mono}. + */ + @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 (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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + privateEndpointConnectionName, + 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 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public 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, this.client.getContext()); + } + + /** + * 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 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return this.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 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { + return this + .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 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 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 {@link Mono} that completes when a successful response is received. + */ + @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 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. + */ + @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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, serverName, privateEndpointConnectionName, context).block(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsImpl.java new file mode 100644 index 000000000000..60a82172e178 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionOperationsImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PrivateEndpointConnectionOperationsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnection; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionOperations; + +public final class PrivateEndpointConnectionOperationsImpl implements PrivateEndpointConnectionOperations { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionOperationsImpl.class); + + private final PrivateEndpointConnectionOperationsClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public PrivateEndpointConnectionOperationsImpl( + PrivateEndpointConnectionOperationsClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnection update( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + PrivateEndpointConnectionInner inner = + this.serviceClient().update(resourceGroupName, serverName, privateEndpointConnectionName, parameters); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnection update( + String resourceGroupName, + String serverName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + PrivateEndpointConnectionInner inner = + this + .serviceClient() + .update(resourceGroupName, serverName, privateEndpointConnectionName, parameters, context); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, 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); + } + + private PrivateEndpointConnectionOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..62bd4b6e74ca --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.resourcemanager.postgresqlflexibleserver.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionListResult; +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 { + /** 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") + public interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}") + @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, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateEndpointConnections") + @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); + + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 (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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + privateEndpointConnectionName, + 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 (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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + privateEndpointConnectionName, + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serverName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, serverName, privateEndpointConnectionName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, serverName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..1b507b8d20cb --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnection; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 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 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())); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..3273418deee7 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..9a4b0c6330df --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.resourcemanager.postgresqlflexibleserver.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.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 { + /** 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") + public interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateLinkResources") + @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); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/privateLinkResources/{groupName}") + @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, + @PathParam("groupName") String groupName, + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 (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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + groupName, + 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 (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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + groupName, + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String serverName, String groupName) { + return getWithResponseAsync(resourceGroupName, serverName, groupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serverName, String groupName, Context context) { + return getWithResponseAsync(resourceGroupName, serverName, groupName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, serverName, groupName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..b6ca6ee56503 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResources; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.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 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; + } + } + + 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; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.java new file mode 100644 index 000000000000..d795b500f458 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsageImpl.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.postgresqlflexibleserver.implementation; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.NameProperty; +import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsage; + +public final class QuotaUsageImpl implements QuotaUsage { + private QuotaUsageInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + QuotaUsageImpl( + QuotaUsageInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public NameProperty name() { + return this.innerModel().name(); + } + + public Long limit() { + return this.innerModel().limit(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public Long currentValue() { + return this.innerModel().currentValue(); + } + + public String id() { + return this.innerModel().id(); + } + + public QuotaUsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesClientImpl.java new file mode 100644 index 000000000000..fc74a0fd6773 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesClientImpl.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.resourcemanager.postgresqlflexibleserver.fluent.QuotaUsagesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsagesListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in QuotaUsagesClient. */ +public final class QuotaUsagesClientImpl implements QuotaUsagesClient { + /** The proxy service used to perform REST calls. */ + private final QuotaUsagesService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of QuotaUsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QuotaUsagesClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy.create(QuotaUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientQuotaUsages to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface QuotaUsagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/resourceType/flexibleServers/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get quota usages 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 quota usages at specified location in a given subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 + .list( + 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 quota usages 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 quota usages at specified location in a given subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 + .list( + 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 quota usages 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 quota usages at specified location in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String locationName) { + return new PagedFlux<>(() -> listSinglePageAsync(locationName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get quota usages 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 quota usages at specified location in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String locationName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(locationName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get quota usages 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 quota usages at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName) { + return new PagedIterable<>(listAsync(locationName)); + } + + /** + * Get quota usages 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 quota usages at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String locationName, Context context) { + return new PagedIterable<>(listAsync(locationName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 URL to get the next list of items + *

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 capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.java new file mode 100644 index 000000000000..981df117a518 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/QuotaUsagesImpl.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.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.QuotaUsagesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsage; +import com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsages; + +public final class QuotaUsagesImpl implements QuotaUsages { + private static final ClientLogger LOGGER = new ClientLogger(QuotaUsagesImpl.class); + + private final QuotaUsagesClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public QuotaUsagesImpl( + QuotaUsagesClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.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 QuotaUsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String locationName, Context context) { + PagedIterable inner = this.serviceClient().list(locationName, context); + return Utils.mapPage(inner, inner1 -> new QuotaUsageImpl(inner1, this.manager())); + } + + private QuotaUsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 000000000000..1f62ceee77a0 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientResourceProviders to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/checkMigrationNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkMigrationNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetDbServerName") String targetDbServerName, + @BodyParam("application/json") MigrationNameAvailabilityResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration name's availability along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> checkMigrationNameAvailabilityWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName 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 + .checkMigrationNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @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 migration name's availability along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkMigrationNameAvailabilityWithResponseAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetDbServerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetDbServerName 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 + .checkMigrationNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + resourceGroupName, + targetDbServerName, + parameters, + accept, + context); + } + + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration name's availability on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono checkMigrationNameAvailabilityAsync( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters) { + return checkMigrationNameAvailabilityWithResponseAsync( + subscriptionId, resourceGroupName, targetDbServerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @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 migration name's availability along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkMigrationNameAvailabilityWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters, + Context context) { + return checkMigrationNameAvailabilityWithResponseAsync( + subscriptionId, resourceGroupName, targetDbServerName, parameters, context) + .block(); + } + + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 migration name's availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationNameAvailabilityResourceInner checkMigrationNameAvailability( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters) { + return checkMigrationNameAvailabilityWithResponse( + subscriptionId, resourceGroupName, targetDbServerName, parameters, Context.NONE) + .getValue(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersImpl.java new file mode 100644 index 000000000000..1ebb02173024 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ResourceProvidersImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ResourceProviders; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkMigrationNameAvailabilityWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .checkMigrationNameAvailabilityWithResponse( + subscriptionId, resourceGroupName, targetDbServerName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MigrationNameAvailabilityResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MigrationNameAvailabilityResource checkMigrationNameAvailability( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters) { + MigrationNameAvailabilityResourceInner inner = + this + .serviceClient() + .checkMigrationNameAvailability(subscriptionId, resourceGroupName, targetDbServerName, parameters); + if (inner != null) { + return new MigrationNameAvailabilityResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesClientImpl.java new file mode 100644 index 000000000000..f5ba4a46fce8 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesClientImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.resourcemanager.postgresqlflexibleserver.fluent.ServerCapabilitiesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilitiesListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServerCapabilitiesClient. */ +public final class ServerCapabilitiesClientImpl implements ServerCapabilitiesClient { + /** The proxy service used to perform REST calls. */ + private final ServerCapabilitiesService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of ServerCapabilitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServerCapabilitiesClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy.create(ServerCapabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientServerCapabilities to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface ServerCapabilitiesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/capabilities") + @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("{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); + } + + /** + * Get capabilities for a flexible 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 capabilities for a flexible server along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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())); + } + + /** + * Get capabilities for a flexible 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 capabilities for a flexible server along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get capabilities for a flexible 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 capabilities for a flexible server as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serverName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get capabilities for a flexible 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 capabilities for a flexible server as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serverName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serverName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get capabilities for a flexible 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 capabilities for a flexible server as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serverName) { + return new PagedIterable<>(listAsync(resourceGroupName, serverName)); + } + + /** + * Get capabilities for a flexible 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 capabilities for a flexible server as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serverName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serverName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 URL to get the next list of items + *

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 capability for the PostgreSQL server along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesImpl.java new file mode 100644 index 000000000000..7cc384e08331 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerCapabilitiesImpl.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.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.ServerCapabilitiesClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerCapability; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerCapabilities; + +public final class ServerCapabilitiesImpl implements ServerCapabilities { + private static final ClientLogger LOGGER = new ClientLogger(ServerCapabilitiesImpl.class); + + private final ServerCapabilitiesClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public ServerCapabilitiesImpl( + ServerCapabilitiesClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.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 FlexibleServerCapabilityImpl(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 FlexibleServerCapabilityImpl(inner1, this.manager())); + } + + private ServerCapabilitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java index 1fa5786f71f7..4eb6e58f1e16 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerImpl.java @@ -7,6 +7,7 @@ import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerInner; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; @@ -16,6 +17,8 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnection; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica; import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole; import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; import com.azure.resourcemanager.postgresqlflexibleserver.models.Server; @@ -27,7 +30,9 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class ServerImpl implements Server, Server.Definition, Server.Update { private ServerInner innerObject; @@ -143,10 +148,28 @@ public Integer replicaCapacity() { return this.innerModel().replicaCapacity(); } + public Replica replica() { + return this.innerModel().replica(); + } + public CreateMode createMode() { return this.innerModel().createMode(); } + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -442,6 +465,11 @@ public ServerImpl withCreateMode(CreateModeForUpdate createMode) { return this; } + public ServerImpl withReplica(Replica replica) { + this.updateParameters.withReplica(replica); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsClientImpl.java new file mode 100644 index 000000000000..cf32e7de09d0 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsClientImpl.java @@ -0,0 +1,884 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.ServerThreatProtectionSettingsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionListResult; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; +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 ServerThreatProtectionSettingsClient. */ +public final class ServerThreatProtectionSettingsClientImpl implements ServerThreatProtectionSettingsClient { + /** The proxy service used to perform REST calls. */ + private final ServerThreatProtectionSettingsService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of ServerThreatProtectionSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServerThreatProtectionSettingsClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy + .create( + ServerThreatProtectionSettingsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientServerThreatProtectionSettings to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface ServerThreatProtectionSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings") + @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); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}") + @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, + @PathParam("threatProtectionName") ThreatProtectionName threatProtectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}") + @ExpectedResponses({200, 201}) + @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, + @PathParam("threatProtectionName") ThreatProtectionName threatProtectionName, + @BodyParam("application/json") ServerThreatProtectionSettingsModelInner 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); + } + + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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())); + } + + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByServerAsync( + String resourceGroupName, String serverName) { + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state as paginated response with {@link PagedFlux}. + */ + @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 a list of server's Threat Protection state. + * + * @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's Threat Protection state as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer( + String resourceGroupName, String serverName) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + } + + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer( + String resourceGroupName, String serverName, Context context) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context)); + } + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName) { + 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 (threatProtectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter threatProtectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + threatProtectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName, 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 (threatProtectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter threatProtectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + threatProtectionName, + accept, + context); + } + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName) { + return getWithResponseAsync(resourceGroupName, serverName, threatProtectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName, Context context) { + return getWithResponseAsync(resourceGroupName, serverName, threatProtectionName, context).block(); + } + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerThreatProtectionSettingsModelInner get( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName) { + return getWithResponse(resourceGroupName, serverName, threatProtectionName, Context.NONE).getValue(); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner 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 (threatProtectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter threatProtectionName 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 + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + threatProtectionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner 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 (threatProtectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter threatProtectionName 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 + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + threatProtectionName, + parameters, + accept, + context); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 {@link PollerFlux} for polling of server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ServerThreatProtectionSettingsModelInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serverName, threatProtectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServerThreatProtectionSettingsModelInner.class, + ServerThreatProtectionSettingsModelInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 {@link PollerFlux} for polling of server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServerThreatProtectionSettingsModelInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serverName, threatProtectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServerThreatProtectionSettingsModelInner.class, + ServerThreatProtectionSettingsModelInner.class, + context); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 {@link SyncPoller} for polling of server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerThreatProtectionSettingsModelInner> + beginCreateOrUpdate( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serverName, threatProtectionName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 {@link SyncPoller} for polling of server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServerThreatProtectionSettingsModelInner> + beginCreateOrUpdate( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serverName, threatProtectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serverName, threatProtectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serverName, threatProtectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerThreatProtectionSettingsModelInner createOrUpdate( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters) { + return createOrUpdateAsync(resourceGroupName, serverName, threatProtectionName, parameters).block(); + } + + /** + * Creates or updates a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection state. + * @param parameters The Advanced Threat Protection state for the flexible 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 server's Advanced Threat Protection settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerThreatProtectionSettingsModelInner createOrUpdate( + String resourceGroupName, + String serverName, + ThreatProtectionName threatProtectionName, + ServerThreatProtectionSettingsModelInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, serverName, threatProtectionName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 Advanced Threat Protection settings along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 Advanced Threat Protection settings along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsImpl.java new file mode 100644 index 000000000000..ab40f7691725 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.ServerThreatProtectionSettingsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettings; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; + +public final class ServerThreatProtectionSettingsImpl implements ServerThreatProtectionSettings { + private static final ClientLogger LOGGER = new ClientLogger(ServerThreatProtectionSettingsImpl.class); + + private final ServerThreatProtectionSettingsClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public ServerThreatProtectionSettingsImpl( + ServerThreatProtectionSettingsClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.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 ServerThreatProtectionSettingsModelImpl(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 ServerThreatProtectionSettingsModelImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serverName, threatProtectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServerThreatProtectionSettingsModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServerThreatProtectionSettingsModel get( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName) { + ServerThreatProtectionSettingsModelInner inner = + this.serviceClient().get(resourceGroupName, serverName, threatProtectionName); + if (inner != null) { + return new ServerThreatProtectionSettingsModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public ServerThreatProtectionSettingsModel 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, "flexibleServers"); + if (serverName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String threatProtectionNameLocal = Utils.getValueFromIdByName(id, "advancedThreatProtectionSettings"); + if (threatProtectionNameLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'advancedThreatProtectionSettings'.", + id))); + } + ThreatProtectionName threatProtectionName = ThreatProtectionName.fromString(threatProtectionNameLocal); + return this.getWithResponse(resourceGroupName, serverName, threatProtectionName, 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, "flexibleServers"); + if (serverName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String threatProtectionNameLocal = Utils.getValueFromIdByName(id, "advancedThreatProtectionSettings"); + if (threatProtectionNameLocal == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'advancedThreatProtectionSettings'.", + id))); + } + ThreatProtectionName threatProtectionName = ThreatProtectionName.fromString(threatProtectionNameLocal); + return this.getWithResponse(resourceGroupName, serverName, threatProtectionName, context); + } + + private ServerThreatProtectionSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } + + public ServerThreatProtectionSettingsModelImpl define(ThreatProtectionName name) { + return new ServerThreatProtectionSettingsModelImpl(name, this.manager()); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsModelImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsModelImpl.java new file mode 100644 index 000000000000..27353eba405a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/ServerThreatProtectionSettingsModelImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; +import java.time.OffsetDateTime; + +public final class ServerThreatProtectionSettingsModelImpl + implements ServerThreatProtectionSettingsModel, + ServerThreatProtectionSettingsModel.Definition, + ServerThreatProtectionSettingsModel.Update { + private ServerThreatProtectionSettingsModelInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ThreatProtectionState state() { + return this.innerModel().state(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ServerThreatProtectionSettingsModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serverName; + + private ThreatProtectionName threatProtectionName; + + public ServerThreatProtectionSettingsModelImpl withExistingFlexibleServer( + String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + public ServerThreatProtectionSettingsModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getServerThreatProtectionSettings() + .createOrUpdate(resourceGroupName, serverName, threatProtectionName, this.innerModel(), Context.NONE); + return this; + } + + public ServerThreatProtectionSettingsModel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServerThreatProtectionSettings() + .createOrUpdate(resourceGroupName, serverName, threatProtectionName, this.innerModel(), context); + return this; + } + + ServerThreatProtectionSettingsModelImpl( + ThreatProtectionName name, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = new ServerThreatProtectionSettingsModelInner(); + this.serviceManager = serviceManager; + this.threatProtectionName = name; + } + + public ServerThreatProtectionSettingsModelImpl update() { + return this; + } + + public ServerThreatProtectionSettingsModel apply() { + this.innerObject = + serviceManager + .serviceClient() + .getServerThreatProtectionSettings() + .createOrUpdate(resourceGroupName, serverName, threatProtectionName, this.innerModel(), Context.NONE); + return this; + } + + public ServerThreatProtectionSettingsModel apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServerThreatProtectionSettings() + .createOrUpdate(resourceGroupName, serverName, threatProtectionName, this.innerModel(), context); + return this; + } + + ServerThreatProtectionSettingsModelImpl( + ServerThreatProtectionSettingsModelInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); + this.threatProtectionName = + ThreatProtectionName + .fromString(Utils.getValueFromIdByName(innerObject.id(), "advancedThreatProtectionSettings")); + } + + public ServerThreatProtectionSettingsModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getServerThreatProtectionSettings() + .getWithResponse(resourceGroupName, serverName, threatProtectionName, Context.NONE) + .getValue(); + return this; + } + + public ServerThreatProtectionSettingsModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServerThreatProtectionSettings() + .getWithResponse(resourceGroupName, serverName, threatProtectionName, context) + .getValue(); + return this; + } + + public ServerThreatProtectionSettingsModelImpl withState(ThreatProtectionState state) { + this.innerModel().withState(state); + return this; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/Utils.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/Utils.java index 560a00f0b9f4..8a324141cf71 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/Utils.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/Utils.java @@ -20,6 +20,9 @@ import reactor.core.publisher.Flux; final class Utils { + private Utils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -133,30 +136,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +198,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointResourceImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointResourceImpl.java new file mode 100644 index 000000000000..a31d64ca5182 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointResourceImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResourceForPatch; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; +import java.util.Collections; +import java.util.List; + +public final class VirtualEndpointResourceImpl + implements VirtualEndpointResource, VirtualEndpointResource.Definition, VirtualEndpointResource.Update { + private VirtualEndpointResourceInner innerObject; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public VirtualEndpointType endpointType() { + return this.innerModel().endpointType(); + } + + public List members() { + List inner = this.innerModel().members(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List virtualEndpoints() { + List inner = this.innerModel().virtualEndpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VirtualEndpointResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serverName; + + private String virtualEndpointName; + + private VirtualEndpointResourceForPatch updateParameters; + + public VirtualEndpointResourceImpl withExistingFlexibleServer(String resourceGroupName, String serverName) { + this.resourceGroupName = resourceGroupName; + this.serverName = serverName; + return this; + } + + public VirtualEndpointResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualEndpoints() + .create(resourceGroupName, serverName, virtualEndpointName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualEndpointResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualEndpoints() + .create(resourceGroupName, serverName, virtualEndpointName, this.innerModel(), context); + return this; + } + + VirtualEndpointResourceImpl( + String name, com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = new VirtualEndpointResourceInner(); + this.serviceManager = serviceManager; + this.virtualEndpointName = name; + } + + public VirtualEndpointResourceImpl update() { + this.updateParameters = new VirtualEndpointResourceForPatch(); + return this; + } + + public VirtualEndpointResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualEndpoints() + .update(resourceGroupName, serverName, virtualEndpointName, updateParameters, Context.NONE); + return this; + } + + public VirtualEndpointResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualEndpoints() + .update(resourceGroupName, serverName, virtualEndpointName, updateParameters, context); + return this; + } + + VirtualEndpointResourceImpl( + VirtualEndpointResourceInner innerObject, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serverName = Utils.getValueFromIdByName(innerObject.id(), "flexibleServers"); + this.virtualEndpointName = Utils.getValueFromIdByName(innerObject.id(), "virtualendpoints"); + } + + public VirtualEndpointResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualEndpoints() + .getWithResponse(resourceGroupName, serverName, virtualEndpointName, Context.NONE) + .getValue(); + return this; + } + + public VirtualEndpointResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualEndpoints() + .getWithResponse(resourceGroupName, serverName, virtualEndpointName, context) + .getValue(); + return this; + } + + public VirtualEndpointResourceImpl withEndpointType(VirtualEndpointType endpointType) { + if (isInCreateMode()) { + this.innerModel().withEndpointType(endpointType); + return this; + } else { + this.updateParameters.withEndpointType(endpointType); + return this; + } + } + + public VirtualEndpointResourceImpl withMembers(List members) { + if (isInCreateMode()) { + this.innerModel().withMembers(members); + return this; + } else { + this.updateParameters.withMembers(members); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsClientImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsClientImpl.java new file mode 100644 index 000000000000..ae417c8fdb61 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsClientImpl.java @@ -0,0 +1,1494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.VirtualEndpointsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResourceForPatch; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointsListResult; +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 VirtualEndpointsClient. */ +public final class VirtualEndpointsClientImpl implements VirtualEndpointsClient { + /** The proxy service used to perform REST calls. */ + private final VirtualEndpointsService service; + + /** The service client containing this operation class. */ + private final PostgreSqlManagementClientImpl client; + + /** + * Initializes an instance of VirtualEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualEndpointsClientImpl(PostgreSqlManagementClientImpl client) { + this.service = + RestProxy.create(VirtualEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PostgreSqlManagementClientVirtualEndpoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PostgreSqlManagement") + public interface VirtualEndpointsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serverName") String serverName, + @PathParam("virtualEndpointName") String virtualEndpointName, + @BodyParam("application/json") VirtualEndpointResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}") + @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("virtualEndpointName") String virtualEndpointName, + @BodyParam("application/json") VirtualEndpointResourceForPatch parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}") + @ExpectedResponses({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, + @PathParam("virtualEndpointName") String virtualEndpointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints/{virtualEndpointName}") + @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, + @PathParam("virtualEndpointName") String virtualEndpointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/virtualendpoints") + @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); + + @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); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual endpoint for a server along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createWithResponseAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner 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 (virtualEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualEndpointName 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 + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + virtualEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 virtual endpoint for a server along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner 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 (virtualEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualEndpointName 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 + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + virtualEndpointName, + parameters, + accept, + context); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link PollerFlux} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, VirtualEndpointResourceInner> beginCreateAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, serverName, virtualEndpointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualEndpointResourceInner.class, + VirtualEndpointResourceInner.class, + this.client.getContext()); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 {@link PollerFlux} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualEndpointResourceInner> beginCreateAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, serverName, virtualEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualEndpointResourceInner.class, + VirtualEndpointResourceInner.class, + context); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link SyncPoller} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualEndpointResourceInner> beginCreate( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters) { + return this.beginCreateAsync(resourceGroupName, serverName, virtualEndpointName, parameters).getSyncPoller(); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 {@link SyncPoller} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualEndpointResourceInner> beginCreate( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters, + Context context) { + return this + .beginCreateAsync(resourceGroupName, serverName, virtualEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual endpoint for a server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters) { + return beginCreateAsync(resourceGroupName, serverName, virtualEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 virtual endpoint for a server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, serverName, virtualEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualEndpointResourceInner create( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters) { + return createAsync(resourceGroupName, serverName, virtualEndpointName, parameters).block(); + } + + /** + * Creates a new virtual endpoint for PostgreSQL flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for creating or updating virtual endpoints. + * @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 virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualEndpointResourceInner create( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceInner parameters, + Context context) { + return createAsync(resourceGroupName, serverName, virtualEndpointName, parameters, context).block(); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch 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 (virtualEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualEndpointName 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 + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + virtualEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch 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 (virtualEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualEndpointName 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 + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + virtualEndpointName, + parameters, + accept, + context); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 the {@link PollerFlux} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, VirtualEndpointResourceInner> beginUpdateAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serverName, virtualEndpointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualEndpointResourceInner.class, + VirtualEndpointResourceInner.class, + this.client.getContext()); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 the {@link PollerFlux} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualEndpointResourceInner> beginUpdateAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serverName, virtualEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualEndpointResourceInner.class, + VirtualEndpointResourceInner.class, + context); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 the {@link SyncPoller} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualEndpointResourceInner> beginUpdate( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters) { + return this.beginUpdateAsync(resourceGroupName, serverName, virtualEndpointName, parameters).getSyncPoller(); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 the {@link SyncPoller} for polling of represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualEndpointResourceInner> beginUpdate( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, serverName, virtualEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters) { + return beginUpdateAsync(resourceGroupName, serverName, virtualEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serverName, virtualEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualEndpointResourceInner update( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters) { + return updateAsync(resourceGroupName, serverName, virtualEndpointName, parameters).block(); + } + + /** + * Updates an existing virtual endpoint. The request body can contain one to many of the properties present in the + * normal virtual endpoint definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @param parameters The required parameters for 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 represents a virtual endpoint for a server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualEndpointResourceInner update( + String resourceGroupName, + String serverName, + String virtualEndpointName, + VirtualEndpointResourceForPatch parameters, + Context context) { + return updateAsync(resourceGroupName, serverName, virtualEndpointName, parameters, context).block(); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String serverName, String virtualEndpointName) { + 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 (virtualEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + virtualEndpointName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serverName, String virtualEndpointName, 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 (virtualEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + virtualEndpointName, + accept, + context); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serverName, String virtualEndpointName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serverName, virtualEndpointName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serverName, String virtualEndpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serverName, virtualEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serverName, String virtualEndpointName) { + return this.beginDeleteAsync(resourceGroupName, serverName, virtualEndpointName).getSyncPoller(); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serverName, String virtualEndpointName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serverName, virtualEndpointName, context).getSyncPoller(); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serverName, String virtualEndpointName) { + return beginDeleteAsync(resourceGroupName, serverName, virtualEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String serverName, String virtualEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, serverName, virtualEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 virtualEndpointName) { + deleteAsync(resourceGroupName, serverName, virtualEndpointName).block(); + } + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtualEndpointName, Context context) { + deleteAsync(resourceGroupName, serverName, virtualEndpointName, context).block(); + } + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual endpoint along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String virtualEndpointName) { + 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 (virtualEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + virtualEndpointName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtual endpoint along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serverName, String virtualEndpointName, 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 (virtualEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + virtualEndpointName, + accept, + context); + } + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual endpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serverName, String virtualEndpointName) { + return getWithResponseAsync(resourceGroupName, serverName, virtualEndpointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtual endpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serverName, String virtualEndpointName, Context context) { + return getWithResponseAsync(resourceGroupName, serverName, virtualEndpointName, context).block(); + } + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualEndpointResourceInner get(String resourceGroupName, String serverName, String virtualEndpointName) { + return getWithResponse(resourceGroupName, serverName, virtualEndpointName, Context.NONE).getValue(); + } + + /** + * List all the servers in a given resource group. + * + * @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 endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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())); + } + + /** + * List all the servers in a given resource group. + * + * @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 endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByServer( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serverName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the servers in a given resource group. + * + * @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 endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByServerAsync(String resourceGroupName, String serverName) { + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName), + nextLink -> listByServerNextSinglePageAsync(nextLink)); + } + + /** + * List all the servers in a given resource group. + * + * @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 endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServerAsync( + String resourceGroupName, String serverName, Context context) { + return new PagedFlux<>( + () -> listByServerSinglePageAsync(resourceGroupName, serverName, context), + nextLink -> listByServerNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the servers in a given resource group. + * + * @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 endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByServer(String resourceGroupName, String serverName) { + return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName)); + } + + /** + * List all the servers in a given resource group. + * + * @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 endpoints as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsImpl.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsImpl.java new file mode 100644 index 000000000000..379eabf0ac85 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/implementation/VirtualEndpointsImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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.postgresqlflexibleserver.fluent.VirtualEndpointsClient; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpoints; + +public final class VirtualEndpointsImpl implements VirtualEndpoints { + private static final ClientLogger LOGGER = new ClientLogger(VirtualEndpointsImpl.class); + + private final VirtualEndpointsClient innerClient; + + private final com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager; + + public VirtualEndpointsImpl( + VirtualEndpointsClient innerClient, + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String serverName, String virtualEndpointName) { + this.serviceClient().delete(resourceGroupName, serverName, virtualEndpointName); + } + + public void delete(String resourceGroupName, String serverName, String virtualEndpointName, Context context) { + this.serviceClient().delete(resourceGroupName, serverName, virtualEndpointName, context); + } + + public Response getWithResponse( + String resourceGroupName, String serverName, String virtualEndpointName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serverName, virtualEndpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualEndpointResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualEndpointResource get(String resourceGroupName, String serverName, String virtualEndpointName) { + VirtualEndpointResourceInner inner = + this.serviceClient().get(resourceGroupName, serverName, virtualEndpointName); + if (inner != null) { + return new VirtualEndpointResourceImpl(inner, 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 VirtualEndpointResourceImpl(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 VirtualEndpointResourceImpl(inner1, this.manager())); + } + + public VirtualEndpointResource 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, "flexibleServers"); + if (serverName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String virtualEndpointName = Utils.getValueFromIdByName(id, "virtualendpoints"); + if (virtualEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualendpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, serverName, virtualEndpointName, 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, "flexibleServers"); + if (serverName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String virtualEndpointName = Utils.getValueFromIdByName(id, "virtualendpoints"); + if (virtualEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualendpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, serverName, virtualEndpointName, 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, "flexibleServers"); + if (serverName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String virtualEndpointName = Utils.getValueFromIdByName(id, "virtualendpoints"); + if (virtualEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualendpoints'.", id))); + } + this.delete(resourceGroupName, serverName, virtualEndpointName, 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, "flexibleServers"); + if (serverName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'flexibleServers'.", id))); + } + String virtualEndpointName = Utils.getValueFromIdByName(id, "virtualendpoints"); + if (virtualEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualendpoints'.", id))); + } + this.delete(resourceGroupName, serverName, virtualEndpointName, context); + } + + private VirtualEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager() { + return this.serviceManager; + } + + public VirtualEndpointResourceImpl define(String name) { + return new VirtualEndpointResourceImpl(name, this.manager()); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdminCredentials.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdminCredentials.java new file mode 100644 index 000000000000..cdd0bc37ed21 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AdminCredentials.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Server admin credentials. */ +@Fluent +public final class AdminCredentials { + /* + * Password for source server. + */ + @JsonProperty(value = "sourceServerPassword") + private String sourceServerPassword; + + /* + * Password for target server. + */ + @JsonProperty(value = "targetServerPassword") + private String targetServerPassword; + + /** Creates an instance of AdminCredentials class. */ + public AdminCredentials() { + } + + /** + * Get the sourceServerPassword property: Password for source server. + * + * @return the sourceServerPassword value. + */ + public String sourceServerPassword() { + return this.sourceServerPassword; + } + + /** + * Set the sourceServerPassword property: Password for source server. + * + * @param sourceServerPassword the sourceServerPassword value to set. + * @return the AdminCredentials object itself. + */ + public AdminCredentials withSourceServerPassword(String sourceServerPassword) { + this.sourceServerPassword = sourceServerPassword; + return this; + } + + /** + * Get the targetServerPassword property: Password for target server. + * + * @return the targetServerPassword value. + */ + public String targetServerPassword() { + return this.targetServerPassword; + } + + /** + * Set the targetServerPassword property: Password for target server. + * + * @param targetServerPassword the targetServerPassword value to set. + * @return the AdminCredentials object itself. + */ + public AdminCredentials withTargetServerPassword(String targetServerPassword) { + this.targetServerPassword = targetServerPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceServerPassword() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceServerPassword in model AdminCredentials")); + } + if (targetServerPassword() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetServerPassword in model AdminCredentials")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AdminCredentials.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AzureManagedDiskPerformanceTiers.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AzureManagedDiskPerformanceTiers.java new file mode 100644 index 000000000000..e80e0b4d57ec --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/AzureManagedDiskPerformanceTiers.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Name of storage tier for IOPS. */ +public final class AzureManagedDiskPerformanceTiers extends ExpandableStringEnum { + /** Static value P1 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P1 = fromString("P1"); + + /** Static value P2 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P2 = fromString("P2"); + + /** Static value P3 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P3 = fromString("P3"); + + /** Static value P4 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P4 = fromString("P4"); + + /** Static value P6 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P6 = fromString("P6"); + + /** Static value P10 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P10 = fromString("P10"); + + /** Static value P15 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P15 = fromString("P15"); + + /** Static value P20 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P20 = fromString("P20"); + + /** Static value P30 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P30 = fromString("P30"); + + /** Static value P40 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P40 = fromString("P40"); + + /** Static value P50 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P50 = fromString("P50"); + + /** Static value P60 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P60 = fromString("P60"); + + /** Static value P70 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P70 = fromString("P70"); + + /** Static value P80 for AzureManagedDiskPerformanceTiers. */ + public static final AzureManagedDiskPerformanceTiers P80 = fromString("P80"); + + /** + * Creates a new instance of AzureManagedDiskPerformanceTiers value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureManagedDiskPerformanceTiers() { + } + + /** + * Creates or finds a AzureManagedDiskPerformanceTiers from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureManagedDiskPerformanceTiers. + */ + @JsonCreator + public static AzureManagedDiskPerformanceTiers fromString(String name) { + return fromString(name, AzureManagedDiskPerformanceTiers.class); + } + + /** + * Gets known AzureManagedDiskPerformanceTiers values. + * + * @return known AzureManagedDiskPerformanceTiers values. + */ + public static Collection values() { + return values(AzureManagedDiskPerformanceTiers.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupRequestBase.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupRequestBase.java new file mode 100644 index 000000000000..2d3439b46147 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupRequestBase.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BackupRequestBase is the base for all backup request. */ +@Fluent +public class BackupRequestBase { + /* + * Backup Settings + */ + @JsonProperty(value = "backupSettings", required = true) + private BackupSettings backupSettings; + + /** Creates an instance of BackupRequestBase class. */ + public BackupRequestBase() { + } + + /** + * Get the backupSettings property: Backup Settings. + * + * @return the backupSettings value. + */ + public BackupSettings backupSettings() { + return this.backupSettings; + } + + /** + * Set the backupSettings property: Backup Settings. + * + * @param backupSettings the backupSettings value to set. + * @return the BackupRequestBase object itself. + */ + public BackupRequestBase withBackupSettings(BackupSettings backupSettings) { + this.backupSettings = backupSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backupSettings() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property backupSettings in model BackupRequestBase")); + } else { + backupSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BackupRequestBase.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupSettings.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupSettings.java new file mode 100644 index 000000000000..588994cbd067 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupSettings.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The settings for the long term backup. */ +@Fluent +public final class BackupSettings { + /* + * Backup Name for the current backup + */ + @JsonProperty(value = "backupName", required = true) + private String backupName; + + /** Creates an instance of BackupSettings class. */ + public BackupSettings() { + } + + /** + * Get the backupName property: Backup Name for the current backup. + * + * @return the backupName value. + */ + public String backupName() { + return this.backupName; + } + + /** + * Set the backupName property: Backup Name for the current backup. + * + * @param backupName the backupName value to set. + * @return the BackupSettings object itself. + */ + public BackupSettings withBackupName(String backupName) { + this.backupName = backupName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backupName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property backupName in model BackupSettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BackupSettings.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupStoreDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupStoreDetails.java new file mode 100644 index 000000000000..8a316146cffe --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/BackupStoreDetails.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details about the target where the backup content will be stored. */ +@Fluent +public final class BackupStoreDetails { + /* + * List of SAS uri of storage containers where backup data is to be streamed/copied. + */ + @JsonProperty(value = "sasUriList", required = true) + private List sasUriList; + + /** Creates an instance of BackupStoreDetails class. */ + public BackupStoreDetails() { + } + + /** + * Get the sasUriList property: List of SAS uri of storage containers where backup data is to be streamed/copied. + * + * @return the sasUriList value. + */ + public List sasUriList() { + return this.sasUriList; + } + + /** + * Set the sasUriList property: List of SAS uri of storage containers where backup data is to be streamed/copied. + * + * @param sasUriList the sasUriList value to set. + * @return the BackupStoreDetails object itself. + */ + public BackupStoreDetails withSasUriList(List sasUriList) { + this.sasUriList = sasUriList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasUriList() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sasUriList in model BackupStoreDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BackupStoreDetails.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CancelEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CancelEnum.java new file mode 100644 index 000000000000..5a1080851aa7 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CancelEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** To trigger cancel for entire migration we need to send this flag as True. */ +public final class CancelEnum extends ExpandableStringEnum { + /** Static value True for CancelEnum. */ + public static final CancelEnum TRUE = fromString("True"); + + /** Static value False for CancelEnum. */ + public static final CancelEnum FALSE = fromString("False"); + + /** + * Creates a new instance of CancelEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CancelEnum() { + } + + /** + * Creates or finds a CancelEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding CancelEnum. + */ + @JsonCreator + public static CancelEnum fromString(String name) { + return fromString(name, CancelEnum.class); + } + + /** + * Gets known CancelEnum values. + * + * @return known CancelEnum values. + */ + public static Collection values() { + return values(CancelEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilitiesListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilitiesListResult.java index 632d3764929e..f38de622b079 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilitiesListResult.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilitiesListResult.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.postgresqlflexibleserver.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** location capability. */ +/** Capability for the PostgreSQL server. */ @Immutable public final class CapabilitiesListResult { /* * 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. @@ -33,7 +33,7 @@ public CapabilitiesListResult() { * * @return the value value. */ - public List value() { + public List value() { return this.value; } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityBase.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityBase.java new file mode 100644 index 000000000000..a006ffc7070b --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityBase.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Base object for representing capability. */ +@Immutable +public class CapabilityBase { + /* + * The status of the capability. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CapabilityStatus status; + + /* + * The reason for the capability not being available. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** Creates an instance of CapabilityBase class. */ + public CapabilityBase() { + } + + /** + * Get the status property: The status of the capability. + * + * @return the status value. + */ + public CapabilityStatus status() { + return this.status; + } + + /** + * Get the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityProperties.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityProperties.java deleted file mode 100644 index 3f51899df3e8..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityProperties.java +++ /dev/null @@ -1,92 +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.postgresqlflexibleserver.models; - -import com.azure.resourcemanager.postgresqlflexibleserver.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 supportedHAMode property: Supported high availability mode. - * - * @return the supportedHAMode value. - */ - List supportedHAMode(); - - /** - * Gets the geoBackupSupported property: A value indicating whether a new server in this region can have geo-backups - * to paired region. - * - * @return the geoBackupSupported value. - */ - Boolean geoBackupSupported(); - - /** - * Gets the zoneRedundantHaSupported property: A value indicating whether a new server in this region can support - * multi zone HA. - * - * @return the zoneRedundantHaSupported value. - */ - Boolean zoneRedundantHaSupported(); - - /** - * Gets the zoneRedundantHaAndGeoBackupSupported property: A value indicating whether a new server in this region - * can have geo-backups to paired region. - * - * @return the zoneRedundantHaAndGeoBackupSupported value. - */ - Boolean zoneRedundantHaAndGeoBackupSupported(); - - /** - * Gets the supportedFlexibleServerEditions property: The supportedFlexibleServerEditions property. - * - * @return the supportedFlexibleServerEditions value. - */ - List supportedFlexibleServerEditions(); - - /** - * Gets the supportedHyperscaleNodeEditions property: The supportedHyperscaleNodeEditions property. - * - * @return the supportedHyperscaleNodeEditions value. - */ - List supportedHyperscaleNodeEditions(); - - /** - * Gets the fastProvisioningSupported property: A value indicating whether fast provisioning is supported in this - * region. - * - * @return the fastProvisioningSupported value. - */ - Boolean fastProvisioningSupported(); - - /** - * Gets the supportedFastProvisioningEditions property: The supportedFastProvisioningEditions property. - * - * @return the supportedFastProvisioningEditions value. - */ - List supportedFastProvisioningEditions(); - - /** - * Gets the status property: The status. - * - * @return the status value. - */ - String status(); - - /** - * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner object. - * - * @return the inner object. - */ - CapabilityPropertiesInner innerModel(); -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityStatus.java new file mode 100644 index 000000000000..62faf1de1eaf --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CapabilityStatus.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The status of the capability. */ +public enum CapabilityStatus { + /** Enum value Visible. */ + VISIBLE("Visible"), + + /** Enum value Available. */ + AVAILABLE("Available"), + + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a CapabilityStatus instance. */ + private final String value; + + CapabilityStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CapabilityStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed CapabilityStatus object, or null if unable to parse. + */ + @JsonCreator + public static CapabilityStatus fromString(String value) { + if (value == null) { + return null; + } + CapabilityStatus[] items = CapabilityStatus.values(); + for (CapabilityStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateMode.java index 477961dc9905..e312c1a18fc8 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateMode.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/CreateMode.java @@ -28,6 +28,9 @@ public final class CreateMode extends ExpandableStringEnum { /** Static value Replica for CreateMode. */ public static final CreateMode REPLICA = fromString("Replica"); + /** Static value ReviveDropped for CreateMode. */ + public static final CreateMode REVIVE_DROPPED = fromString("ReviveDropped"); + /** * Creates a new instance of CreateMode value. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DataEncryption.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DataEncryption.java index 1eb652d25833..b86e15325a5b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DataEncryption.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DataEncryption.java @@ -11,29 +11,53 @@ @Fluent public final class DataEncryption { /* - * URI for the key for data encryption for primary server. + * URI for the key in keyvault for data encryption of the primary server. */ @JsonProperty(value = "primaryKeyURI") private String primaryKeyUri; /* - * Resource Id for the User assigned identity to be used for data encryption for primary server. + * Resource Id for the User assigned identity to be used for data encryption of the primary server. */ @JsonProperty(value = "primaryUserAssignedIdentityId") private String primaryUserAssignedIdentityId; + /* + * URI for the key in keyvault for data encryption for geo-backup of server. + */ + @JsonProperty(value = "geoBackupKeyURI") + private String geoBackupKeyUri; + + /* + * Resource Id for the User assigned identity to be used for data encryption for geo-backup of server. + */ + @JsonProperty(value = "geoBackupUserAssignedIdentityId") + private String geoBackupUserAssignedIdentityId; + /* * Data encryption type to depict if it is System Managed vs Azure Key vault. */ @JsonProperty(value = "type") private ArmServerKeyType type; + /* + * Primary encryption key status for Data encryption enabled server. + */ + @JsonProperty(value = "primaryEncryptionKeyStatus") + private KeyStatusEnum primaryEncryptionKeyStatus; + + /* + * Geo-backup encryption key status for Data encryption enabled server. + */ + @JsonProperty(value = "geoBackupEncryptionKeyStatus") + private KeyStatusEnum geoBackupEncryptionKeyStatus; + /** Creates an instance of DataEncryption class. */ public DataEncryption() { } /** - * Get the primaryKeyUri property: URI for the key for data encryption for primary server. + * Get the primaryKeyUri property: URI for the key in keyvault for data encryption of the primary server. * * @return the primaryKeyUri value. */ @@ -42,7 +66,7 @@ public String primaryKeyUri() { } /** - * Set the primaryKeyUri property: URI for the key for data encryption for primary server. + * Set the primaryKeyUri property: URI for the key in keyvault for data encryption of the primary server. * * @param primaryKeyUri the primaryKeyUri value to set. * @return the DataEncryption object itself. @@ -54,7 +78,7 @@ public DataEncryption withPrimaryKeyUri(String primaryKeyUri) { /** * Get the primaryUserAssignedIdentityId property: Resource Id for the User assigned identity to be used for data - * encryption for primary server. + * encryption of the primary server. * * @return the primaryUserAssignedIdentityId value. */ @@ -64,7 +88,7 @@ public String primaryUserAssignedIdentityId() { /** * Set the primaryUserAssignedIdentityId property: Resource Id for the User assigned identity to be used for data - * encryption for primary server. + * encryption of the primary server. * * @param primaryUserAssignedIdentityId the primaryUserAssignedIdentityId value to set. * @return the DataEncryption object itself. @@ -74,6 +98,48 @@ public DataEncryption withPrimaryUserAssignedIdentityId(String primaryUserAssign return this; } + /** + * Get the geoBackupKeyUri property: URI for the key in keyvault for data encryption for geo-backup of server. + * + * @return the geoBackupKeyUri value. + */ + public String geoBackupKeyUri() { + return this.geoBackupKeyUri; + } + + /** + * Set the geoBackupKeyUri property: URI for the key in keyvault for data encryption for geo-backup of server. + * + * @param geoBackupKeyUri the geoBackupKeyUri value to set. + * @return the DataEncryption object itself. + */ + public DataEncryption withGeoBackupKeyUri(String geoBackupKeyUri) { + this.geoBackupKeyUri = geoBackupKeyUri; + return this; + } + + /** + * Get the geoBackupUserAssignedIdentityId property: Resource Id for the User assigned identity to be used for data + * encryption for geo-backup of server. + * + * @return the geoBackupUserAssignedIdentityId value. + */ + public String geoBackupUserAssignedIdentityId() { + return this.geoBackupUserAssignedIdentityId; + } + + /** + * Set the geoBackupUserAssignedIdentityId property: Resource Id for the User assigned identity to be used for data + * encryption for geo-backup of server. + * + * @param geoBackupUserAssignedIdentityId the geoBackupUserAssignedIdentityId value to set. + * @return the DataEncryption object itself. + */ + public DataEncryption withGeoBackupUserAssignedIdentityId(String geoBackupUserAssignedIdentityId) { + this.geoBackupUserAssignedIdentityId = geoBackupUserAssignedIdentityId; + return this; + } + /** * Get the type property: Data encryption type to depict if it is System Managed vs Azure Key vault. * @@ -94,6 +160,48 @@ public DataEncryption withType(ArmServerKeyType type) { return this; } + /** + * Get the primaryEncryptionKeyStatus property: Primary encryption key status for Data encryption enabled server. + * + * @return the primaryEncryptionKeyStatus value. + */ + public KeyStatusEnum primaryEncryptionKeyStatus() { + return this.primaryEncryptionKeyStatus; + } + + /** + * Set the primaryEncryptionKeyStatus property: Primary encryption key status for Data encryption enabled server. + * + * @param primaryEncryptionKeyStatus the primaryEncryptionKeyStatus value to set. + * @return the DataEncryption object itself. + */ + public DataEncryption withPrimaryEncryptionKeyStatus(KeyStatusEnum primaryEncryptionKeyStatus) { + this.primaryEncryptionKeyStatus = primaryEncryptionKeyStatus; + return this; + } + + /** + * Get the geoBackupEncryptionKeyStatus property: Geo-backup encryption key status for Data encryption enabled + * server. + * + * @return the geoBackupEncryptionKeyStatus value. + */ + public KeyStatusEnum geoBackupEncryptionKeyStatus() { + return this.geoBackupEncryptionKeyStatus; + } + + /** + * Set the geoBackupEncryptionKeyStatus property: Geo-backup encryption key status for Data encryption enabled + * server. + * + * @param geoBackupEncryptionKeyStatus the geoBackupEncryptionKeyStatus value to set. + * @return the DataEncryption object itself. + */ + public DataEncryption withGeoBackupEncryptionKeyStatus(KeyStatusEnum geoBackupEncryptionKeyStatus) { + this.geoBackupEncryptionKeyStatus = geoBackupEncryptionKeyStatus; + return this; + } + /** * Validates the instance. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbLevelValidationStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbLevelValidationStatus.java new file mode 100644 index 000000000000..33d272c3865c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbLevelValidationStatus.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Validation status summary for an individual database. */ +@Fluent +public final class DbLevelValidationStatus { + /* + * Name of the database + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /* + * Start date-time of a database level validation + */ + @JsonProperty(value = "startedOn") + private OffsetDateTime startedOn; + + /* + * End date-time of a database level validation + */ + @JsonProperty(value = "endedOn") + private OffsetDateTime endedOn; + + /* + * Summary of database level validations + */ + @JsonProperty(value = "summary") + private List summary; + + /** Creates an instance of DbLevelValidationStatus class. */ + public DbLevelValidationStatus() { + } + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Name of the database. + * + * @param databaseName the databaseName value to set. + * @return the DbLevelValidationStatus object itself. + */ + public DbLevelValidationStatus withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the startedOn property: Start date-time of a database level validation. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Start date-time of a database level validation. + * + * @param startedOn the startedOn value to set. + * @return the DbLevelValidationStatus object itself. + */ + public DbLevelValidationStatus withStartedOn(OffsetDateTime startedOn) { + this.startedOn = startedOn; + return this; + } + + /** + * Get the endedOn property: End date-time of a database level validation. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Set the endedOn property: End date-time of a database level validation. + * + * @param endedOn the endedOn value to set. + * @return the DbLevelValidationStatus object itself. + */ + public DbLevelValidationStatus withEndedOn(OffsetDateTime endedOn) { + this.endedOn = endedOn; + return this; + } + + /** + * Get the summary property: Summary of database level validations. + * + * @return the summary value. + */ + public List summary() { + return this.summary; + } + + /** + * Set the summary property: Summary of database level validations. + * + * @param summary the summary value to set. + * @return the DbLevelValidationStatus object itself. + */ + public DbLevelValidationStatus withSummary(List summary) { + this.summary = summary; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (summary() != null) { + summary().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbMigrationStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbMigrationStatus.java new file mode 100644 index 000000000000..64b0ef26c175 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbMigrationStatus.java @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Migration status of an individual database. */ +@Fluent +public final class DbMigrationStatus { + /* + * Name of the database + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /* + * Migration db state of an individual database + */ + @JsonProperty(value = "migrationState") + private MigrationDbState migrationState; + + /* + * Migration operation of an individual database + */ + @JsonProperty(value = "migrationOperation") + private String migrationOperation; + + /* + * Start date-time of a migration state + */ + @JsonProperty(value = "startedOn") + private OffsetDateTime startedOn; + + /* + * End date-time of a migration state + */ + @JsonProperty(value = "endedOn") + private OffsetDateTime endedOn; + + /* + * Number of tables queued for the migration of a DB + */ + @JsonProperty(value = "fullLoadQueuedTables") + private Integer fullLoadQueuedTables; + + /* + * Number of tables errored out during the migration of a DB + */ + @JsonProperty(value = "fullLoadErroredTables") + private Integer fullLoadErroredTables; + + /* + * Number of tables loading during the migration of a DB + */ + @JsonProperty(value = "fullLoadLoadingTables") + private Integer fullLoadLoadingTables; + + /* + * Number of tables loaded during the migration of a DB + */ + @JsonProperty(value = "fullLoadCompletedTables") + private Integer fullLoadCompletedTables; + + /* + * CDC update counter + */ + @JsonProperty(value = "cdcUpdateCounter") + private Integer cdcUpdateCounter; + + /* + * CDC delete counter + */ + @JsonProperty(value = "cdcDeleteCounter") + private Integer cdcDeleteCounter; + + /* + * CDC insert counter + */ + @JsonProperty(value = "cdcInsertCounter") + private Integer cdcInsertCounter; + + /* + * CDC applied changes counter + */ + @JsonProperty(value = "appliedChanges") + private Integer appliedChanges; + + /* + * CDC incoming changes counter + */ + @JsonProperty(value = "incomingChanges") + private Integer incomingChanges; + + /* + * Lag in seconds between source and target during online phase + */ + @JsonProperty(value = "latency") + private Integer latency; + + /* + * Error message, if any, for the migration state + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of DbMigrationStatus class. */ + public DbMigrationStatus() { + } + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Name of the database. + * + * @param databaseName the databaseName value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the migrationState property: Migration db state of an individual database. + * + * @return the migrationState value. + */ + public MigrationDbState migrationState() { + return this.migrationState; + } + + /** + * Set the migrationState property: Migration db state of an individual database. + * + * @param migrationState the migrationState value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withMigrationState(MigrationDbState migrationState) { + this.migrationState = migrationState; + return this; + } + + /** + * Get the migrationOperation property: Migration operation of an individual database. + * + * @return the migrationOperation value. + */ + public String migrationOperation() { + return this.migrationOperation; + } + + /** + * Set the migrationOperation property: Migration operation of an individual database. + * + * @param migrationOperation the migrationOperation value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withMigrationOperation(String migrationOperation) { + this.migrationOperation = migrationOperation; + return this; + } + + /** + * Get the startedOn property: Start date-time of a migration state. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Start date-time of a migration state. + * + * @param startedOn the startedOn value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withStartedOn(OffsetDateTime startedOn) { + this.startedOn = startedOn; + return this; + } + + /** + * Get the endedOn property: End date-time of a migration state. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Set the endedOn property: End date-time of a migration state. + * + * @param endedOn the endedOn value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withEndedOn(OffsetDateTime endedOn) { + this.endedOn = endedOn; + return this; + } + + /** + * Get the fullLoadQueuedTables property: Number of tables queued for the migration of a DB. + * + * @return the fullLoadQueuedTables value. + */ + public Integer fullLoadQueuedTables() { + return this.fullLoadQueuedTables; + } + + /** + * Set the fullLoadQueuedTables property: Number of tables queued for the migration of a DB. + * + * @param fullLoadQueuedTables the fullLoadQueuedTables value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withFullLoadQueuedTables(Integer fullLoadQueuedTables) { + this.fullLoadQueuedTables = fullLoadQueuedTables; + return this; + } + + /** + * Get the fullLoadErroredTables property: Number of tables errored out during the migration of a DB. + * + * @return the fullLoadErroredTables value. + */ + public Integer fullLoadErroredTables() { + return this.fullLoadErroredTables; + } + + /** + * Set the fullLoadErroredTables property: Number of tables errored out during the migration of a DB. + * + * @param fullLoadErroredTables the fullLoadErroredTables value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withFullLoadErroredTables(Integer fullLoadErroredTables) { + this.fullLoadErroredTables = fullLoadErroredTables; + return this; + } + + /** + * Get the fullLoadLoadingTables property: Number of tables loading during the migration of a DB. + * + * @return the fullLoadLoadingTables value. + */ + public Integer fullLoadLoadingTables() { + return this.fullLoadLoadingTables; + } + + /** + * Set the fullLoadLoadingTables property: Number of tables loading during the migration of a DB. + * + * @param fullLoadLoadingTables the fullLoadLoadingTables value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withFullLoadLoadingTables(Integer fullLoadLoadingTables) { + this.fullLoadLoadingTables = fullLoadLoadingTables; + return this; + } + + /** + * Get the fullLoadCompletedTables property: Number of tables loaded during the migration of a DB. + * + * @return the fullLoadCompletedTables value. + */ + public Integer fullLoadCompletedTables() { + return this.fullLoadCompletedTables; + } + + /** + * Set the fullLoadCompletedTables property: Number of tables loaded during the migration of a DB. + * + * @param fullLoadCompletedTables the fullLoadCompletedTables value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withFullLoadCompletedTables(Integer fullLoadCompletedTables) { + this.fullLoadCompletedTables = fullLoadCompletedTables; + return this; + } + + /** + * Get the cdcUpdateCounter property: CDC update counter. + * + * @return the cdcUpdateCounter value. + */ + public Integer cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Set the cdcUpdateCounter property: CDC update counter. + * + * @param cdcUpdateCounter the cdcUpdateCounter value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withCdcUpdateCounter(Integer cdcUpdateCounter) { + this.cdcUpdateCounter = cdcUpdateCounter; + return this; + } + + /** + * Get the cdcDeleteCounter property: CDC delete counter. + * + * @return the cdcDeleteCounter value. + */ + public Integer cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Set the cdcDeleteCounter property: CDC delete counter. + * + * @param cdcDeleteCounter the cdcDeleteCounter value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withCdcDeleteCounter(Integer cdcDeleteCounter) { + this.cdcDeleteCounter = cdcDeleteCounter; + return this; + } + + /** + * Get the cdcInsertCounter property: CDC insert counter. + * + * @return the cdcInsertCounter value. + */ + public Integer cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Set the cdcInsertCounter property: CDC insert counter. + * + * @param cdcInsertCounter the cdcInsertCounter value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withCdcInsertCounter(Integer cdcInsertCounter) { + this.cdcInsertCounter = cdcInsertCounter; + return this; + } + + /** + * Get the appliedChanges property: CDC applied changes counter. + * + * @return the appliedChanges value. + */ + public Integer appliedChanges() { + return this.appliedChanges; + } + + /** + * Set the appliedChanges property: CDC applied changes counter. + * + * @param appliedChanges the appliedChanges value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withAppliedChanges(Integer appliedChanges) { + this.appliedChanges = appliedChanges; + return this; + } + + /** + * Get the incomingChanges property: CDC incoming changes counter. + * + * @return the incomingChanges value. + */ + public Integer incomingChanges() { + return this.incomingChanges; + } + + /** + * Set the incomingChanges property: CDC incoming changes counter. + * + * @param incomingChanges the incomingChanges value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withIncomingChanges(Integer incomingChanges) { + this.incomingChanges = incomingChanges; + return this; + } + + /** + * Get the latency property: Lag in seconds between source and target during online phase. + * + * @return the latency value. + */ + public Integer latency() { + return this.latency; + } + + /** + * Set the latency property: Lag in seconds between source and target during online phase. + * + * @param latency the latency value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withLatency(Integer latency) { + this.latency = latency; + return this; + } + + /** + * Get the message property: Error message, if any, for the migration state. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Error message, if any, for the migration state. + * + * @param message the message value to set. + * @return the DbMigrationStatus object itself. + */ + public DbMigrationStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbServerMetadata.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbServerMetadata.java new file mode 100644 index 000000000000..095727106613 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/DbServerMetadata.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Database server metadata. */ +@Fluent +public final class DbServerMetadata { + /* + * Location of database server + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Version for database engine + */ + @JsonProperty(value = "version") + private String version; + + /* + * Storage size in MB for database server + */ + @JsonProperty(value = "storageMb") + private Integer storageMb; + + /* + * SKU for the database server. This object is empty for PG single server + */ + @JsonProperty(value = "sku") + private ServerSku sku; + + /** Creates an instance of DbServerMetadata class. */ + public DbServerMetadata() { + } + + /** + * Get the location property: Location of database server. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the version property: Version for database engine. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version for database engine. + * + * @param version the version value to set. + * @return the DbServerMetadata object itself. + */ + public DbServerMetadata withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the storageMb property: Storage size in MB for database server. + * + * @return the storageMb value. + */ + public Integer storageMb() { + return this.storageMb; + } + + /** + * Set the storageMb property: Storage size in MB for database server. + * + * @param storageMb the storageMb value to set. + * @return the DbServerMetadata object itself. + */ + public DbServerMetadata withStorageMb(Integer storageMb) { + this.storageMb = storageMb; + return this; + } + + /** + * Get the sku property: SKU for the database server. This object is empty for PG single server. + * + * @return the sku value. + */ + public ServerSku sku() { + return this.sku; + } + + /** + * Set the sku property: SKU for the database server. This object is empty for PG single server. + * + * @param sku the sku value to set. + * @return the DbServerMetadata object itself. + */ + public DbServerMetadata withSku(ServerSku sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ExecutionStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ExecutionStatus.java new file mode 100644 index 000000000000..b325710487cf --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ExecutionStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Service-set extensible enum indicating the status of operation. */ +public final class ExecutionStatus extends ExpandableStringEnum { + /** Static value Running for ExecutionStatus. */ + public static final ExecutionStatus RUNNING = fromString("Running"); + + /** Static value Cancelled for ExecutionStatus. */ + public static final ExecutionStatus CANCELLED = fromString("Cancelled"); + + /** Static value Failed for ExecutionStatus. */ + public static final ExecutionStatus FAILED = fromString("Failed"); + + /** Static value Succeeded for ExecutionStatus. */ + public static final ExecutionStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Creates a new instance of ExecutionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExecutionStatus() { + } + + /** + * Creates or finds a ExecutionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionStatus. + */ + @JsonCreator + public static ExecutionStatus fromString(String name) { + return fromString(name, ExecutionStatus.class); + } + + /** + * Gets known ExecutionStatus values. + * + * @return known ExecutionStatus values. + */ + public static Collection values() { + return values(ExecutionStatus.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningEditionCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningEditionCapability.java index fa240f037e0e..e9e89dd7eda3 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningEditionCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningEditionCapability.java @@ -7,9 +7,15 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The FastProvisioningEditionCapability model. */ +/** Represents capability of a fast provisioning edition. */ @Immutable -public final class FastProvisioningEditionCapability { +public final class FastProvisioningEditionCapability extends CapabilityBase { + /* + * Fast provisioning supported tier name + */ + @JsonProperty(value = "supportedTier", access = JsonProperty.Access.WRITE_ONLY) + private String supportedTier; + /* * Fast provisioning supported sku name */ @@ -20,7 +26,7 @@ public final class FastProvisioningEditionCapability { * Fast provisioning supported storage in Gb */ @JsonProperty(value = "supportedStorageGb", access = JsonProperty.Access.WRITE_ONLY) - private Long supportedStorageGb; + private Integer supportedStorageGb; /* * Fast provisioning supported version @@ -28,10 +34,25 @@ public final class FastProvisioningEditionCapability { @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) private String supportedServerVersions; + /* + * Count of servers in cache matching the spec + */ + @JsonProperty(value = "serverCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer serverCount; + /** Creates an instance of FastProvisioningEditionCapability class. */ public FastProvisioningEditionCapability() { } + /** + * Get the supportedTier property: Fast provisioning supported tier name. + * + * @return the supportedTier value. + */ + public String supportedTier() { + return this.supportedTier; + } + /** * Get the supportedSku property: Fast provisioning supported sku name. * @@ -46,7 +67,7 @@ public String supportedSku() { * * @return the supportedStorageGb value. */ - public Long supportedStorageGb() { + public Integer supportedStorageGb() { return this.supportedStorageGb; } @@ -59,11 +80,22 @@ public String supportedServerVersions() { return this.supportedServerVersions; } + /** + * Get the serverCount property: Count of servers in cache matching the spec. + * + * @return the serverCount value. + */ + public Integer serverCount() { + return this.serverCount; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningSupportedEnum.java new file mode 100644 index 000000000000..e70abdebbf76 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FastProvisioningSupportedEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Gets a value indicating whether fast provisioning is supported. "Enabled" means fast provisioning is supported. + * "Disabled" stands for fast provisioning is not supported. + */ +public final class FastProvisioningSupportedEnum extends ExpandableStringEnum { + /** Static value Enabled for FastProvisioningSupportedEnum. */ + public static final FastProvisioningSupportedEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for FastProvisioningSupportedEnum. */ + public static final FastProvisioningSupportedEnum DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of FastProvisioningSupportedEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FastProvisioningSupportedEnum() { + } + + /** + * Creates or finds a FastProvisioningSupportedEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding FastProvisioningSupportedEnum. + */ + @JsonCreator + public static FastProvisioningSupportedEnum fromString(String name) { + return fromString(name, FastProvisioningSupportedEnum.class); + } + + /** + * Gets known FastProvisioningSupportedEnum values. + * + * @return known FastProvisioningSupportedEnum values. + */ + public static Collection values() { + return values(FastProvisioningSupportedEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerCapability.java new file mode 100644 index 000000000000..b7e81d26ee4c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerCapability.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner; +import java.util.List; + +/** An immutable client-side representation of FlexibleServerCapability. */ +public interface FlexibleServerCapability { + /** + * Gets the status property: The status of the capability. + * + * @return the status value. + */ + CapabilityStatus status(); + + /** + * Gets the reason property: The reason for the capability not being available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the name property: Name of flexible servers capability. + * + * @return the name value. + */ + String name(); + + /** + * Gets the supportedServerEditions property: List of supported flexible server editions. + * + * @return the supportedServerEditions value. + */ + List supportedServerEditions(); + + /** + * Gets the supportedServerVersions property: The list of server versions supported for this capability. + * + * @return the supportedServerVersions value. + */ + List supportedServerVersions(); + + /** + * Gets the fastProvisioningSupported property: Gets a value indicating whether fast provisioning is supported. + * "Enabled" means fast provisioning is supported. "Disabled" stands for fast provisioning is not supported. + * + * @return the fastProvisioningSupported value. + */ + FastProvisioningSupportedEnum fastProvisioningSupported(); + + /** + * Gets the supportedFastProvisioningEditions property: List of supported server editions for fast provisioning. + * + * @return the supportedFastProvisioningEditions value. + */ + List supportedFastProvisioningEditions(); + + /** + * Gets the geoBackupSupported property: Determines if geo-backup is supported in this region. "Enabled" means + * geo-backup is supported. "Disabled" stands for geo-back is not supported. + * + * @return the geoBackupSupported value. + */ + GeoBackupSupportedEnum geoBackupSupported(); + + /** + * Gets the zoneRedundantHaSupported property: A value indicating whether Zone Redundant HA is supported in this + * region. "Enabled" means zone redundant HA is supported. "Disabled" stands for zone redundant HA is not supported. + * + * @return the zoneRedundantHaSupported value. + */ + ZoneRedundantHaSupportedEnum zoneRedundantHaSupported(); + + /** + * Gets the zoneRedundantHaAndGeoBackupSupported property: A value indicating whether Zone Redundant HA and + * Geo-backup is supported in this region. "Enabled" means zone redundant HA and geo-backup is supported. "Disabled" + * stands for zone redundant HA and geo-backup is not supported. + * + * @return the zoneRedundantHaAndGeoBackupSupported value. + */ + ZoneRedundantHaAndGeoBackupSupportedEnum zoneRedundantHaAndGeoBackupSupported(); + + /** + * Gets the storageAutoGrowthSupported property: A value indicating whether storage auto-grow is supported in this + * region. "Enabled" means storage auto-grow is supported. "Disabled" stands for storage auto-grow is not supported. + * + * @return the storageAutoGrowthSupported value. + */ + StorageAutoGrowthSupportedEnum storageAutoGrowthSupported(); + + /** + * Gets the onlineResizeSupported property: A value indicating whether online resize is supported in this region for + * the given subscription. "Enabled" means storage online resize is supported. "Disabled" means storage online + * resize is not supported. + * + * @return the onlineResizeSupported value. + */ + OnlineResizeSupportedEnum onlineResizeSupported(); + + /** + * Gets the restricted property: A value indicating whether this region is restricted. "Enabled" means region is + * restricted. "Disabled" stands for region is not restricted. + * + * @return the restricted value. + */ + RestrictedEnum restricted(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner + * object. + * + * @return the inner object. + */ + FlexibleServerCapabilityInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerEditionCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerEditionCapability.java index bbf34878e9a3..a4a6879f7949 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerEditionCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServerEditionCapability.java @@ -10,7 +10,7 @@ /** Flexible server edition capabilities. */ @Immutable -public final class FlexibleServerEditionCapability { +public final class FlexibleServerEditionCapability extends CapabilityBase { /* * Server edition name */ @@ -18,22 +18,22 @@ public final class FlexibleServerEditionCapability { private String name; /* - * The list of editions supported by this server edition. + * Default sku name for the server edition */ - @JsonProperty(value = "supportedStorageEditions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedStorageEditions; + @JsonProperty(value = "defaultSkuName", access = JsonProperty.Access.WRITE_ONLY) + private String defaultSkuName; /* - * The list of server versions supported by this server edition. + * The list of editions supported by this server edition. */ - @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedServerVersions; + @JsonProperty(value = "supportedStorageEditions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedStorageEditions; /* - * The status + * List of supported server SKUs. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; + @JsonProperty(value = "supportedServerSkus", access = JsonProperty.Access.WRITE_ONLY) + private List supportedServerSkus; /** Creates an instance of FlexibleServerEditionCapability class. */ public FlexibleServerEditionCapability() { @@ -49,30 +49,30 @@ public String name() { } /** - * Get the supportedStorageEditions property: The list of editions supported by this server edition. + * Get the defaultSkuName property: Default sku name for the server edition. * - * @return the supportedStorageEditions value. + * @return the defaultSkuName value. */ - public List supportedStorageEditions() { - return this.supportedStorageEditions; + public String defaultSkuName() { + return this.defaultSkuName; } /** - * Get the supportedServerVersions property: The list of server versions supported by this server edition. + * Get the supportedStorageEditions property: The list of editions supported by this server edition. * - * @return the supportedServerVersions value. + * @return the supportedStorageEditions value. */ - public List supportedServerVersions() { - return this.supportedServerVersions; + public List supportedStorageEditions() { + return this.supportedStorageEditions; } /** - * Get the status property: The status. + * Get the supportedServerSkus property: List of supported server SKUs. * - * @return the status value. + * @return the supportedServerSkus value. */ - public String status() { - return this.status; + public List supportedServerSkus() { + return this.supportedServerSkus; } /** @@ -80,12 +80,14 @@ public String status() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (supportedStorageEditions() != null) { supportedStorageEditions().forEach(e -> e.validate()); } - if (supportedServerVersions() != null) { - supportedServerVersions().forEach(e -> e.validate()); + if (supportedServerSkus() != null) { + supportedServerSkus().forEach(e -> e.validate()); } } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServers.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServers.java new file mode 100644 index 000000000000..8a79ba6ac437 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServers.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FlexibleServers. */ +public interface FlexibleServers { + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call. + */ + Response triggerLtrPreBackupWithResponse( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters, Context context); + + /** + * PreBackup operation performs all the checks that are needed for the subsequent long term retention backup + * operation to succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR pre-backup API call. + */ + LtrPreBackupResponse triggerLtrPreBackup( + String resourceGroupName, String serverName, LtrPreBackupRequest parameters); + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call. + */ + LtrBackupResponse startLtrBackup(String resourceGroupName, String serverName, LtrBackupRequest parameters); + + /** + * Start the Long Term Retention Backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters Request body for 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 response for the LTR backup API call. + */ + LtrBackupResponse startLtrBackup( + String resourceGroupName, String serverName, LtrBackupRequest parameters, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupHeaders.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupHeaders.java new file mode 100644 index 000000000000..2cbf8e015e4d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupHeaders.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The FlexibleServersTriggerLtrPreBackupHeaders model. */ +@Fluent +public final class FlexibleServersTriggerLtrPreBackupHeaders { + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + private static final HttpHeaderName X_MS_REQUEST_ID = HttpHeaderName.fromString("x-ms-request-id"); + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of FlexibleServersTriggerLtrPreBackupHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public FlexibleServersTriggerLtrPreBackupHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue(X_MS_REQUEST_ID); + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the FlexibleServersTriggerLtrPreBackupHeaders object itself. + */ + public FlexibleServersTriggerLtrPreBackupHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupResponse.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupResponse.java new file mode 100644 index 000000000000..ec228ae985c4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/FlexibleServersTriggerLtrPreBackupResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner; + +/** Contains all response data for the triggerLtrPreBackup operation. */ +public final class FlexibleServersTriggerLtrPreBackupResponse + extends ResponseBase { + /** + * Creates an instance of FlexibleServersTriggerLtrPreBackupResponse. + * + * @param request the request which resulted in this FlexibleServersTriggerLtrPreBackupResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public FlexibleServersTriggerLtrPreBackupResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + LtrPreBackupResponseInner value, + FlexibleServersTriggerLtrPreBackupHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public LtrPreBackupResponseInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoBackupSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoBackupSupportedEnum.java new file mode 100644 index 000000000000..1c93c7e5109c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/GeoBackupSupportedEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Determines if geo-backup is supported in this region. "Enabled" means geo-backup is supported. "Disabled" stands for + * geo-back is not supported. + */ +public final class GeoBackupSupportedEnum extends ExpandableStringEnum { + /** Static value Enabled for GeoBackupSupportedEnum. */ + public static final GeoBackupSupportedEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for GeoBackupSupportedEnum. */ + public static final GeoBackupSupportedEnum DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of GeoBackupSupportedEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GeoBackupSupportedEnum() { + } + + /** + * Creates or finds a GeoBackupSupportedEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding GeoBackupSupportedEnum. + */ + @JsonCreator + public static GeoBackupSupportedEnum fromString(String name) { + return fromString(name, GeoBackupSupportedEnum.class); + } + + /** + * Gets known GeoBackupSupportedEnum values. + * + * @return known GeoBackupSupportedEnum values. + */ + public static Collection values() { + return values(GeoBackupSupportedEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HaMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HaMode.java new file mode 100644 index 000000000000..fca58226aebe --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HaMode.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** HA mode supported for a server. */ +public final class HaMode extends ExpandableStringEnum { + /** Static value SameZone for HaMode. */ + public static final HaMode SAME_ZONE = fromString("SameZone"); + + /** Static value ZoneRedundant for HaMode. */ + public static final HaMode ZONE_REDUNDANT = fromString("ZoneRedundant"); + + /** + * Creates a new instance of HaMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HaMode() { + } + + /** + * Creates or finds a HaMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding HaMode. + */ + @JsonCreator + public static HaMode fromString(String name) { + return fromString(name, HaMode.class); + } + + /** + * Gets known HaMode values. + * + * @return known HaMode values. + */ + public static Collection values() { + return values(HaMode.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HyperscaleNodeEditionCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HyperscaleNodeEditionCapability.java deleted file mode 100644 index ea708a9405bc..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/HyperscaleNodeEditionCapability.java +++ /dev/null @@ -1,109 +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.postgresqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Hyperscale node edition capabilities. */ -@Immutable -public final class HyperscaleNodeEditionCapability { - /* - * Server edition name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The list of editions supported by this server edition. - */ - @JsonProperty(value = "supportedStorageEditions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedStorageEditions; - - /* - * The list of server versions supported by this server edition. - */ - @JsonProperty(value = "supportedServerVersions", access = JsonProperty.Access.WRITE_ONLY) - private List supportedServerVersions; - - /* - * The list of Node Types supported by this server edition. - */ - @JsonProperty(value = "supportedNodeTypes", access = JsonProperty.Access.WRITE_ONLY) - private List supportedNodeTypes; - - /* - * The status - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** Creates an instance of HyperscaleNodeEditionCapability class. */ - public HyperscaleNodeEditionCapability() { - } - - /** - * Get the name property: Server edition name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the supportedStorageEditions property: The list of editions supported by this server edition. - * - * @return the supportedStorageEditions value. - */ - public List supportedStorageEditions() { - return this.supportedStorageEditions; - } - - /** - * Get the supportedServerVersions property: The list of server versions supported by this server edition. - * - * @return the supportedServerVersions value. - */ - public List supportedServerVersions() { - return this.supportedServerVersions; - } - - /** - * Get the supportedNodeTypes property: The list of Node Types supported by this server edition. - * - * @return the supportedNodeTypes value. - */ - public List supportedNodeTypes() { - return this.supportedNodeTypes; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * 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()); - } - if (supportedNodeTypes() != null) { - supportedNodeTypes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/KeyStatusEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/KeyStatusEnum.java new file mode 100644 index 000000000000..7efbb800fb60 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/KeyStatusEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Primary encryption key status for Data encryption enabled server. */ +public final class KeyStatusEnum extends ExpandableStringEnum { + /** Static value Valid for KeyStatusEnum. */ + public static final KeyStatusEnum VALID = fromString("Valid"); + + /** Static value Invalid for KeyStatusEnum. */ + public static final KeyStatusEnum INVALID = fromString("Invalid"); + + /** + * Creates a new instance of KeyStatusEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyStatusEnum() { + } + + /** + * Creates or finds a KeyStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyStatusEnum. + */ + @JsonCreator + public static KeyStatusEnum fromString(String name) { + return fromString(name, KeyStatusEnum.class); + } + + /** + * Gets known KeyStatusEnum values. + * + * @return known KeyStatusEnum values. + */ + public static Collection values() { + return values(KeyStatusEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LocationBasedCapabilities.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LocationBasedCapabilities.java index 6bfff0e2ec68..5a09ca86905e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LocationBasedCapabilities.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LocationBasedCapabilities.java @@ -19,7 +19,7 @@ public interface LocationBasedCapabilities { * @return capabilities at specified location in a given subscription as paginated response with {@link * PagedIterable}. */ - PagedIterable execute(String locationName); + PagedIterable execute(String locationName); /** * Get capabilities at specified location in a given subscription. @@ -32,5 +32,5 @@ public interface LocationBasedCapabilities { * @return capabilities at specified location in a given subscription as paginated response with {@link * PagedIterable}. */ - PagedIterable execute(String locationName, Context context); + PagedIterable execute(String locationName, Context context); } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFile.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFile.java new file mode 100644 index 000000000000..3eb05f06ca72 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFile.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 sizeInKb property: The size in kb of the logFile. + * + * @return the sizeInKb value. + */ + Long sizeInKb(); + + /** + * 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.postgresqlflexibleserver.fluent.models.LogFileInner object. + * + * @return the inner object. + */ + LogFileInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFileListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFileListResult.java new file mode 100644 index 000000000000..e6c789534ed6 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFileListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A List of logFiles. */ +@Fluent +public final class LogFileListResult { + /* + * The list of logFiles in a server + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of LogFileListResult class. */ + public LogFileListResult() { + } + + /** + * Get the value property: The list of logFiles in a server. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of logFiles in a server. + * + * @param value the value value to set. + * @return the LogFileListResult object itself. + */ + public LogFileListResult 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 LogFileListResult object itself. + */ + public LogFileListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + 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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFiles.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFiles.java new file mode 100644 index 000000000000..a64a3ffb907e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogFiles.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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 server 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 logFiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * List all the server 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 logFiles as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogicalReplicationOnSourceDbEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogicalReplicationOnSourceDbEnum.java new file mode 100644 index 000000000000..a0316139dd71 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LogicalReplicationOnSourceDbEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates whether to setup LogicalReplicationOnSourceDb, if needed. */ +public final class LogicalReplicationOnSourceDbEnum extends ExpandableStringEnum { + /** Static value True for LogicalReplicationOnSourceDbEnum. */ + public static final LogicalReplicationOnSourceDbEnum TRUE = fromString("True"); + + /** Static value False for LogicalReplicationOnSourceDbEnum. */ + public static final LogicalReplicationOnSourceDbEnum FALSE = fromString("False"); + + /** + * Creates a new instance of LogicalReplicationOnSourceDbEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogicalReplicationOnSourceDbEnum() { + } + + /** + * Creates or finds a LogicalReplicationOnSourceDbEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogicalReplicationOnSourceDbEnum. + */ + @JsonCreator + public static LogicalReplicationOnSourceDbEnum fromString(String name) { + return fromString(name, LogicalReplicationOnSourceDbEnum.class); + } + + /** + * Gets known LogicalReplicationOnSourceDbEnum values. + * + * @return known LogicalReplicationOnSourceDbEnum values. + */ + public static Collection values() { + return values(LogicalReplicationOnSourceDbEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupOperations.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupOperations.java new file mode 100644 index 000000000000..542489de3eef --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupOperations.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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 LtrBackupOperations. */ +public interface LtrBackupOperations { + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @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 result of the give long term retention backup operation for the flexible server along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, String serverName, String backupName, Context context); + + /** + * Gets the result of the give long term retention backup operation for the flexible server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @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 result of the give long term retention backup operation for the flexible server. + */ + LtrServerBackupOperation get(String resourceGroupName, String serverName, String backupName); + + /** + * Gets the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * Gets the result of the give long term retention backup operations for the flexible 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 result of the give long term retention backup operations for the flexible server as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupRequest.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupRequest.java new file mode 100644 index 000000000000..62560eb37dc7 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupRequest.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The request that is made for a long term retention backup. */ +@Fluent +public final class LtrBackupRequest extends BackupRequestBase { + /* + * Backup store detail for target server + */ + @JsonProperty(value = "targetDetails", required = true) + private BackupStoreDetails targetDetails; + + /** Creates an instance of LtrBackupRequest class. */ + public LtrBackupRequest() { + } + + /** + * Get the targetDetails property: Backup store detail for target server. + * + * @return the targetDetails value. + */ + public BackupStoreDetails targetDetails() { + return this.targetDetails; + } + + /** + * Set the targetDetails property: Backup store detail for target server. + * + * @param targetDetails the targetDetails value to set. + * @return the LtrBackupRequest object itself. + */ + public LtrBackupRequest withTargetDetails(BackupStoreDetails targetDetails) { + this.targetDetails = targetDetails; + return this; + } + + /** {@inheritDoc} */ + @Override + public LtrBackupRequest withBackupSettings(BackupSettings backupSettings) { + super.withBackupSettings(backupSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (targetDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property targetDetails in model LtrBackupRequest")); + } else { + targetDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LtrBackupRequest.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupResponse.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupResponse.java new file mode 100644 index 000000000000..b9777abd55fb --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrBackupResponse.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of LtrBackupResponse. */ +public interface LtrBackupResponse { + /** + * Gets the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + Long datasourceSizeInBytes(); + + /** + * Gets the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + Long dataTransferredInBytes(); + + /** + * Gets the backupName property: Name of Backup operation. + * + * @return the backupName value. + */ + String backupName(); + + /** + * Gets the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform + * a successful restore using this Recovery point. e.g. Versions, DataFormat etc. + * + * @return the backupMetadata value. + */ + String backupMetadata(); + + /** + * Gets the status property: Service-set extensible enum indicating the status of operation. + * + * @return the status value. + */ + ExecutionStatus status(); + + /** + * Gets the startTime property: Start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: End time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the percentComplete property: PercentageCompleted. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the errorCode property: The error code. + * + * @return the errorCode value. + */ + String errorCode(); + + /** + * Gets the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner object. + * + * @return the inner object. + */ + LtrBackupResponseInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupRequest.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupRequest.java new file mode 100644 index 000000000000..b81666148e38 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupRequest.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; + +/** A request that is made for pre-backup. */ +@Fluent +public final class LtrPreBackupRequest extends BackupRequestBase { + /** Creates an instance of LtrPreBackupRequest class. */ + public LtrPreBackupRequest() { + } + + /** {@inheritDoc} */ + @Override + public LtrPreBackupRequest withBackupSettings(BackupSettings backupSettings) { + super.withBackupSettings(backupSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupResponse.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupResponse.java new file mode 100644 index 000000000000..f1a043b44051 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrPreBackupResponse.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.postgresqlflexibleserver.models; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner; + +/** An immutable client-side representation of LtrPreBackupResponse. */ +public interface LtrPreBackupResponse { + /** + * Gets the numberOfContainers property: Number of storage containers the plugin will use during backup. More than + * one containers may be used for size limitations, parallelism, or redundancy etc. + * + * @return the numberOfContainers value. + */ + int numberOfContainers(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner object. + * + * @return the inner object. + */ + LtrPreBackupResponseInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperation.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperation.java new file mode 100644 index 000000000000..4ce2506b20cd --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperation.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of LtrServerBackupOperation. */ +public interface LtrServerBackupOperation { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the datasourceSizeInBytes property: Size of datasource in bytes. + * + * @return the datasourceSizeInBytes value. + */ + Long datasourceSizeInBytes(); + + /** + * Gets the dataTransferredInBytes property: Data transferred in bytes. + * + * @return the dataTransferredInBytes value. + */ + Long dataTransferredInBytes(); + + /** + * Gets the backupName property: Name of Backup operation. + * + * @return the backupName value. + */ + String backupName(); + + /** + * Gets the backupMetadata property: Metadata to be stored in RP. Store everything that will be required to perform + * a successful restore using this Recovery point. e.g. Versions, DataFormat etc. + * + * @return the backupMetadata value. + */ + String backupMetadata(); + + /** + * Gets the status property: Service-set extensible enum indicating the status of operation. + * + * @return the status value. + */ + ExecutionStatus status(); + + /** + * Gets the startTime property: Start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: End time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the percentComplete property: PercentageCompleted. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the errorCode property: The error code. + * + * @return the errorCode value. + */ + String errorCode(); + + /** + * Gets the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner + * object. + * + * @return the inner object. + */ + LtrServerBackupOperationInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperationList.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperationList.java new file mode 100644 index 000000000000..ce0807dbab2b --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/LtrServerBackupOperationList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of long term retention backup operations for server. */ +@Fluent +public final class LtrServerBackupOperationList { + /* + * The list of long term retention server backup operations + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of LtrServerBackupOperationList class. */ + public LtrServerBackupOperationList() { + } + + /** + * Get the value property: The list of long term retention server backup operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of long term retention server backup operations. + * + * @param value the value value to set. + * @return the LtrServerBackupOperationList object itself. + */ + public LtrServerBackupOperationList 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 LtrServerBackupOperationList object itself. + */ + public LtrServerBackupOperationList withNextLink(String nextLink) { + this.nextLink = nextLink; + 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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationDbState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationDbState.java new file mode 100644 index 000000000000..229b00c5971d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationDbState.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Migration db state of an individual database. */ +public final class MigrationDbState extends ExpandableStringEnum { + /** Static value InProgress for MigrationDbState. */ + public static final MigrationDbState IN_PROGRESS = fromString("InProgress"); + + /** Static value WaitingForCutoverTrigger for MigrationDbState. */ + public static final MigrationDbState WAITING_FOR_CUTOVER_TRIGGER = fromString("WaitingForCutoverTrigger"); + + /** Static value Failed for MigrationDbState. */ + public static final MigrationDbState FAILED = fromString("Failed"); + + /** Static value Canceled for MigrationDbState. */ + public static final MigrationDbState CANCELED = fromString("Canceled"); + + /** Static value Succeeded for MigrationDbState. */ + public static final MigrationDbState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceling for MigrationDbState. */ + public static final MigrationDbState CANCELING = fromString("Canceling"); + + /** + * Creates a new instance of MigrationDbState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationDbState() { + } + + /** + * Creates or finds a MigrationDbState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationDbState. + */ + @JsonCreator + public static MigrationDbState fromString(String name) { + return fromString(name, MigrationDbState.class); + } + + /** + * Gets known MigrationDbState values. + * + * @return known MigrationDbState values. + */ + public static Collection values() { + return values(MigrationDbState.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationListFilter.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationListFilter.java new file mode 100644 index 000000000000..4fb1a3ed6d28 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationListFilter.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationListFilter. */ +public final class MigrationListFilter extends ExpandableStringEnum { + /** Static value Active for MigrationListFilter. */ + public static final MigrationListFilter ACTIVE = fromString("Active"); + + /** Static value All for MigrationListFilter. */ + public static final MigrationListFilter ALL = fromString("All"); + + /** + * Creates a new instance of MigrationListFilter value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationListFilter() { + } + + /** + * Creates or finds a MigrationListFilter from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationListFilter. + */ + @JsonCreator + public static MigrationListFilter fromString(String name) { + return fromString(name, MigrationListFilter.class); + } + + /** + * Gets known MigrationListFilter values. + * + * @return known MigrationListFilter values. + */ + public static Collection values() { + return values(MigrationListFilter.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationMode.java new file mode 100644 index 000000000000..f1203e1e3f47 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationMode.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** There are two types of migration modes Online and Offline. */ +public final class MigrationMode extends ExpandableStringEnum { + /** Static value Offline for MigrationMode. */ + public static final MigrationMode OFFLINE = fromString("Offline"); + + /** Static value Online for MigrationMode. */ + public static final MigrationMode ONLINE = fromString("Online"); + + /** + * Creates a new instance of MigrationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationMode() { + } + + /** + * Creates or finds a MigrationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationMode. + */ + @JsonCreator + public static MigrationMode fromString(String name) { + return fromString(name, MigrationMode.class); + } + + /** + * Gets known MigrationMode values. + * + * @return known MigrationMode values. + */ + public static Collection values() { + return values(MigrationMode.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityReason.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityReason.java new file mode 100644 index 000000000000..21a0c21466ea --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityReason.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Migration name availability reason. */ +public final class MigrationNameAvailabilityReason extends ExpandableStringEnum { + /** Static value Invalid for MigrationNameAvailabilityReason. */ + public static final MigrationNameAvailabilityReason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for MigrationNameAvailabilityReason. */ + public static final MigrationNameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates a new instance of MigrationNameAvailabilityReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationNameAvailabilityReason() { + } + + /** + * Creates or finds a MigrationNameAvailabilityReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationNameAvailabilityReason. + */ + @JsonCreator + public static MigrationNameAvailabilityReason fromString(String name) { + return fromString(name, MigrationNameAvailabilityReason.class); + } + + /** + * Gets known MigrationNameAvailabilityReason values. + * + * @return known MigrationNameAvailabilityReason values. + */ + public static Collection values() { + return values(MigrationNameAvailabilityReason.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityResource.java new file mode 100644 index 000000000000..08f23000d0c5 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationNameAvailabilityResource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; + +/** An immutable client-side representation of MigrationNameAvailabilityResource. */ +public interface MigrationNameAvailabilityResource { + /** + * Gets the name property: The resource name to verify. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the nameAvailable property: Indicates whether the resource name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: Migration name availability reason. + * + * @return the reason value. + */ + MigrationNameAvailabilityReason reason(); + + /** + * Gets the message property: Migration name availability message. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner + * com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner object. + * + * @return the inner object. + */ + MigrationNameAvailabilityResourceInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationOption.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationOption.java new file mode 100644 index 000000000000..a27121b837ef --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationOption.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Supported types of migration request include Validate, Migrate and ValidateAndMigrate. */ +public final class MigrationOption extends ExpandableStringEnum { + /** Static value Validate for MigrationOption. */ + public static final MigrationOption VALIDATE = fromString("Validate"); + + /** Static value Migrate for MigrationOption. */ + public static final MigrationOption MIGRATE = fromString("Migrate"); + + /** Static value ValidateAndMigrate for MigrationOption. */ + public static final MigrationOption VALIDATE_AND_MIGRATE = fromString("ValidateAndMigrate"); + + /** + * Creates a new instance of MigrationOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationOption() { + } + + /** + * Creates or finds a MigrationOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationOption. + */ + @JsonCreator + public static MigrationOption fromString(String name) { + return fromString(name, MigrationOption.class); + } + + /** + * Gets known MigrationOption values. + * + * @return known MigrationOption values. + */ + public static Collection values() { + return values(MigrationOption.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResource.java new file mode 100644 index 000000000000..26f09078dd4d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResource.java @@ -0,0 +1,818 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of MigrationResource. */ +public interface MigrationResource { + /** + * 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 location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the migrationId property: ID for migration, a GUID. + * + * @return the migrationId value. + */ + String migrationId(); + + /** + * Gets the currentStatus property: Current status of migration. + * + * @return the currentStatus value. + */ + MigrationStatus currentStatus(); + + /** + * Gets the migrationMode property: There are two types of migration modes Online and Offline. + * + * @return the migrationMode value. + */ + MigrationMode migrationMode(); + + /** + * Gets the migrationOption property: This indicates the supported Migration option for the migration. + * + * @return the migrationOption value. + */ + MigrationOption migrationOption(); + + /** + * Gets the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM or + * PostgreSQLSingleServer. + * + * @return the sourceType value. + */ + SourceType sourceType(); + + /** + * Gets the sslMode property: SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and + * Prefer for other source types. + * + * @return the sslMode value. + */ + SslMode sslMode(); + + /** + * Gets the sourceDbServerMetadata property: Metadata of the source database server. + * + * @return the sourceDbServerMetadata value. + */ + DbServerMetadata sourceDbServerMetadata(); + + /** + * Gets the targetDbServerMetadata property: Metadata of the target database server. + * + * @return the targetDbServerMetadata value. + */ + DbServerMetadata targetDbServerMetadata(); + + /** + * Gets the sourceDbServerResourceId property: ResourceId of the source database server in case the sourceType is + * PostgreSQLSingleServer. For other source types this should be ipaddress:port@username or hostname:port@username. + * + * @return the sourceDbServerResourceId value. + */ + String sourceDbServerResourceId(); + + /** + * Gets the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is + * a optional value, if customer provide it, dms will always use it for connection. + * + * @return the sourceDbServerFullyQualifiedDomainName value. + */ + String sourceDbServerFullyQualifiedDomainName(); + + /** + * Gets the targetDbServerResourceId property: ResourceId of the source database server. + * + * @return the targetDbServerResourceId value. + */ + String targetDbServerResourceId(); + + /** + * Gets the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is + * a optional value, if customer provide it, dms will always use it for connection. + * + * @return the targetDbServerFullyQualifiedDomainName value. + */ + String targetDbServerFullyQualifiedDomainName(); + + /** + * Gets the secretParameters property: Migration secret parameters. + * + * @return the secretParameters value. + */ + MigrationSecretParameters secretParameters(); + + /** + * Gets the dbsToMigrate property: Number of databases to migrate. + * + * @return the dbsToMigrate value. + */ + List dbsToMigrate(); + + /** + * Gets the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @return the setupLogicalReplicationOnSourceDbIfNeeded value. + */ + LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded(); + + /** + * Gets the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten, + * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the + * database already exists. + * + * @return the overwriteDbsInTarget value. + */ + OverwriteDbsInTargetEnum overwriteDbsInTarget(); + + /** + * Gets the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @return the migrationWindowStartTimeInUtc value. + */ + OffsetDateTime migrationWindowStartTimeInUtc(); + + /** + * Gets the migrationWindowEndTimeInUtc property: End time in UTC for migration window. + * + * @return the migrationWindowEndTimeInUtc value. + */ + OffsetDateTime migrationWindowEndTimeInUtc(); + + /** + * Gets the startDataMigration property: Indicates whether the data migration should start right away. + * + * @return the startDataMigration value. + */ + StartDataMigrationEnum startDataMigration(); + + /** + * Gets the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True. + * + * @return the triggerCutover value. + */ + TriggerCutoverEnum triggerCutover(); + + /** + * Gets the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send + * triggerCutover flag as True and database names in this array. + * + * @return the dbsToTriggerCutoverOn value. + */ + List dbsToTriggerCutoverOn(); + + /** + * Gets the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @return the cancel value. + */ + CancelEnum cancel(); + + /** + * Gets the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag + * as True and database names in this array. + * + * @return the dbsToCancelMigrationOn value. + */ + List dbsToCancelMigrationOn(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner object. + * + * @return the inner object. + */ + MigrationResourceInner innerModel(); + + /** The entirety of the MigrationResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The MigrationResource definition stages. */ + interface DefinitionStages { + /** The first stage of the MigrationResource definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the MigrationResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the MigrationResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies subscriptionId, resourceGroupName, targetDbServerName. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @return the next definition stage. + */ + WithCreate withExistingFlexibleServer( + String subscriptionId, String resourceGroupName, String targetDbServerName); + } + + /** + * The stage of the MigrationResource 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.WithMigrationMode, + DefinitionStages.WithMigrationOption, + DefinitionStages.WithSourceType, + DefinitionStages.WithSslMode, + DefinitionStages.WithSourceDbServerResourceId, + DefinitionStages.WithSourceDbServerFullyQualifiedDomainName, + DefinitionStages.WithTargetDbServerFullyQualifiedDomainName, + DefinitionStages.WithSecretParameters, + DefinitionStages.WithDbsToMigrate, + DefinitionStages.WithSetupLogicalReplicationOnSourceDbIfNeeded, + DefinitionStages.WithOverwriteDbsInTarget, + DefinitionStages.WithMigrationWindowStartTimeInUtc, + DefinitionStages.WithMigrationWindowEndTimeInUtc, + DefinitionStages.WithStartDataMigration, + DefinitionStages.WithTriggerCutover, + DefinitionStages.WithDbsToTriggerCutoverOn, + DefinitionStages.WithCancel, + DefinitionStages.WithDbsToCancelMigrationOn { + /** + * Executes the create request. + * + * @return the created resource. + */ + MigrationResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MigrationResource create(Context context); + } + + /** The stage of the MigrationResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** The stage of the MigrationResource definition allowing to specify migrationMode. */ + interface WithMigrationMode { + /** + * Specifies the migrationMode property: There are two types of migration modes Online and Offline. + * + * @param migrationMode There are two types of migration modes Online and Offline. + * @return the next definition stage. + */ + WithCreate withMigrationMode(MigrationMode migrationMode); + } + + /** The stage of the MigrationResource definition allowing to specify migrationOption. */ + interface WithMigrationOption { + /** + * Specifies the migrationOption property: This indicates the supported Migration option for the migration. + * + * @param migrationOption This indicates the supported Migration option for the migration. + * @return the next definition stage. + */ + WithCreate withMigrationOption(MigrationOption migrationOption); + } + + /** The stage of the MigrationResource definition allowing to specify sourceType. */ + interface WithSourceType { + /** + * Specifies the sourceType property: migration source server type : OnPremises, AWS, GCP, AzureVM or + * PostgreSQLSingleServer. + * + * @param sourceType migration source server type : OnPremises, AWS, GCP, AzureVM or PostgreSQLSingleServer. + * @return the next definition stage. + */ + WithCreate withSourceType(SourceType sourceType); + } + + /** The stage of the MigrationResource definition allowing to specify sslMode. */ + interface WithSslMode { + /** + * Specifies the sslMode property: SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is + * VerifyFull and Prefer for other source types. + * + * @param sslMode SSL modes for migration. Default SSL mode for PostgreSQLSingleServer is VerifyFull and + * Prefer for other source types. + * @return the next definition stage. + */ + WithCreate withSslMode(SslMode sslMode); + } + + /** The stage of the MigrationResource definition allowing to specify sourceDbServerResourceId. */ + interface WithSourceDbServerResourceId { + /** + * Specifies the sourceDbServerResourceId property: ResourceId of the source database server in case the + * sourceType is PostgreSQLSingleServer. For other source types this should be ipaddress:port@username or + * hostname:port@username. + * + * @param sourceDbServerResourceId ResourceId of the source database server in case the sourceType is + * PostgreSQLSingleServer. For other source types this should be ipaddress:port@username or + * hostname:port@username. + * @return the next definition stage. + */ + WithCreate withSourceDbServerResourceId(String sourceDbServerResourceId); + } + + /** The stage of the MigrationResource definition allowing to specify sourceDbServerFullyQualifiedDomainName. */ + interface WithSourceDbServerFullyQualifiedDomainName { + /** + * Specifies the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name + * or ip. It is a optional value, if customer provide it, dms will always use it for connection. + * + * @param sourceDbServerFullyQualifiedDomainName Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * @return the next definition stage. + */ + WithCreate withSourceDbServerFullyQualifiedDomainName(String sourceDbServerFullyQualifiedDomainName); + } + + /** The stage of the MigrationResource definition allowing to specify targetDbServerFullyQualifiedDomainName. */ + interface WithTargetDbServerFullyQualifiedDomainName { + /** + * Specifies the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name + * or ip. It is a optional value, if customer provide it, dms will always use it for connection. + * + * @param targetDbServerFullyQualifiedDomainName Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * @return the next definition stage. + */ + WithCreate withTargetDbServerFullyQualifiedDomainName(String targetDbServerFullyQualifiedDomainName); + } + + /** The stage of the MigrationResource definition allowing to specify secretParameters. */ + interface WithSecretParameters { + /** + * Specifies the secretParameters property: Migration secret parameters. + * + * @param secretParameters Migration secret parameters. + * @return the next definition stage. + */ + WithCreate withSecretParameters(MigrationSecretParameters secretParameters); + } + + /** The stage of the MigrationResource definition allowing to specify dbsToMigrate. */ + interface WithDbsToMigrate { + /** + * Specifies the dbsToMigrate property: Number of databases to migrate. + * + * @param dbsToMigrate Number of databases to migrate. + * @return the next definition stage. + */ + WithCreate withDbsToMigrate(List dbsToMigrate); + } + + /** + * The stage of the MigrationResource definition allowing to specify setupLogicalReplicationOnSourceDbIfNeeded. + */ + interface WithSetupLogicalReplicationOnSourceDbIfNeeded { + /** + * Specifies the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @param setupLogicalReplicationOnSourceDbIfNeeded Indicates whether to setup LogicalReplicationOnSourceDb, + * if needed. + * @return the next definition stage. + */ + WithCreate withSetupLogicalReplicationOnSourceDbIfNeeded( + LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded); + } + + /** The stage of the MigrationResource definition allowing to specify overwriteDbsInTarget. */ + interface WithOverwriteDbsInTarget { + /** + * Specifies the overwriteDbsInTarget property: Indicates whether the databases on the target server can be + * overwritten, if already present. If set to False, the migration workflow will wait for a confirmation, if + * it detects that the database already exists.. + * + * @param overwriteDbsInTarget Indicates whether the databases on the target server can be overwritten, if + * already present. If set to False, the migration workflow will wait for a confirmation, if it detects + * that the database already exists. + * @return the next definition stage. + */ + WithCreate withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget); + } + + /** The stage of the MigrationResource definition allowing to specify migrationWindowStartTimeInUtc. */ + interface WithMigrationWindowStartTimeInUtc { + /** + * Specifies the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @param migrationWindowStartTimeInUtc Start time in UTC for migration window. + * @return the next definition stage. + */ + WithCreate withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc); + } + + /** The stage of the MigrationResource definition allowing to specify migrationWindowEndTimeInUtc. */ + interface WithMigrationWindowEndTimeInUtc { + /** + * Specifies the migrationWindowEndTimeInUtc property: End time in UTC for migration window. + * + * @param migrationWindowEndTimeInUtc End time in UTC for migration window. + * @return the next definition stage. + */ + WithCreate withMigrationWindowEndTimeInUtc(OffsetDateTime migrationWindowEndTimeInUtc); + } + + /** The stage of the MigrationResource definition allowing to specify startDataMigration. */ + interface WithStartDataMigration { + /** + * Specifies the startDataMigration property: Indicates whether the data migration should start right away. + * + * @param startDataMigration Indicates whether the data migration should start right away. + * @return the next definition stage. + */ + WithCreate withStartDataMigration(StartDataMigrationEnum startDataMigration); + } + + /** The stage of the MigrationResource definition allowing to specify triggerCutover. */ + interface WithTriggerCutover { + /** + * Specifies the triggerCutover property: To trigger cutover for entire migration we need to send this flag + * as True. + * + * @param triggerCutover To trigger cutover for entire migration we need to send this flag as True. + * @return the next definition stage. + */ + WithCreate withTriggerCutover(TriggerCutoverEnum triggerCutover); + } + + /** The stage of the MigrationResource definition allowing to specify dbsToTriggerCutoverOn. */ + interface WithDbsToTriggerCutoverOn { + /** + * Specifies the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases + * send triggerCutover flag as True and database names in this array. + * + * @param dbsToTriggerCutoverOn When you want to trigger cutover for specific databases send triggerCutover + * flag as True and database names in this array. + * @return the next definition stage. + */ + WithCreate withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn); + } + + /** The stage of the MigrationResource definition allowing to specify cancel. */ + interface WithCancel { + /** + * Specifies the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @param cancel To trigger cancel for entire migration we need to send this flag as True. + * @return the next definition stage. + */ + WithCreate withCancel(CancelEnum cancel); + } + + /** The stage of the MigrationResource definition allowing to specify dbsToCancelMigrationOn. */ + interface WithDbsToCancelMigrationOn { + /** + * Specifies the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases + * send cancel flag as True and database names in this array. + * + * @param dbsToCancelMigrationOn When you want to trigger cancel for specific databases send cancel flag as + * True and database names in this array. + * @return the next definition stage. + */ + WithCreate withDbsToCancelMigrationOn(List dbsToCancelMigrationOn); + } + } + + /** + * Begins update for the MigrationResource resource. + * + * @return the stage of resource update. + */ + MigrationResource.Update update(); + + /** The template for MigrationResource update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSourceDbServerResourceId, + UpdateStages.WithSourceDbServerFullyQualifiedDomainName, + UpdateStages.WithTargetDbServerFullyQualifiedDomainName, + UpdateStages.WithSecretParameters, + UpdateStages.WithDbsToMigrate, + UpdateStages.WithSetupLogicalReplicationOnSourceDbIfNeeded, + UpdateStages.WithOverwriteDbsInTarget, + UpdateStages.WithMigrationWindowStartTimeInUtc, + UpdateStages.WithStartDataMigration, + UpdateStages.WithTriggerCutover, + UpdateStages.WithDbsToTriggerCutoverOn, + UpdateStages.WithCancel, + UpdateStages.WithDbsToCancelMigrationOn, + UpdateStages.WithMigrationMode { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MigrationResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MigrationResource apply(Context context); + } + + /** The MigrationResource update stages. */ + interface UpdateStages { + /** The stage of the MigrationResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Application-specific metadata in the form of key-value pairs.. + * + * @param tags Application-specific metadata in the form of key-value pairs. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** The stage of the MigrationResource update allowing to specify sourceDbServerResourceId. */ + interface WithSourceDbServerResourceId { + /** + * Specifies the sourceDbServerResourceId property: ResourceId of the source database server. + * + * @param sourceDbServerResourceId ResourceId of the source database server. + * @return the next definition stage. + */ + Update withSourceDbServerResourceId(String sourceDbServerResourceId); + } + + /** The stage of the MigrationResource update allowing to specify sourceDbServerFullyQualifiedDomainName. */ + interface WithSourceDbServerFullyQualifiedDomainName { + /** + * Specifies the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name + * or ip. It is a optional value, if customer provide it, dms will always use it for connection. + * + * @param sourceDbServerFullyQualifiedDomainName Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * @return the next definition stage. + */ + Update withSourceDbServerFullyQualifiedDomainName(String sourceDbServerFullyQualifiedDomainName); + } + + /** The stage of the MigrationResource update allowing to specify targetDbServerFullyQualifiedDomainName. */ + interface WithTargetDbServerFullyQualifiedDomainName { + /** + * Specifies the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name + * or ip. It is a optional value, if customer provide it, dms will always use it for connection. + * + * @param targetDbServerFullyQualifiedDomainName Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * @return the next definition stage. + */ + Update withTargetDbServerFullyQualifiedDomainName(String targetDbServerFullyQualifiedDomainName); + } + + /** The stage of the MigrationResource update allowing to specify secretParameters. */ + interface WithSecretParameters { + /** + * Specifies the secretParameters property: Migration secret parameters. + * + * @param secretParameters Migration secret parameters. + * @return the next definition stage. + */ + Update withSecretParameters(MigrationSecretParameters secretParameters); + } + + /** The stage of the MigrationResource update allowing to specify dbsToMigrate. */ + interface WithDbsToMigrate { + /** + * Specifies the dbsToMigrate property: Number of databases to migrate. + * + * @param dbsToMigrate Number of databases to migrate. + * @return the next definition stage. + */ + Update withDbsToMigrate(List dbsToMigrate); + } + + /** The stage of the MigrationResource update allowing to specify setupLogicalReplicationOnSourceDbIfNeeded. */ + interface WithSetupLogicalReplicationOnSourceDbIfNeeded { + /** + * Specifies the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @param setupLogicalReplicationOnSourceDbIfNeeded Indicates whether to setup LogicalReplicationOnSourceDb, + * if needed. + * @return the next definition stage. + */ + Update withSetupLogicalReplicationOnSourceDbIfNeeded( + LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded); + } + + /** The stage of the MigrationResource update allowing to specify overwriteDbsInTarget. */ + interface WithOverwriteDbsInTarget { + /** + * Specifies the overwriteDbsInTarget property: Indicates whether the databases on the target server can be + * overwritten, if already present. If set to False, the migration workflow will wait for a confirmation, if + * it detects that the database already exists.. + * + * @param overwriteDbsInTarget Indicates whether the databases on the target server can be overwritten, if + * already present. If set to False, the migration workflow will wait for a confirmation, if it detects + * that the database already exists. + * @return the next definition stage. + */ + Update withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget); + } + + /** The stage of the MigrationResource update allowing to specify migrationWindowStartTimeInUtc. */ + interface WithMigrationWindowStartTimeInUtc { + /** + * Specifies the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @param migrationWindowStartTimeInUtc Start time in UTC for migration window. + * @return the next definition stage. + */ + Update withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc); + } + + /** The stage of the MigrationResource update allowing to specify startDataMigration. */ + interface WithStartDataMigration { + /** + * Specifies the startDataMigration property: Indicates whether the data migration should start right away. + * + * @param startDataMigration Indicates whether the data migration should start right away. + * @return the next definition stage. + */ + Update withStartDataMigration(StartDataMigrationEnum startDataMigration); + } + + /** The stage of the MigrationResource update allowing to specify triggerCutover. */ + interface WithTriggerCutover { + /** + * Specifies the triggerCutover property: To trigger cutover for entire migration we need to send this flag + * as True. + * + * @param triggerCutover To trigger cutover for entire migration we need to send this flag as True. + * @return the next definition stage. + */ + Update withTriggerCutover(TriggerCutoverEnum triggerCutover); + } + + /** The stage of the MigrationResource update allowing to specify dbsToTriggerCutoverOn. */ + interface WithDbsToTriggerCutoverOn { + /** + * Specifies the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases + * send triggerCutover flag as True and database names in this array. + * + * @param dbsToTriggerCutoverOn When you want to trigger cutover for specific databases send triggerCutover + * flag as True and database names in this array. + * @return the next definition stage. + */ + Update withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn); + } + + /** The stage of the MigrationResource update allowing to specify cancel. */ + interface WithCancel { + /** + * Specifies the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @param cancel To trigger cancel for entire migration we need to send this flag as True. + * @return the next definition stage. + */ + Update withCancel(CancelEnum cancel); + } + + /** The stage of the MigrationResource update allowing to specify dbsToCancelMigrationOn. */ + interface WithDbsToCancelMigrationOn { + /** + * Specifies the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases + * send cancel flag as True and database names in this array. + * + * @param dbsToCancelMigrationOn When you want to trigger cancel for specific databases send cancel flag as + * True and database names in this array. + * @return the next definition stage. + */ + Update withDbsToCancelMigrationOn(List dbsToCancelMigrationOn); + } + + /** The stage of the MigrationResource update allowing to specify migrationMode. */ + interface WithMigrationMode { + /** + * Specifies the migrationMode property: There are two types of migration modes Online and Offline. + * + * @param migrationMode There are two types of migration modes Online and Offline. + * @return the next definition stage. + */ + Update withMigrationMode(MigrationMode migrationMode); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MigrationResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MigrationResource refresh(Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceForPatch.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceForPatch.java new file mode 100644 index 000000000000..1296edd76d9d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceForPatch.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourcePropertiesForPatch; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Represents a migration resource for patch. */ +@Fluent +public final class MigrationResourceForPatch { + /* + * Migration resource properties. + */ + @JsonProperty(value = "properties") + private MigrationResourcePropertiesForPatch innerProperties; + + /* + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of MigrationResourceForPatch class. */ + public MigrationResourceForPatch() { + } + + /** + * Get the innerProperties property: Migration resource properties. + * + * @return the innerProperties value. + */ + private MigrationResourcePropertiesForPatch innerProperties() { + return this.innerProperties; + } + + /** + * 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 MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sourceDbServerResourceId property: ResourceId of the source database server. + * + * @return the sourceDbServerResourceId value. + */ + public String sourceDbServerResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().sourceDbServerResourceId(); + } + + /** + * Set the sourceDbServerResourceId property: ResourceId of the source database server. + * + * @param sourceDbServerResourceId the sourceDbServerResourceId value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withSourceDbServerResourceId(String sourceDbServerResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withSourceDbServerResourceId(sourceDbServerResourceId); + return this; + } + + /** + * Get the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @return the sourceDbServerFullyQualifiedDomainName value. + */ + public String sourceDbServerFullyQualifiedDomainName() { + return this.innerProperties() == null ? null : this.innerProperties().sourceDbServerFullyQualifiedDomainName(); + } + + /** + * Set the sourceDbServerFullyQualifiedDomainName property: Source server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @param sourceDbServerFullyQualifiedDomainName the sourceDbServerFullyQualifiedDomainName value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withSourceDbServerFullyQualifiedDomainName( + String sourceDbServerFullyQualifiedDomainName) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withSourceDbServerFullyQualifiedDomainName(sourceDbServerFullyQualifiedDomainName); + return this; + } + + /** + * Get the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @return the targetDbServerFullyQualifiedDomainName value. + */ + public String targetDbServerFullyQualifiedDomainName() { + return this.innerProperties() == null ? null : this.innerProperties().targetDbServerFullyQualifiedDomainName(); + } + + /** + * Set the targetDbServerFullyQualifiedDomainName property: Target server fully qualified domain name or ip. It is a + * optional value, if customer provide it, dms will always use it for connection. + * + * @param targetDbServerFullyQualifiedDomainName the targetDbServerFullyQualifiedDomainName value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withTargetDbServerFullyQualifiedDomainName( + String targetDbServerFullyQualifiedDomainName) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withTargetDbServerFullyQualifiedDomainName(targetDbServerFullyQualifiedDomainName); + return this; + } + + /** + * Get the secretParameters property: Migration secret parameters. + * + * @return the secretParameters value. + */ + public MigrationSecretParameters secretParameters() { + return this.innerProperties() == null ? null : this.innerProperties().secretParameters(); + } + + /** + * Set the secretParameters property: Migration secret parameters. + * + * @param secretParameters the secretParameters value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withSecretParameters(MigrationSecretParameters secretParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withSecretParameters(secretParameters); + return this; + } + + /** + * Get the dbsToMigrate property: Number of databases to migrate. + * + * @return the dbsToMigrate value. + */ + public List dbsToMigrate() { + return this.innerProperties() == null ? null : this.innerProperties().dbsToMigrate(); + } + + /** + * Set the dbsToMigrate property: Number of databases to migrate. + * + * @param dbsToMigrate the dbsToMigrate value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withDbsToMigrate(List dbsToMigrate) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withDbsToMigrate(dbsToMigrate); + return this; + } + + /** + * Get the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @return the setupLogicalReplicationOnSourceDbIfNeeded value. + */ + public LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded() { + return this.innerProperties() == null + ? null + : this.innerProperties().setupLogicalReplicationOnSourceDbIfNeeded(); + } + + /** + * Set the setupLogicalReplicationOnSourceDbIfNeeded property: Indicates whether to setup + * LogicalReplicationOnSourceDb, if needed. + * + * @param setupLogicalReplicationOnSourceDbIfNeeded the setupLogicalReplicationOnSourceDbIfNeeded value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withSetupLogicalReplicationOnSourceDbIfNeeded( + LogicalReplicationOnSourceDbEnum setupLogicalReplicationOnSourceDbIfNeeded) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withSetupLogicalReplicationOnSourceDbIfNeeded(setupLogicalReplicationOnSourceDbIfNeeded); + return this; + } + + /** + * Get the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten, + * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the + * database already exists. + * + * @return the overwriteDbsInTarget value. + */ + public OverwriteDbsInTargetEnum overwriteDbsInTarget() { + return this.innerProperties() == null ? null : this.innerProperties().overwriteDbsInTarget(); + } + + /** + * Set the overwriteDbsInTarget property: Indicates whether the databases on the target server can be overwritten, + * if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the + * database already exists. + * + * @param overwriteDbsInTarget the overwriteDbsInTarget value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withOverwriteDbsInTarget(OverwriteDbsInTargetEnum overwriteDbsInTarget) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withOverwriteDbsInTarget(overwriteDbsInTarget); + return this; + } + + /** + * Get the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @return the migrationWindowStartTimeInUtc value. + */ + public OffsetDateTime migrationWindowStartTimeInUtc() { + return this.innerProperties() == null ? null : this.innerProperties().migrationWindowStartTimeInUtc(); + } + + /** + * Set the migrationWindowStartTimeInUtc property: Start time in UTC for migration window. + * + * @param migrationWindowStartTimeInUtc the migrationWindowStartTimeInUtc value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withMigrationWindowStartTimeInUtc(OffsetDateTime migrationWindowStartTimeInUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withMigrationWindowStartTimeInUtc(migrationWindowStartTimeInUtc); + return this; + } + + /** + * Get the startDataMigration property: Indicates whether the data migration should start right away. + * + * @return the startDataMigration value. + */ + public StartDataMigrationEnum startDataMigration() { + return this.innerProperties() == null ? null : this.innerProperties().startDataMigration(); + } + + /** + * Set the startDataMigration property: Indicates whether the data migration should start right away. + * + * @param startDataMigration the startDataMigration value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withStartDataMigration(StartDataMigrationEnum startDataMigration) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withStartDataMigration(startDataMigration); + return this; + } + + /** + * Get the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True. + * + * @return the triggerCutover value. + */ + public TriggerCutoverEnum triggerCutover() { + return this.innerProperties() == null ? null : this.innerProperties().triggerCutover(); + } + + /** + * Set the triggerCutover property: To trigger cutover for entire migration we need to send this flag as True. + * + * @param triggerCutover the triggerCutover value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withTriggerCutover(TriggerCutoverEnum triggerCutover) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withTriggerCutover(triggerCutover); + return this; + } + + /** + * Get the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send + * triggerCutover flag as True and database names in this array. + * + * @return the dbsToTriggerCutoverOn value. + */ + public List dbsToTriggerCutoverOn() { + return this.innerProperties() == null ? null : this.innerProperties().dbsToTriggerCutoverOn(); + } + + /** + * Set the dbsToTriggerCutoverOn property: When you want to trigger cutover for specific databases send + * triggerCutover flag as True and database names in this array. + * + * @param dbsToTriggerCutoverOn the dbsToTriggerCutoverOn value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withDbsToTriggerCutoverOn(List dbsToTriggerCutoverOn) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withDbsToTriggerCutoverOn(dbsToTriggerCutoverOn); + return this; + } + + /** + * Get the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @return the cancel value. + */ + public CancelEnum cancel() { + return this.innerProperties() == null ? null : this.innerProperties().cancel(); + } + + /** + * Set the cancel property: To trigger cancel for entire migration we need to send this flag as True. + * + * @param cancel the cancel value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withCancel(CancelEnum cancel) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withCancel(cancel); + return this; + } + + /** + * Get the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag + * as True and database names in this array. + * + * @return the dbsToCancelMigrationOn value. + */ + public List dbsToCancelMigrationOn() { + return this.innerProperties() == null ? null : this.innerProperties().dbsToCancelMigrationOn(); + } + + /** + * Set the dbsToCancelMigrationOn property: When you want to trigger cancel for specific databases send cancel flag + * as True and database names in this array. + * + * @param dbsToCancelMigrationOn the dbsToCancelMigrationOn value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withDbsToCancelMigrationOn(List dbsToCancelMigrationOn) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withDbsToCancelMigrationOn(dbsToCancelMigrationOn); + return this; + } + + /** + * Get the migrationMode property: There are two types of migration modes Online and Offline. + * + * @return the migrationMode value. + */ + public MigrationMode migrationMode() { + return this.innerProperties() == null ? null : this.innerProperties().migrationMode(); + } + + /** + * Set the migrationMode property: There are two types of migration modes Online and Offline. + * + * @param migrationMode the migrationMode value to set. + * @return the MigrationResourceForPatch object itself. + */ + public MigrationResourceForPatch withMigrationMode(MigrationMode migrationMode) { + if (this.innerProperties() == null) { + this.innerProperties = new MigrationResourcePropertiesForPatch(); + } + this.innerProperties().withMigrationMode(migrationMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceListResult.java new file mode 100644 index 000000000000..13e03640ff07 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationResourceListResult.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of migration resources. */ +@Immutable +public final class MigrationResourceListResult { + /* + * A list of migration resources. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link used to get the next page of migrations. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of MigrationResourceListResult class. */ + public MigrationResourceListResult() { + } + + /** + * Get the value property: A list of migration resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link used to get the next page of migrations. + * + * @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSecretParameters.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSecretParameters.java new file mode 100644 index 000000000000..e0fb66380fc0 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSecretParameters.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Migration secret parameters. */ +@Fluent +public final class MigrationSecretParameters { + /* + * Admin credentials for source and target servers + */ + @JsonProperty(value = "adminCredentials") + private AdminCredentials adminCredentials; + + /* + * Gets or sets the username for the source server. This user need not be an admin. + */ + @JsonProperty(value = "sourceServerUsername") + private String sourceServerUsername; + + /* + * Gets or sets the username for the target server. This user need not be an admin. + */ + @JsonProperty(value = "targetServerUsername") + private String targetServerUsername; + + /** Creates an instance of MigrationSecretParameters class. */ + public MigrationSecretParameters() { + } + + /** + * Get the adminCredentials property: Admin credentials for source and target servers. + * + * @return the adminCredentials value. + */ + public AdminCredentials adminCredentials() { + return this.adminCredentials; + } + + /** + * Set the adminCredentials property: Admin credentials for source and target servers. + * + * @param adminCredentials the adminCredentials value to set. + * @return the MigrationSecretParameters object itself. + */ + public MigrationSecretParameters withAdminCredentials(AdminCredentials adminCredentials) { + this.adminCredentials = adminCredentials; + return this; + } + + /** + * Get the sourceServerUsername property: Gets or sets the username for the source server. This user need not be an + * admin. + * + * @return the sourceServerUsername value. + */ + public String sourceServerUsername() { + return this.sourceServerUsername; + } + + /** + * Set the sourceServerUsername property: Gets or sets the username for the source server. This user need not be an + * admin. + * + * @param sourceServerUsername the sourceServerUsername value to set. + * @return the MigrationSecretParameters object itself. + */ + public MigrationSecretParameters withSourceServerUsername(String sourceServerUsername) { + this.sourceServerUsername = sourceServerUsername; + return this; + } + + /** + * Get the targetServerUsername property: Gets or sets the username for the target server. This user need not be an + * admin. + * + * @return the targetServerUsername value. + */ + public String targetServerUsername() { + return this.targetServerUsername; + } + + /** + * Set the targetServerUsername property: Gets or sets the username for the target server. This user need not be an + * admin. + * + * @param targetServerUsername the targetServerUsername value to set. + * @return the MigrationSecretParameters object itself. + */ + public MigrationSecretParameters withTargetServerUsername(String targetServerUsername) { + this.targetServerUsername = targetServerUsername; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (adminCredentials() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adminCredentials in model MigrationSecretParameters")); + } else { + adminCredentials().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrationSecretParameters.class); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationState.java new file mode 100644 index 000000000000..9f9577eb84d1 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Migration state. */ +public final class MigrationState extends ExpandableStringEnum { + /** Static value InProgress for MigrationState. */ + public static final MigrationState IN_PROGRESS = fromString("InProgress"); + + /** Static value WaitingForUserAction for MigrationState. */ + public static final MigrationState WAITING_FOR_USER_ACTION = fromString("WaitingForUserAction"); + + /** Static value Canceled for MigrationState. */ + public static final MigrationState CANCELED = fromString("Canceled"); + + /** Static value Failed for MigrationState. */ + public static final MigrationState FAILED = fromString("Failed"); + + /** Static value Succeeded for MigrationState. */ + public static final MigrationState SUCCEEDED = fromString("Succeeded"); + + /** Static value ValidationFailed for MigrationState. */ + public static final MigrationState VALIDATION_FAILED = fromString("ValidationFailed"); + + /** Static value CleaningUp for MigrationState. */ + public static final MigrationState CLEANING_UP = fromString("CleaningUp"); + + /** + * Creates a new instance of MigrationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationState() { + } + + /** + * Creates or finds a MigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationState. + */ + @JsonCreator + public static MigrationState fromString(String name) { + return fromString(name, MigrationState.class); + } + + /** + * Gets known MigrationState values. + * + * @return known MigrationState values. + */ + public static Collection values() { + return values(MigrationState.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationStatus.java new file mode 100644 index 000000000000..cb25e1fd8a98 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationStatus.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Migration status. */ +@Immutable +public final class MigrationStatus { + /* + * State of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Error message, if any, for the migration state + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private String error; + + /* + * Current Migration sub state details. + */ + @JsonProperty(value = "currentSubStateDetails", access = JsonProperty.Access.WRITE_ONLY) + private MigrationSubStateDetails currentSubStateDetails; + + /** Creates an instance of MigrationStatus class. */ + public MigrationStatus() { + } + + /** + * Get the state property: State of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the error property: Error message, if any, for the migration state. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Get the currentSubStateDetails property: Current Migration sub state details. + * + * @return the currentSubStateDetails value. + */ + public MigrationSubStateDetails currentSubStateDetails() { + return this.currentSubStateDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (currentSubStateDetails() != null) { + currentSubStateDetails().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubState.java new file mode 100644 index 000000000000..d8848fb8d0ae --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubState.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Migration sub state. */ +public final class MigrationSubState extends ExpandableStringEnum { + /** Static value PerformingPreRequisiteSteps for MigrationSubState. */ + public static final MigrationSubState PERFORMING_PRE_REQUISITE_STEPS = fromString("PerformingPreRequisiteSteps"); + + /** Static value WaitingForLogicalReplicationSetupRequestOnSourceDB for MigrationSubState. */ + public static final MigrationSubState WAITING_FOR_LOGICAL_REPLICATION_SETUP_REQUEST_ON_SOURCE_DB = + fromString("WaitingForLogicalReplicationSetupRequestOnSourceDB"); + + /** Static value WaitingForDBsToMigrateSpecification for MigrationSubState. */ + public static final MigrationSubState WAITING_FOR_DBS_TO_MIGRATE_SPECIFICATION = + fromString("WaitingForDBsToMigrateSpecification"); + + /** Static value WaitingForTargetDBOverwriteConfirmation for MigrationSubState. */ + public static final MigrationSubState WAITING_FOR_TARGET_DBOVERWRITE_CONFIRMATION = + fromString("WaitingForTargetDBOverwriteConfirmation"); + + /** Static value WaitingForDataMigrationScheduling for MigrationSubState. */ + public static final MigrationSubState WAITING_FOR_DATA_MIGRATION_SCHEDULING = + fromString("WaitingForDataMigrationScheduling"); + + /** Static value WaitingForDataMigrationWindow for MigrationSubState. */ + public static final MigrationSubState WAITING_FOR_DATA_MIGRATION_WINDOW = + fromString("WaitingForDataMigrationWindow"); + + /** Static value MigratingData for MigrationSubState. */ + public static final MigrationSubState MIGRATING_DATA = fromString("MigratingData"); + + /** Static value WaitingForCutoverTrigger for MigrationSubState. */ + public static final MigrationSubState WAITING_FOR_CUTOVER_TRIGGER = fromString("WaitingForCutoverTrigger"); + + /** Static value CompletingMigration for MigrationSubState. */ + public static final MigrationSubState COMPLETING_MIGRATION = fromString("CompletingMigration"); + + /** Static value Completed for MigrationSubState. */ + public static final MigrationSubState COMPLETED = fromString("Completed"); + + /** Static value CancelingRequestedDBMigrations for MigrationSubState. */ + public static final MigrationSubState CANCELING_REQUESTED_DBMIGRATIONS = + fromString("CancelingRequestedDBMigrations"); + + /** Static value ValidationInProgress for MigrationSubState. */ + public static final MigrationSubState VALIDATION_IN_PROGRESS = fromString("ValidationInProgress"); + + /** + * Creates a new instance of MigrationSubState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationSubState() { + } + + /** + * Creates or finds a MigrationSubState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationSubState. + */ + @JsonCreator + public static MigrationSubState fromString(String name) { + return fromString(name, MigrationSubState.class); + } + + /** + * Gets known MigrationSubState values. + * + * @return known MigrationSubState values. + */ + public static Collection values() { + return values(MigrationSubState.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubStateDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubStateDetails.java new file mode 100644 index 000000000000..1d8467b09956 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/MigrationSubStateDetails.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Migration sub state details. */ +@Fluent +public final class MigrationSubStateDetails { + /* + * Migration sub state. + */ + @JsonProperty(value = "currentSubState", access = JsonProperty.Access.WRITE_ONLY) + private MigrationSubState currentSubState; + + /* + * Dictionary of + */ + @JsonProperty(value = "dbDetails") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map dbDetails; + + /* + * Details for the validation for migration + */ + @JsonProperty(value = "validationDetails") + private ValidationDetails validationDetails; + + /** Creates an instance of MigrationSubStateDetails class. */ + public MigrationSubStateDetails() { + } + + /** + * Get the currentSubState property: Migration sub state. + * + * @return the currentSubState value. + */ + public MigrationSubState currentSubState() { + return this.currentSubState; + } + + /** + * Get the dbDetails property: Dictionary of <DbMigrationStatus>. + * + * @return the dbDetails value. + */ + public Map dbDetails() { + return this.dbDetails; + } + + /** + * Set the dbDetails property: Dictionary of <DbMigrationStatus>. + * + * @param dbDetails the dbDetails value to set. + * @return the MigrationSubStateDetails object itself. + */ + public MigrationSubStateDetails withDbDetails(Map dbDetails) { + this.dbDetails = dbDetails; + return this; + } + + /** + * Get the validationDetails property: Details for the validation for migration. + * + * @return the validationDetails value. + */ + public ValidationDetails validationDetails() { + return this.validationDetails; + } + + /** + * Set the validationDetails property: Details for the validation for migration. + * + * @param validationDetails the validationDetails value to set. + * @return the MigrationSubStateDetails object itself. + */ + public MigrationSubStateDetails withValidationDetails(ValidationDetails validationDetails) { + this.validationDetails = validationDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dbDetails() != null) { + dbDetails() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (validationDetails() != null) { + validationDetails().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Migrations.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Migrations.java new file mode 100644 index 000000000000..a75d40fc38f4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Migrations.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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 Migrations. */ +public interface Migrations { + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 details of a migration along with {@link Response}. + */ + Response getWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context); + + /** + * Gets details of a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 details of a migration. + */ + MigrationResource get( + String subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName); + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 {@link Response}. + */ + Response deleteWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + String migrationName, + Context context); + + /** + * Deletes a migration. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationName The name of the migration. + * @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 subscriptionId, String resourceGroupName, String targetDbServerName, String migrationName); + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database 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 migration resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTargetServer( + String subscriptionId, String resourceGroupName, String targetDbServerName); + + /** + * List all the migrations on a given target server. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param migrationListFilter Migration list filter. Retrieves either active migrations or all migrations. + * @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 migration resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTargetServer( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationListFilter migrationListFilter, + Context context); + + /** + * Gets details of a migration. + * + * @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 details of a migration along with {@link Response}. + */ + MigrationResource getById(String id); + + /** + * Gets details of a migration. + * + * @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 details of a migration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a migration. + * + * @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 migration. + * + * @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 the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MigrationResource resource. + * + * @param name resource name. + * @return the first stage of the new MigrationResource definition. + */ + MigrationResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NameProperty.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NameProperty.java new file mode 100644 index 000000000000..70eb8a5c33b3 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NameProperty.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Name property for quota usage. */ +@Fluent +public final class NameProperty { + /* + * Name value + */ + @JsonProperty(value = "value") + private String value; + + /* + * Localized name + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** Creates an instance of NameProperty class. */ + public NameProperty() { + } + + /** + * Get the value property: Name value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Name value. + * + * @param value the value value to set. + * @return the NameProperty object itself. + */ + public NameProperty withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: Localized name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: Localized name. + * + * @param localizedValue the localizedValue value to set. + * @return the NameProperty object itself. + */ + public NameProperty withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Network.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Network.java index e2607fb8a903..e66d903cadcd 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Network.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Network.java @@ -13,7 +13,7 @@ public final class Network { /* * public network access is enabled or not */ - @JsonProperty(value = "publicNetworkAccess", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "publicNetworkAccess") private ServerPublicNetworkAccessState publicNetworkAccess; /* @@ -45,6 +45,17 @@ public ServerPublicNetworkAccessState publicNetworkAccess() { return this.publicNetworkAccess; } + /** + * Set the publicNetworkAccess property: public network access is enabled or not. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the Network object itself. + */ + public Network withPublicNetworkAccess(ServerPublicNetworkAccessState publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + /** * Get the delegatedSubnetResourceId property: Delegated subnet arm resource id. This is required to be passed * during create, in case we want the server to be VNET injected, i.e. Private access server. During update, pass diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NodeTypeCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NodeTypeCapability.java deleted file mode 100644 index 023f95bd6df8..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/NodeTypeCapability.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.postgresqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** node type capability. */ -@Immutable -public final class NodeTypeCapability { - /* - * note type name - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * note type - */ - @JsonProperty(value = "nodeType", access = JsonProperty.Access.WRITE_ONLY) - private String nodeType; - - /* - * The status - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** Creates an instance of NodeTypeCapability class. */ - public NodeTypeCapability() { - } - - /** - * Get the name property: note type name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the nodeType property: note type. - * - * @return the nodeType value. - */ - public String nodeType() { - return this.nodeType; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OnlineResizeSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OnlineResizeSupportedEnum.java new file mode 100644 index 000000000000..71e6fe0ccd1f --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OnlineResizeSupportedEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * A value indicating whether online resize is supported in this region for the given subscription. "Enabled" means + * storage online resize is supported. "Disabled" means storage online resize is not supported. + */ +public final class OnlineResizeSupportedEnum extends ExpandableStringEnum { + /** Static value Enabled for OnlineResizeSupportedEnum. */ + public static final OnlineResizeSupportedEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for OnlineResizeSupportedEnum. */ + public static final OnlineResizeSupportedEnum DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of OnlineResizeSupportedEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OnlineResizeSupportedEnum() { + } + + /** + * Creates or finds a OnlineResizeSupportedEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding OnlineResizeSupportedEnum. + */ + @JsonCreator + public static OnlineResizeSupportedEnum fromString(String name) { + return fromString(name, OnlineResizeSupportedEnum.class); + } + + /** + * Gets known OnlineResizeSupportedEnum values. + * + * @return known OnlineResizeSupportedEnum values. + */ + public static Collection values() { + return values(OnlineResizeSupportedEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OverwriteDbsInTargetEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OverwriteDbsInTargetEnum.java new file mode 100644 index 000000000000..e2d42c5162cd --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/OverwriteDbsInTargetEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the + * migration workflow will wait for a confirmation, if it detects that the database already exists. + */ +public final class OverwriteDbsInTargetEnum extends ExpandableStringEnum { + /** Static value True for OverwriteDbsInTargetEnum. */ + public static final OverwriteDbsInTargetEnum TRUE = fromString("True"); + + /** Static value False for OverwriteDbsInTargetEnum. */ + public static final OverwriteDbsInTargetEnum FALSE = fromString("False"); + + /** + * Creates a new instance of OverwriteDbsInTargetEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OverwriteDbsInTargetEnum() { + } + + /** + * Creates or finds a OverwriteDbsInTargetEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding OverwriteDbsInTargetEnum. + */ + @JsonCreator + public static OverwriteDbsInTargetEnum fromString(String name) { + return fromString(name, OverwriteDbsInTargetEnum.class); + } + + /** + * Gets known OverwriteDbsInTargetEnum values. + * + * @return known OverwriteDbsInTargetEnum values. + */ + public static Collection values() { + return values(OverwriteDbsInTargetEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpoint.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpoint.java new file mode 100644 index 000000000000..a16ada08633e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The private endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + /* + * The ARM identifier for private endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnection.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..b8e7d7703c52 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnection.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import java.util.List; + +/** 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..ebd7e51aa393 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionListResult.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private endpoint connections. */ +@Immutable +public final class PrivateEndpointConnectionListResult { + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The URL to get the next set 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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionOperations.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionOperations.java new file mode 100644 index 000000000000..9ab2dc7395ce --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionOperations.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; + +/** Resource collection API of PrivateEndpointConnectionOperations. */ +public interface PrivateEndpointConnectionOperations { + /** + * 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource. + */ + PrivateEndpointConnection update( + 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 name of the private endpoint connection. + * @param parameters The required parameters for updating 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 the private endpoint connection resource. + */ + PrivateEndpointConnection update( + 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 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. + */ + 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 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. + */ + void delete(String resourceGroupName, String serverName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..51e04d783386 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnectionProvisioningState.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current provisioning state. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnections.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..17dd21cf4d7e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointConnections.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serverName, String privateEndpointConnectionName, 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 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 000000000000..98adefd179f2 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The private endpoint connection status. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResource.java new file mode 100644 index 000000000000..c8036979dee2 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResourceListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..961adcf58b3e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResourceListResult.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Immutable +public final class PrivateLinkResourceListResult { + /* + * 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; + + /** Creates an instance of PrivateLinkResourceListResult class. */ + public PrivateLinkResourceListResult() { + } + + /** + * 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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResources.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResources.java new file mode 100644 index 000000000000..cc2af9ac90a7 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkResources.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serverName, String groupName, 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); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkServiceConnectionState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..ca6e777ee825 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsage.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsage.java new file mode 100644 index 000000000000..92aa8bde6329 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsage.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; + +/** An immutable client-side representation of QuotaUsage. */ +public interface QuotaUsage { + /** + * Gets the name property: Name of quota usage for flexible servers. + * + * @return the name value. + */ + NameProperty name(); + + /** + * Gets the limit property: Quota limit. + * + * @return the limit value. + */ + Long limit(); + + /** + * Gets the unit property: Quota unit. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the currentValue property: Current Quota usage value. + * + * @return the currentValue value. + */ + Long currentValue(); + + /** + * Gets the id property: Fully qualified ARM resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner object. + * + * @return the inner object. + */ + QuotaUsageInner innerModel(); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsages.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsages.java new file mode 100644 index 000000000000..b2635a04d27c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsages.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of QuotaUsages. */ +public interface QuotaUsages { + /** + * Get quota usages 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 quota usages at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String locationName); + + /** + * Get quota usages 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 quota usages at specified location in a given subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String locationName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsagesListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsagesListResult.java new file mode 100644 index 000000000000..c18b98c3d38a --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/QuotaUsagesListResult.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Capability for the PostgreSQL server. */ +@Immutable +public final class QuotaUsagesListResult { + /* + * A list of quota usages. + */ + @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; + + /** Creates an instance of QuotaUsagesListResult class. */ + public QuotaUsagesListResult() { + } + + /** + * Get the value property: A list of quota usages. + * + * @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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReadReplicaPromoteMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReadReplicaPromoteMode.java new file mode 100644 index 000000000000..dde6c4f1d6b5 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReadReplicaPromoteMode.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Sets the promote mode for a replica server. This is a write only property. */ +public final class ReadReplicaPromoteMode extends ExpandableStringEnum { + /** Static value standalone for ReadReplicaPromoteMode. */ + public static final ReadReplicaPromoteMode STANDALONE = fromString("standalone"); + + /** Static value switchover for ReadReplicaPromoteMode. */ + public static final ReadReplicaPromoteMode SWITCHOVER = fromString("switchover"); + + /** + * Creates a new instance of ReadReplicaPromoteMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReadReplicaPromoteMode() { + } + + /** + * Creates or finds a ReadReplicaPromoteMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReadReplicaPromoteMode. + */ + @JsonCreator + public static ReadReplicaPromoteMode fromString(String name) { + return fromString(name, ReadReplicaPromoteMode.class); + } + + /** + * Gets known ReadReplicaPromoteMode values. + * + * @return known ReadReplicaPromoteMode values. + */ + public static Collection values() { + return values(ReadReplicaPromoteMode.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Replica.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Replica.java new file mode 100644 index 000000000000..f8b6d787af50 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Replica.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replica properties of a server. */ +@Fluent +public final class Replica { + /* + * Used to indicate role of the server in replication set. + */ + @JsonProperty(value = "role") + private ReplicationRole role; + + /* + * Replicas allowed for a server. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private Integer capacity; + + /* + * Gets the replication state of a replica server. This property is returned only for replicas api call. Supported + * values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring + */ + @JsonProperty(value = "replicationState", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationState replicationState; + + /* + * Sets the promote mode for a replica server. This is a write only property. + */ + @JsonProperty(value = "promoteMode") + private ReadReplicaPromoteMode promoteMode; + + /* + * Sets the promote options for a replica server. This is a write only property. + */ + @JsonProperty(value = "promoteOption") + private ReplicationPromoteOption promoteOption; + + /** Creates an instance of Replica class. */ + public Replica() { + } + + /** + * Get the role property: Used to indicate role of the server in replication set. + * + * @return the role value. + */ + public ReplicationRole role() { + return this.role; + } + + /** + * Set the role property: Used to indicate role of the server in replication set. + * + * @param role the role value to set. + * @return the Replica object itself. + */ + public Replica withRole(ReplicationRole role) { + this.role = role; + return this; + } + + /** + * Get the capacity property: Replicas allowed for a server. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Get the replicationState property: Gets the replication state of a replica server. This property is returned only + * for replicas api call. Supported values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring. + * + * @return the replicationState value. + */ + public ReplicationState replicationState() { + return this.replicationState; + } + + /** + * Get the promoteMode property: Sets the promote mode for a replica server. This is a write only property. + * + * @return the promoteMode value. + */ + public ReadReplicaPromoteMode promoteMode() { + return this.promoteMode; + } + + /** + * Set the promoteMode property: Sets the promote mode for a replica server. This is a write only property. + * + * @param promoteMode the promoteMode value to set. + * @return the Replica object itself. + */ + public Replica withPromoteMode(ReadReplicaPromoteMode promoteMode) { + this.promoteMode = promoteMode; + return this; + } + + /** + * Get the promoteOption property: Sets the promote options for a replica server. This is a write only property. + * + * @return the promoteOption value. + */ + public ReplicationPromoteOption promoteOption() { + return this.promoteOption; + } + + /** + * Set the promoteOption property: Sets the promote options for a replica server. This is a write only property. + * + * @param promoteOption the promoteOption value to set. + * @return the Replica object itself. + */ + public Replica withPromoteOption(ReplicationPromoteOption promoteOption) { + this.promoteOption = promoteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationPromoteOption.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationPromoteOption.java new file mode 100644 index 000000000000..f97e044dd6b3 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationPromoteOption.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Sets the promote options for a replica server. This is a write only property. */ +public final class ReplicationPromoteOption extends ExpandableStringEnum { + /** Static value planned for ReplicationPromoteOption. */ + public static final ReplicationPromoteOption PLANNED = fromString("planned"); + + /** Static value forced for ReplicationPromoteOption. */ + public static final ReplicationPromoteOption FORCED = fromString("forced"); + + /** + * Creates a new instance of ReplicationPromoteOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationPromoteOption() { + } + + /** + * Creates or finds a ReplicationPromoteOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationPromoteOption. + */ + @JsonCreator + public static ReplicationPromoteOption fromString(String name) { + return fromString(name, ReplicationPromoteOption.class); + } + + /** + * Gets known ReplicationPromoteOption values. + * + * @return known ReplicationPromoteOption values. + */ + public static Collection values() { + return values(ReplicationPromoteOption.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationState.java new file mode 100644 index 000000000000..b883512064fb --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ReplicationState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Gets the replication state of a replica server. This property is returned only for replicas api call. Supported + * values are Active, Catchup, Provisioning, Updating, Broken, Reconfiguring. + */ +public final class ReplicationState extends ExpandableStringEnum { + /** Static value Active for ReplicationState. */ + public static final ReplicationState ACTIVE = fromString("Active"); + + /** Static value Catchup for ReplicationState. */ + public static final ReplicationState CATCHUP = fromString("Catchup"); + + /** Static value Provisioning for ReplicationState. */ + public static final ReplicationState PROVISIONING = fromString("Provisioning"); + + /** Static value Updating for ReplicationState. */ + public static final ReplicationState UPDATING = fromString("Updating"); + + /** Static value Broken for ReplicationState. */ + public static final ReplicationState BROKEN = fromString("Broken"); + + /** Static value Reconfiguring for ReplicationState. */ + public static final ReplicationState RECONFIGURING = fromString("Reconfiguring"); + + /** + * Creates a new instance of ReplicationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationState() { + } + + /** + * Creates or finds a ReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationState. + */ + @JsonCreator + public static ReplicationState fromString(String name) { + return fromString(name, ReplicationState.class); + } + + /** + * Gets known ReplicationState values. + * + * @return known ReplicationState values. + */ + public static Collection values() { + return values(ReplicationState.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ResourceProviders.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ResourceProviders.java new file mode 100644 index 000000000000..eb00ca559fc5 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ResourceProviders.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.postgresqlflexibleserver.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @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 migration name's availability along with {@link Response}. + */ + Response checkMigrationNameAvailabilityWithResponse( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters, + Context context); + + /** + * Check migration name validity and availability + * + *

This method checks whether a proposed migration name is valid and available. + * + * @param subscriptionId The subscription ID of the target database server. + * @param resourceGroupName The resource group name of the target database server. + * @param targetDbServerName The name of the target database server. + * @param parameters The required parameters for checking if a migration name is available. + * @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 migration name's availability. + */ + MigrationNameAvailabilityResource checkMigrationNameAvailability( + String subscriptionId, + String resourceGroupName, + String targetDbServerName, + MigrationNameAvailabilityResourceInner parameters); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestrictedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestrictedEnum.java new file mode 100644 index 000000000000..41e759e9d661 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/RestrictedEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * A value indicating whether this region is restricted. "Enabled" means region is restricted. "Disabled" stands for + * region is not restricted. + */ +public final class RestrictedEnum extends ExpandableStringEnum { + /** Static value Enabled for RestrictedEnum. */ + public static final RestrictedEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for RestrictedEnum. */ + public static final RestrictedEnum DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of RestrictedEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RestrictedEnum() { + } + + /** + * Creates or finds a RestrictedEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestrictedEnum. + */ + @JsonCreator + public static RestrictedEnum fromString(String name) { + return fromString(name, RestrictedEnum.class); + } + + /** + * Gets known RestrictedEnum values. + * + * @return known RestrictedEnum values. + */ + public static Collection values() { + return values(RestrictedEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java index 456de209f742..f7b71143059e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Server.java @@ -9,6 +9,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerInner; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of Server. */ @@ -164,8 +165,8 @@ public interface Server { /** * Gets the sourceServerResourceId property: The source server resource ID to restore from. It's required when - * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. This property is returned only for Replica - * server. + * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned + * only for Replica server. * * @return the sourceServerResourceId value. */ @@ -173,7 +174,7 @@ public interface Server { /** * Gets the pointInTimeUtc property: Restore point creation time (ISO8601 format), specifying the time to restore - * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'. + * from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'. * * @return the pointInTimeUtc value. */ @@ -200,6 +201,14 @@ public interface Server { */ Integer replicaCapacity(); + /** + * Gets the replica property: Replica properties of a server. These Replica properties are required to be passed + * only in case you want to Promote a server. + * + * @return the replica value. + */ + Replica replica(); + /** * Gets the createMode property: The mode to create a new PostgreSQL server. * @@ -207,6 +216,14 @@ public interface Server { */ CreateMode createMode(); + /** + * Gets the privateEndpointConnections property: List of private endpoint connections associated with the specified + * resource. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + /** * Gets the region of the resource. * @@ -458,12 +475,12 @@ interface WithHighAvailability { interface WithSourceServerResourceId { /** * Specifies the sourceServerResourceId property: The source server resource ID to restore from. It's - * required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. This property is - * returned only for Replica server. + * required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This + * property is returned only for Replica server. * * @param sourceServerResourceId The source server resource ID to restore from. It's required when - * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. This property is returned only for - * Replica server. + * 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property + * is returned only for Replica server. * @return the next definition stage. */ WithCreate withSourceServerResourceId(String sourceServerResourceId); @@ -473,10 +490,11 @@ interface WithSourceServerResourceId { 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' or 'GeoRestore'.. + * to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or + * 'ReviveDropped'.. * * @param pointInTimeUtc Restore point creation time (ISO8601 format), specifying the time to restore from. - * It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore'. + * It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'. * @return the next definition stage. */ WithCreate withPointInTimeUtc(OffsetDateTime pointInTimeUtc); @@ -538,6 +556,7 @@ interface Update UpdateStages.WithDataEncryption, UpdateStages.WithCreateMode, UpdateStages.WithReplicationRole, + UpdateStages.WithReplica, UpdateStages.WithNetwork { /** * Executes the update request. @@ -604,9 +623,10 @@ interface WithAdministratorLoginPassword { /** The stage of the Server update allowing to specify version. */ interface WithVersion { /** - * Specifies the version property: PostgreSQL Server version.. + * Specifies the version property: PostgreSQL Server version. Version 16 is currently not supported for + * MVU.. * - * @param version PostgreSQL Server version. + * @param version PostgreSQL Server version. Version 16 is currently not supported for MVU. * @return the next definition stage. */ Update withVersion(ServerVersion version); @@ -700,6 +720,19 @@ interface WithReplicationRole { Update withReplicationRole(ReplicationRole replicationRole); } + /** The stage of the Server update allowing to specify replica. */ + interface WithReplica { + /** + * Specifies the replica property: Replica properties of a server. These Replica properties are required to + * be passed only in case you want to Promote a server.. + * + * @param replica Replica properties of a server. These Replica properties are required to be passed only in + * case you want to Promote a server. + * @return the next definition stage. + */ + Update withReplica(Replica replica); + } + /** The stage of the Server update allowing to specify network. */ interface WithNetwork { /** diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerCapabilities.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerCapabilities.java new file mode 100644 index 000000000000..b2368df76bd4 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerCapabilities.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ServerCapabilities. */ +public interface ServerCapabilities { + /** + * Get capabilities for a flexible 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 capabilities for a flexible server as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName); + + /** + * Get capabilities for a flexible 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 capabilities for a flexible server as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serverName, Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java index a3b904e33f74..778399f37673 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerForUpdate.java @@ -135,7 +135,7 @@ public ServerForUpdate withAdministratorLoginPassword(String administratorLoginP } /** - * Get the version property: PostgreSQL Server version. + * Get the version property: PostgreSQL Server version. Version 16 is currently not supported for MVU. * * @return the version value. */ @@ -144,7 +144,7 @@ public ServerVersion version() { } /** - * Set the version property: PostgreSQL Server version. + * Set the version property: PostgreSQL Server version. Version 16 is currently not supported for MVU. * * @param version the version value to set. * @return the ServerForUpdate object itself. @@ -341,6 +341,31 @@ public ServerForUpdate withReplicationRole(ReplicationRole replicationRole) { return this; } + /** + * Get the replica property: Replica properties of a server. These Replica properties are required to be passed only + * in case you want to Promote a server. + * + * @return the replica value. + */ + public Replica replica() { + return this.innerProperties() == null ? null : this.innerProperties().replica(); + } + + /** + * Set the replica property: Replica properties of a server. These Replica properties are required to be passed only + * in case you want to Promote a server. + * + * @param replica the replica value to set. + * @return the ServerForUpdate object itself. + */ + public ServerForUpdate withReplica(Replica replica) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerPropertiesForUpdate(); + } + this.innerProperties().withReplica(replica); + return this; + } + /** * Get the network property: Network properties of a server. These are required to be passed only in case if server * is a private access server. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSku.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSku.java new file mode 100644 index 000000000000..4984668b0018 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSku.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sku information related properties of a server. */ +@Fluent +public final class ServerSku { + /* + * The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The tier of the particular SKU, e.g. Burstable. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** Creates an instance of ServerSku class. */ + public ServerSku() { + } + + /** + * Get the name property: The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * 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 ServerSku object itself. + */ + public ServerSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The tier of the particular SKU, e.g. Burstable. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: The tier of the particular SKU, e.g. Burstable. + * + * @param tier the tier value to set. + * @return the ServerSku object itself. + */ + public ServerSku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSkuCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSkuCapability.java new file mode 100644 index 000000000000..f757554d2819 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerSkuCapability.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sku capability. */ +@Immutable +public final class ServerSkuCapability extends CapabilityBase { + /* + * Sku name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Supported vCores + */ + @JsonProperty(value = "vCores", access = JsonProperty.Access.WRITE_ONLY) + private Integer vCores; + + /* + * Supported IOPS + */ + @JsonProperty(value = "supportedIops", access = JsonProperty.Access.WRITE_ONLY) + private Integer supportedIops; + + /* + * Supported memory per vCore in MB + */ + @JsonProperty(value = "supportedMemoryPerVcoreMb", access = JsonProperty.Access.WRITE_ONLY) + private Long supportedMemoryPerVcoreMb; + + /* + * List of supported Availability Zones. E.g. "1", "2", "3" + */ + @JsonProperty(value = "supportedZones", access = JsonProperty.Access.WRITE_ONLY) + private List supportedZones; + + /* + * Supported high availability mode + */ + @JsonProperty(value = "supportedHaMode", access = JsonProperty.Access.WRITE_ONLY) + private List supportedHaMode; + + /** Creates an instance of ServerSkuCapability class. */ + public ServerSkuCapability() { + } + + /** + * Get the name property: Sku name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the vCores property: Supported vCores. + * + * @return the vCores value. + */ + public Integer vCores() { + return this.vCores; + } + + /** + * Get the supportedIops property: Supported IOPS. + * + * @return the supportedIops value. + */ + public Integer supportedIops() { + return this.supportedIops; + } + + /** + * Get the supportedMemoryPerVcoreMb property: Supported memory per vCore in MB. + * + * @return the supportedMemoryPerVcoreMb value. + */ + public Long supportedMemoryPerVcoreMb() { + return this.supportedMemoryPerVcoreMb; + } + + /** + * Get the supportedZones property: List of supported Availability Zones. E.g. "1", "2", "3". + * + * @return the supportedZones value. + */ + public List supportedZones() { + return this.supportedZones; + } + + /** + * Get the supportedHaMode property: Supported high availability mode. + * + * @return the supportedHaMode value. + */ + public List supportedHaMode() { + return this.supportedHaMode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionListResult.java new file mode 100644 index 000000000000..ef3b9390b18d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionListResult.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of the server's Advanced Threat Protection settings. */ +@Immutable +public final class ServerThreatProtectionListResult { + /* + * 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; + + /** Creates an instance of ServerThreatProtectionListResult class. */ + public ServerThreatProtectionListResult() { + } + + /** + * 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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionSettings.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionSettings.java new file mode 100644 index 000000000000..73bd1e80011d --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionSettings.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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 ServerThreatProtectionSettings. */ +public interface ServerThreatProtectionSettings { + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * Get a list of server's Threat Protection state. + * + * @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's Threat Protection state as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer( + String resourceGroupName, String serverName, Context context); + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName, Context context); + + /** + * Get a server's Advanced Threat Protection settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param threatProtectionName The name of the Threat Protection 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 server's Advanced Threat Protection settings. + */ + ServerThreatProtectionSettingsModel get( + String resourceGroupName, String serverName, ThreatProtectionName threatProtectionName); + + /** + * Get a server's Advanced Threat Protection settings. + * + * @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 Advanced Threat Protection settings along with {@link Response}. + */ + ServerThreatProtectionSettingsModel getById(String id); + + /** + * Get a server's Advanced Threat Protection settings. + * + * @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 Advanced Threat Protection settings along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ServerThreatProtectionSettingsModel resource. + * + * @param name resource name. + * @return the first stage of the new ServerThreatProtectionSettingsModel definition. + */ + ServerThreatProtectionSettingsModel.DefinitionStages.Blank define(ThreatProtectionName name); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionSettingsModel.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionSettingsModel.java new file mode 100644 index 000000000000..dd621b9d7db8 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerThreatProtectionSettingsModel.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ServerThreatProtectionSettingsModel. */ +public interface ServerThreatProtectionSettingsModel { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the state property: Specifies the state of the Threat Protection, whether it is enabled or disabled or a + * state has not been applied yet on the specific server. + * + * @return the state value. + */ + ThreatProtectionState state(); + + /** + * Gets the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner object. + * + * @return the inner object. + */ + ServerThreatProtectionSettingsModelInner innerModel(); + + /** The entirety of the ServerThreatProtectionSettingsModel definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The ServerThreatProtectionSettingsModel definition stages. */ + interface DefinitionStages { + /** The first stage of the ServerThreatProtectionSettingsModel definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ServerThreatProtectionSettingsModel 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 withExistingFlexibleServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the ServerThreatProtectionSettingsModel 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServerThreatProtectionSettingsModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServerThreatProtectionSettingsModel create(Context context); + } + + /** The stage of the ServerThreatProtectionSettingsModel definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the Threat Protection, whether it is enabled or + * disabled or a state has not been applied yet on the specific server.. + * + * @param state Specifies the state of the Threat Protection, whether it is enabled or disabled or a state + * has not been applied yet on the specific server. + * @return the next definition stage. + */ + WithCreate withState(ThreatProtectionState state); + } + } + + /** + * Begins update for the ServerThreatProtectionSettingsModel resource. + * + * @return the stage of resource update. + */ + ServerThreatProtectionSettingsModel.Update update(); + + /** The template for ServerThreatProtectionSettingsModel update. */ + interface Update extends UpdateStages.WithState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServerThreatProtectionSettingsModel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServerThreatProtectionSettingsModel apply(Context context); + } + + /** The ServerThreatProtectionSettingsModel update stages. */ + interface UpdateStages { + /** The stage of the ServerThreatProtectionSettingsModel update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the Threat Protection, whether it is enabled or + * disabled or a state has not been applied yet on the specific server.. + * + * @param state Specifies the state of the Threat Protection, whether it is enabled or disabled or a state + * has not been applied yet on the specific server. + * @return the next definition stage. + */ + Update withState(ThreatProtectionState state); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServerThreatProtectionSettingsModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServerThreatProtectionSettingsModel refresh(Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersion.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersion.java index 84fce11b9595..e249cf74700b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersion.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersion.java @@ -10,6 +10,9 @@ /** The version of a server. */ public final class ServerVersion extends ExpandableStringEnum { + /** Static value 15 for ServerVersion. */ + public static final ServerVersion ONE_FIVE = fromString("15"); + /** Static value 14 for ServerVersion. */ public static final ServerVersion ONE_FOUR = fromString("14"); @@ -22,6 +25,9 @@ public final class ServerVersion extends ExpandableStringEnum { /** Static value 11 for ServerVersion. */ public static final ServerVersion ONE_ONE = fromString("11"); + /** Static value 16 for ServerVersion. */ + public static final ServerVersion ONE_SIX = fromString("16"); + /** * Creates a new instance of ServerVersion value. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersionCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersionCapability.java index b8bc63607414..e40503bee92b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersionCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ServerVersionCapability.java @@ -10,9 +10,9 @@ /** Server version capabilities. */ @Immutable -public final class ServerVersionCapability { +public final class ServerVersionCapability extends CapabilityBase { /* - * server version + * Server version */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; @@ -23,24 +23,12 @@ public final class ServerVersionCapability { @JsonProperty(value = "supportedVersionsToUpgrade", access = JsonProperty.Access.WRITE_ONLY) private List supportedVersionsToUpgrade; - /* - * The supportedVcores property. - */ - @JsonProperty(value = "supportedVcores", access = JsonProperty.Access.WRITE_ONLY) - private List supportedVcores; - - /* - * The status - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - /** Creates an instance of ServerVersionCapability class. */ public ServerVersionCapability() { } /** - * Get the name property: server version. + * Get the name property: Server version. * * @return the name value. */ @@ -57,32 +45,13 @@ public List supportedVersionsToUpgrade() { return this.supportedVersionsToUpgrade; } - /** - * Get the supportedVcores property: The supportedVcores property. - * - * @return the supportedVcores value. - */ - public List supportedVcores() { - return this.supportedVcores; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { - if (supportedVcores() != null) { - supportedVcores().forEach(e -> e.validate()); - } + super.validate(); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SourceType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SourceType.java new file mode 100644 index 000000000000..f08e4641f1fe --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SourceType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Migration source server type : OnPremises, AWS, GCP, AzureVM or PostgreSQLSingleServer. */ +public final class SourceType extends ExpandableStringEnum { + /** Static value OnPremises for SourceType. */ + public static final SourceType ON_PREMISES = fromString("OnPremises"); + + /** Static value AWS for SourceType. */ + public static final SourceType AWS = fromString("AWS"); + + /** Static value GCP for SourceType. */ + public static final SourceType GCP = fromString("GCP"); + + /** Static value AzureVM for SourceType. */ + public static final SourceType AZURE_VM = fromString("AzureVM"); + + /** Static value PostgreSQLSingleServer for SourceType. */ + public static final SourceType POSTGRE_SQLSINGLE_SERVER = fromString("PostgreSQLSingleServer"); + + /** + * Creates a new instance of SourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceType() { + } + + /** + * Creates or finds a SourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceType. + */ + @JsonCreator + public static SourceType fromString(String name) { + return fromString(name, SourceType.class); + } + + /** + * Gets known SourceType values. + * + * @return known SourceType values. + */ + public static Collection values() { + return values(SourceType.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SslMode.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SslMode.java new file mode 100644 index 000000000000..c0e621f1ff12 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/SslMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Supported SSL modes for migration. VerifyFull is the recommended SSL mode for Single server migration. Prefer, + * Require are recommended SSL modes for other source types. + */ +public final class SslMode extends ExpandableStringEnum { + /** Static value Prefer for SslMode. */ + public static final SslMode PREFER = fromString("Prefer"); + + /** Static value Require for SslMode. */ + public static final SslMode REQUIRE = fromString("Require"); + + /** Static value VerifyCA for SslMode. */ + public static final SslMode VERIFY_CA = fromString("VerifyCA"); + + /** Static value VerifyFull for SslMode. */ + public static final SslMode VERIFY_FULL = fromString("VerifyFull"); + + /** + * Creates a new instance of SslMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SslMode() { + } + + /** + * Creates or finds a SslMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding SslMode. + */ + @JsonCreator + public static SslMode fromString(String name) { + return fromString(name, SslMode.class); + } + + /** + * Gets known SslMode values. + * + * @return known SslMode values. + */ + public static Collection values() { + return values(SslMode.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StartDataMigrationEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StartDataMigrationEnum.java new file mode 100644 index 000000000000..d91827155d25 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StartDataMigrationEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates whether the data migration should start right away. */ +public final class StartDataMigrationEnum extends ExpandableStringEnum { + /** Static value True for StartDataMigrationEnum. */ + public static final StartDataMigrationEnum TRUE = fromString("True"); + + /** Static value False for StartDataMigrationEnum. */ + public static final StartDataMigrationEnum FALSE = fromString("False"); + + /** + * Creates a new instance of StartDataMigrationEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StartDataMigrationEnum() { + } + + /** + * Creates or finds a StartDataMigrationEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding StartDataMigrationEnum. + */ + @JsonCreator + public static StartDataMigrationEnum fromString(String name) { + return fromString(name, StartDataMigrationEnum.class); + } + + /** + * Gets known StartDataMigrationEnum values. + * + * @return known StartDataMigrationEnum values. + */ + public static Collection values() { + return values(StartDataMigrationEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java index 56fe534fcc19..3043aec221a2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/Storage.java @@ -16,6 +16,37 @@ public final class Storage { @JsonProperty(value = "storageSizeGB") private Integer storageSizeGB; + /* + * Flag to enable / disable Storage Auto grow for flexible server. + */ + @JsonProperty(value = "autoGrow") + private StorageAutoGrow autoGrow; + + /* + * Name of storage tier for IOPS. + */ + @JsonProperty(value = "tier") + private AzureManagedDiskPerformanceTiers tier; + + /* + * Storage tier IOPS quantity. This property is required to be set for storage Type PremiumV2_LRS + */ + @JsonProperty(value = "iops") + private Integer iops; + + /* + * Storage throughput for the server. This is required to be set for storage Type PremiumV2_LRS + */ + @JsonProperty(value = "throughput") + private Integer throughput; + + /* + * Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default is Premium_LRS if not + * specified + */ + @JsonProperty(value = "type") + private StorageType type; + /** Creates an instance of Storage class. */ public Storage() { } @@ -40,6 +71,112 @@ public Storage withStorageSizeGB(Integer storageSizeGB) { return this; } + /** + * Get the autoGrow property: Flag to enable / disable Storage Auto grow for flexible server. + * + * @return the autoGrow value. + */ + public StorageAutoGrow autoGrow() { + return this.autoGrow; + } + + /** + * Set the autoGrow property: Flag to enable / disable Storage Auto grow for flexible server. + * + * @param autoGrow the autoGrow value to set. + * @return the Storage object itself. + */ + public Storage withAutoGrow(StorageAutoGrow autoGrow) { + this.autoGrow = autoGrow; + return this; + } + + /** + * Get the tier property: Name of storage tier for IOPS. + * + * @return the tier value. + */ + public AzureManagedDiskPerformanceTiers tier() { + return this.tier; + } + + /** + * Set the tier property: Name of storage tier for IOPS. + * + * @param tier the tier value to set. + * @return the Storage object itself. + */ + public Storage withTier(AzureManagedDiskPerformanceTiers tier) { + this.tier = tier; + return this; + } + + /** + * Get the iops property: Storage tier IOPS quantity. This property is required to be set for storage Type + * PremiumV2_LRS. + * + * @return the iops value. + */ + public Integer iops() { + return this.iops; + } + + /** + * Set the iops property: Storage tier IOPS quantity. This property is required to be set for storage Type + * PremiumV2_LRS. + * + * @param iops the iops value to set. + * @return the Storage object itself. + */ + public Storage withIops(Integer iops) { + this.iops = iops; + return this; + } + + /** + * Get the throughput property: Storage throughput for the server. This is required to be set for storage Type + * PremiumV2_LRS. + * + * @return the throughput value. + */ + public Integer throughput() { + return this.throughput; + } + + /** + * Set the throughput property: Storage throughput for the server. This is required to be set for storage Type + * PremiumV2_LRS. + * + * @param throughput the throughput value to set. + * @return the Storage object itself. + */ + public Storage withThroughput(Integer throughput) { + this.throughput = throughput; + return this; + } + + /** + * Get the type property: Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default + * is Premium_LRS if not specified. + * + * @return the type value. + */ + public StorageType type() { + return this.type; + } + + /** + * Set the type property: Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default + * is Premium_LRS if not specified. + * + * @param type the type value to set. + * @return the Storage object itself. + */ + public Storage withType(StorageType type) { + this.type = type; + return this; + } + /** * Validates the instance. * diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrow.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrow.java new file mode 100644 index 000000000000..7e695076190f --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrow.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Flag to enable / disable Storage Auto grow for flexible server. */ +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 a new instance of StorageAutoGrow value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageAutoGrow() { + } + + /** + * 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); + } + + /** + * Gets known StorageAutoGrow values. + * + * @return known StorageAutoGrow values. + */ + public static Collection values() { + return values(StorageAutoGrow.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrowthSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrowthSupportedEnum.java new file mode 100644 index 000000000000..eef0b91afcdf --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageAutoGrowthSupportedEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * A value indicating whether storage auto-grow is supported in this region. "Enabled" means storage auto-grow is + * supported. "Disabled" stands for storage auto-grow is not supported. + */ +public final class StorageAutoGrowthSupportedEnum extends ExpandableStringEnum { + /** Static value Enabled for StorageAutoGrowthSupportedEnum. */ + public static final StorageAutoGrowthSupportedEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for StorageAutoGrowthSupportedEnum. */ + public static final StorageAutoGrowthSupportedEnum DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of StorageAutoGrowthSupportedEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageAutoGrowthSupportedEnum() { + } + + /** + * Creates or finds a StorageAutoGrowthSupportedEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageAutoGrowthSupportedEnum. + */ + @JsonCreator + public static StorageAutoGrowthSupportedEnum fromString(String name) { + return fromString(name, StorageAutoGrowthSupportedEnum.class); + } + + /** + * Gets known StorageAutoGrowthSupportedEnum values. + * + * @return known StorageAutoGrowthSupportedEnum values. + */ + public static Collection values() { + return values(StorageAutoGrowthSupportedEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageEditionCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageEditionCapability.java index 150a603b884f..eb8c97f5b6fc 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageEditionCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageEditionCapability.java @@ -8,33 +8,33 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** storage edition capability. */ +/** Storage edition capability. */ @Immutable -public final class StorageEditionCapability { +public final class StorageEditionCapability extends CapabilityBase { /* - * storage edition name + * Storage edition name */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * The supportedStorageMB property. + * Default storage size in MB for storage edition */ - @JsonProperty(value = "supportedStorageMB", access = JsonProperty.Access.WRITE_ONLY) - private List supportedStorageMB; + @JsonProperty(value = "defaultStorageSizeMb", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultStorageSizeMb; /* - * The status + * Flexible server supported storage range in MB */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; + @JsonProperty(value = "supportedStorageMb", access = JsonProperty.Access.WRITE_ONLY) + private List supportedStorageMb; /** Creates an instance of StorageEditionCapability class. */ public StorageEditionCapability() { } /** - * Get the name property: storage edition name. + * Get the name property: Storage edition name. * * @return the name value. */ @@ -43,21 +43,21 @@ public String name() { } /** - * Get the supportedStorageMB property: The supportedStorageMB property. + * Get the defaultStorageSizeMb property: Default storage size in MB for storage edition. * - * @return the supportedStorageMB value. + * @return the defaultStorageSizeMb value. */ - public List supportedStorageMB() { - return this.supportedStorageMB; + public Long defaultStorageSizeMb() { + return this.defaultStorageSizeMb; } /** - * Get the status property: The status. + * Get the supportedStorageMb property: Flexible server supported storage range in MB. * - * @return the status value. + * @return the supportedStorageMb value. */ - public String status() { - return this.status; + public List supportedStorageMb() { + return this.supportedStorageMb; } /** @@ -65,9 +65,11 @@ public String status() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { - if (supportedStorageMB() != null) { - supportedStorageMB().forEach(e -> e.validate()); + super.validate(); + if (supportedStorageMb() != null) { + supportedStorageMb().forEach(e -> e.validate()); } } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMBCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMBCapability.java deleted file mode 100644 index e1121c324498..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMBCapability.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.postgresqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** storage size in MB capability. */ -@Immutable -public final class StorageMBCapability { - /* - * 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; - - /* - * The supportedUpgradableTierList property. - */ - @JsonProperty(value = "supportedUpgradableTierList", access = JsonProperty.Access.WRITE_ONLY) - private List supportedUpgradableTierList; - - /* - * The status - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** Creates an instance of StorageMBCapability class. */ - public StorageMBCapability() { - } - - /** - * 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; - } - - /** - * Get the supportedUpgradableTierList property: The supportedUpgradableTierList property. - * - * @return the supportedUpgradableTierList value. - */ - public List supportedUpgradableTierList() { - return this.supportedUpgradableTierList; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportedUpgradableTierList() != null) { - supportedUpgradableTierList().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMbCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMbCapability.java new file mode 100644 index 000000000000..960e27d6ab62 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageMbCapability.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** storage size in MB capability. */ +@Immutable +public final class StorageMbCapability extends CapabilityBase { + /* + * Supported IOPS + */ + @JsonProperty(value = "supportedIops", access = JsonProperty.Access.WRITE_ONLY) + private Integer supportedIops; + + /* + * Maximum IOPS supported by this #Vcores or PremiumV2_LRS Storage Size + */ + @JsonProperty(value = "supportedMaximumIops", access = JsonProperty.Access.WRITE_ONLY) + private Integer supportedMaximumIops; + + /* + * Storage size in MB + */ + @JsonProperty(value = "storageSizeMb", access = JsonProperty.Access.WRITE_ONLY) + private Long storageSizeMb; + + /* + * Maximum value of Storage size in MB + */ + @JsonProperty(value = "maximumStorageSizeMb", access = JsonProperty.Access.WRITE_ONLY) + private Long maximumStorageSizeMb; + + /* + * Values of throughput in MB/s + */ + @JsonProperty(value = "supportedThroughput", access = JsonProperty.Access.WRITE_ONLY) + private Integer supportedThroughput; + + /* + * Maximum values of throughput in MB/s + */ + @JsonProperty(value = "supportedMaximumThroughput", access = JsonProperty.Access.WRITE_ONLY) + private Integer supportedMaximumThroughput; + + /* + * Default tier for IOPS + */ + @JsonProperty(value = "defaultIopsTier", access = JsonProperty.Access.WRITE_ONLY) + private String defaultIopsTier; + + /* + * List of available options to upgrade the storage performance + */ + @JsonProperty(value = "supportedIopsTiers", access = JsonProperty.Access.WRITE_ONLY) + private List supportedIopsTiers; + + /** Creates an instance of StorageMbCapability class. */ + public StorageMbCapability() { + } + + /** + * Get the supportedIops property: Supported IOPS. + * + * @return the supportedIops value. + */ + public Integer supportedIops() { + return this.supportedIops; + } + + /** + * Get the supportedMaximumIops property: Maximum IOPS supported by this #Vcores or PremiumV2_LRS Storage Size. + * + * @return the supportedMaximumIops value. + */ + public Integer supportedMaximumIops() { + return this.supportedMaximumIops; + } + + /** + * Get the storageSizeMb property: Storage size in MB. + * + * @return the storageSizeMb value. + */ + public Long storageSizeMb() { + return this.storageSizeMb; + } + + /** + * Get the maximumStorageSizeMb property: Maximum value of Storage size in MB. + * + * @return the maximumStorageSizeMb value. + */ + public Long maximumStorageSizeMb() { + return this.maximumStorageSizeMb; + } + + /** + * Get the supportedThroughput property: Values of throughput in MB/s. + * + * @return the supportedThroughput value. + */ + public Integer supportedThroughput() { + return this.supportedThroughput; + } + + /** + * Get the supportedMaximumThroughput property: Maximum values of throughput in MB/s. + * + * @return the supportedMaximumThroughput value. + */ + public Integer supportedMaximumThroughput() { + return this.supportedMaximumThroughput; + } + + /** + * Get the defaultIopsTier property: Default tier for IOPS. + * + * @return the defaultIopsTier value. + */ + public String defaultIopsTier() { + return this.defaultIopsTier; + } + + /** + * Get the supportedIopsTiers property: List of available options to upgrade the storage performance. + * + * @return the supportedIopsTiers value. + */ + public List supportedIopsTiers() { + return this.supportedIopsTiers; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (supportedIopsTiers() != null) { + supportedIopsTiers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageTierCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageTierCapability.java index a4e018a6e3fa..f433cd56ca57 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageTierCapability.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageTierCapability.java @@ -7,38 +7,20 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The StorageTierCapability model. */ +/** Represents capability of a storage tier. */ @Immutable -public final class StorageTierCapability { +public final class StorageTierCapability extends CapabilityBase { /* * Name to represent Storage tier capability */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; - /* - * Storage tier name - */ - @JsonProperty(value = "tierName", access = JsonProperty.Access.WRITE_ONLY) - private String tierName; - /* * Supported IOPS for this storage tier */ @JsonProperty(value = "iops", access = JsonProperty.Access.WRITE_ONLY) - private Long iops; - - /* - * Indicates if this is a baseline storage tier or not - */ - @JsonProperty(value = "isBaseline", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isBaseline; - - /* - * Status os this storage tier - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; + private Integer iops; /** Creates an instance of StorageTierCapability class. */ public StorageTierCapability() { @@ -53,47 +35,22 @@ public String name() { return this.name; } - /** - * Get the tierName property: Storage tier name. - * - * @return the tierName value. - */ - public String tierName() { - return this.tierName; - } - /** * Get the iops property: Supported IOPS for this storage tier. * * @return the iops value. */ - public Long iops() { + public Integer iops() { return this.iops; } - /** - * Get the isBaseline property: Indicates if this is a baseline storage tier or not. - * - * @return the isBaseline value. - */ - public Boolean isBaseline() { - return this.isBaseline; - } - - /** - * Get the status property: Status os this storage tier. - * - * @return the status value. - */ - public String status() { - return this.status; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); } } diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageType.java new file mode 100644 index 000000000000..1e7f254ec374 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/StorageType.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Storage type for the server. Allowed values are Premium_LRS and PremiumV2_LRS, and default is Premium_LRS if not + * specified. + */ +public final class StorageType extends ExpandableStringEnum { + /** Static value Premium_LRS for StorageType. */ + public static final StorageType PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value PremiumV2_LRS for StorageType. */ + public static final StorageType PREMIUM_V2_LRS = fromString("PremiumV2_LRS"); + + /** + * Creates a new instance of StorageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageType() { + } + + /** + * Creates or finds a StorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageType. + */ + @JsonCreator + public static StorageType fromString(String name) { + return fromString(name, StorageType.class); + } + + /** + * Gets known StorageType values. + * + * @return known StorageType values. + */ + public static Collection values() { + return values(StorageType.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionName.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionName.java new file mode 100644 index 000000000000..56a081008e14 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionName.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ThreatProtectionName. */ +public final class ThreatProtectionName extends ExpandableStringEnum { + /** Static value Default for ThreatProtectionName. */ + public static final ThreatProtectionName DEFAULT = fromString("Default"); + + /** + * Creates a new instance of ThreatProtectionName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ThreatProtectionName() { + } + + /** + * Creates or finds a ThreatProtectionName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ThreatProtectionName. + */ + @JsonCreator + public static ThreatProtectionName fromString(String name) { + return fromString(name, ThreatProtectionName.class); + } + + /** + * Gets known ThreatProtectionName values. + * + * @return known ThreatProtectionName values. + */ + public static Collection values() { + return values(ThreatProtectionName.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionState.java new file mode 100644 index 000000000000..c21a0dcc2a57 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ThreatProtectionState.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.postgresqlflexibleserver.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Specifies the state of the Threat Protection, whether it is enabled or disabled or a state has not been applied yet + * on the specific server. + */ +public enum ThreatProtectionState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a ThreatProtectionState instance. */ + private final String value; + + ThreatProtectionState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ThreatProtectionState instance. + * + * @param value the serialized value to parse. + * @return the parsed ThreatProtectionState object, or null if unable to parse. + */ + @JsonCreator + public static ThreatProtectionState fromString(String value) { + if (value == null) { + return null; + } + ThreatProtectionState[] items = ThreatProtectionState.values(); + for (ThreatProtectionState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TriggerCutoverEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TriggerCutoverEnum.java new file mode 100644 index 000000000000..bb779718fe18 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/TriggerCutoverEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** To trigger cutover for entire migration we need to send this flag as True. */ +public final class TriggerCutoverEnum extends ExpandableStringEnum { + /** Static value True for TriggerCutoverEnum. */ + public static final TriggerCutoverEnum TRUE = fromString("True"); + + /** Static value False for TriggerCutoverEnum. */ + public static final TriggerCutoverEnum FALSE = fromString("False"); + + /** + * Creates a new instance of TriggerCutoverEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TriggerCutoverEnum() { + } + + /** + * Creates or finds a TriggerCutoverEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggerCutoverEnum. + */ + @JsonCreator + public static TriggerCutoverEnum fromString(String name) { + return fromString(name, TriggerCutoverEnum.class); + } + + /** + * Gets known TriggerCutoverEnum values. + * + * @return known TriggerCutoverEnum values. + */ + public static Collection values() { + return values(TriggerCutoverEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationDetails.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationDetails.java new file mode 100644 index 000000000000..2573a13ae7de --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationDetails.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details for the validation for migration. */ +@Fluent +public final class ValidationDetails { + /* + * Validation status for migration + */ + @JsonProperty(value = "status") + private ValidationState status; + + /* + * Validation Start date-time in UTC + */ + @JsonProperty(value = "validationStartTimeInUtc") + private OffsetDateTime validationStartTimeInUtc; + + /* + * Validation End date-time in UTC + */ + @JsonProperty(value = "validationEndTimeInUtc") + private OffsetDateTime validationEndTimeInUtc; + + /* + * Details of server level validations + */ + @JsonProperty(value = "serverLevelValidationDetails") + private List serverLevelValidationDetails; + + /* + * Details of server level validations + */ + @JsonProperty(value = "dbLevelValidationDetails") + private List dbLevelValidationDetails; + + /** Creates an instance of ValidationDetails class. */ + public ValidationDetails() { + } + + /** + * Get the status property: Validation status for migration. + * + * @return the status value. + */ + public ValidationState status() { + return this.status; + } + + /** + * Set the status property: Validation status for migration. + * + * @param status the status value to set. + * @return the ValidationDetails object itself. + */ + public ValidationDetails withStatus(ValidationState status) { + this.status = status; + return this; + } + + /** + * Get the validationStartTimeInUtc property: Validation Start date-time in UTC. + * + * @return the validationStartTimeInUtc value. + */ + public OffsetDateTime validationStartTimeInUtc() { + return this.validationStartTimeInUtc; + } + + /** + * Set the validationStartTimeInUtc property: Validation Start date-time in UTC. + * + * @param validationStartTimeInUtc the validationStartTimeInUtc value to set. + * @return the ValidationDetails object itself. + */ + public ValidationDetails withValidationStartTimeInUtc(OffsetDateTime validationStartTimeInUtc) { + this.validationStartTimeInUtc = validationStartTimeInUtc; + return this; + } + + /** + * Get the validationEndTimeInUtc property: Validation End date-time in UTC. + * + * @return the validationEndTimeInUtc value. + */ + public OffsetDateTime validationEndTimeInUtc() { + return this.validationEndTimeInUtc; + } + + /** + * Set the validationEndTimeInUtc property: Validation End date-time in UTC. + * + * @param validationEndTimeInUtc the validationEndTimeInUtc value to set. + * @return the ValidationDetails object itself. + */ + public ValidationDetails withValidationEndTimeInUtc(OffsetDateTime validationEndTimeInUtc) { + this.validationEndTimeInUtc = validationEndTimeInUtc; + return this; + } + + /** + * Get the serverLevelValidationDetails property: Details of server level validations. + * + * @return the serverLevelValidationDetails value. + */ + public List serverLevelValidationDetails() { + return this.serverLevelValidationDetails; + } + + /** + * Set the serverLevelValidationDetails property: Details of server level validations. + * + * @param serverLevelValidationDetails the serverLevelValidationDetails value to set. + * @return the ValidationDetails object itself. + */ + public ValidationDetails withServerLevelValidationDetails( + List serverLevelValidationDetails) { + this.serverLevelValidationDetails = serverLevelValidationDetails; + return this; + } + + /** + * Get the dbLevelValidationDetails property: Details of server level validations. + * + * @return the dbLevelValidationDetails value. + */ + public List dbLevelValidationDetails() { + return this.dbLevelValidationDetails; + } + + /** + * Set the dbLevelValidationDetails property: Details of server level validations. + * + * @param dbLevelValidationDetails the dbLevelValidationDetails value to set. + * @return the ValidationDetails object itself. + */ + public ValidationDetails withDbLevelValidationDetails(List dbLevelValidationDetails) { + this.dbLevelValidationDetails = dbLevelValidationDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serverLevelValidationDetails() != null) { + serverLevelValidationDetails().forEach(e -> e.validate()); + } + if (dbLevelValidationDetails() != null) { + dbLevelValidationDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationMessage.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationMessage.java new file mode 100644 index 000000000000..cbe16bfbd072 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationMessage.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.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Validation message object. */ +@Fluent +public final class ValidationMessage { + /* + * Severity of validation message + */ + @JsonProperty(value = "state") + private ValidationState state; + + /* + * Validation message string + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of ValidationMessage class. */ + public ValidationMessage() { + } + + /** + * Get the state property: Severity of validation message. + * + * @return the state value. + */ + public ValidationState state() { + return this.state; + } + + /** + * Set the state property: Severity of validation message. + * + * @param state the state value to set. + * @return the ValidationMessage object itself. + */ + public ValidationMessage withState(ValidationState state) { + this.state = state; + return this; + } + + /** + * Get the message property: Validation message string. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Validation message string. + * + * @param message the message value to set. + * @return the ValidationMessage object itself. + */ + public ValidationMessage withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationState.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationState.java new file mode 100644 index 000000000000..38eb0634f264 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationState.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Validation status for migration. */ +public final class ValidationState extends ExpandableStringEnum { + /** Static value Failed for ValidationState. */ + public static final ValidationState FAILED = fromString("Failed"); + + /** Static value Succeeded for ValidationState. */ + public static final ValidationState SUCCEEDED = fromString("Succeeded"); + + /** Static value Warning for ValidationState. */ + public static final ValidationState WARNING = fromString("Warning"); + + /** + * Creates a new instance of ValidationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidationState() { + } + + /** + * Creates or finds a ValidationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationState. + */ + @JsonCreator + public static ValidationState fromString(String name) { + return fromString(name, ValidationState.class); + } + + /** + * Gets known ValidationState values. + * + * @return known ValidationState values. + */ + public static Collection values() { + return values(ValidationState.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationSummaryItem.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationSummaryItem.java new file mode 100644 index 000000000000..14ec1d822cb0 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ValidationSummaryItem.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Validation summary object. */ +@Fluent +public final class ValidationSummaryItem { + /* + * Validation type + */ + @JsonProperty(value = "type") + private String type; + + /* + * Validation status for migration + */ + @JsonProperty(value = "state") + private ValidationState state; + + /* + * Validation messages + */ + @JsonProperty(value = "messages") + private List messages; + + /** Creates an instance of ValidationSummaryItem class. */ + public ValidationSummaryItem() { + } + + /** + * Get the type property: Validation type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Validation type. + * + * @param type the type value to set. + * @return the ValidationSummaryItem object itself. + */ + public ValidationSummaryItem withType(String type) { + this.type = type; + return this; + } + + /** + * Get the state property: Validation status for migration. + * + * @return the state value. + */ + public ValidationState state() { + return this.state; + } + + /** + * Set the state property: Validation status for migration. + * + * @param state the state value to set. + * @return the ValidationSummaryItem object itself. + */ + public ValidationSummaryItem withState(ValidationState state) { + this.state = state; + return this; + } + + /** + * Get the messages property: Validation messages. + * + * @return the messages value. + */ + public List messages() { + return this.messages; + } + + /** + * Set the messages property: Validation messages. + * + * @param messages the messages value to set. + * @return the ValidationSummaryItem object itself. + */ + public ValidationSummaryItem withMessages(List messages) { + this.messages = messages; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (messages() != null) { + messages().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VcoreCapability.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VcoreCapability.java deleted file mode 100644 index 9fa8b25d8eff..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VcoreCapability.java +++ /dev/null @@ -1,99 +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.postgresqlflexibleserver.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Vcores capability. */ -@Immutable -public final class VcoreCapability { - /* - * 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; - - /* - * The status - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** Creates an instance of VcoreCapability class. */ - public VcoreCapability() { - } - - /** - * 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; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResource.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResource.java new file mode 100644 index 000000000000..9bf9d0aa37e9 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResource.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner; +import java.util.List; + +/** An immutable client-side representation of VirtualEndpointResource. */ +public interface VirtualEndpointResource { + /** + * Gets the endpointType property: The endpoint type for the virtual endpoint. + * + * @return the endpointType value. + */ + VirtualEndpointType endpointType(); + + /** + * Gets the members property: List of members for a virtual endpoint. + * + * @return the members value. + */ + List members(); + + /** + * Gets the virtualEndpoints property: List of virtual endpoints for a server. + * + * @return the virtualEndpoints value. + */ + List virtualEndpoints(); + + /** + * Gets the id property: Fully qualified resource ID for the resource. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + * + * @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. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner + * object. + * + * @return the inner object. + */ + VirtualEndpointResourceInner innerModel(); + + /** The entirety of the VirtualEndpointResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The VirtualEndpointResource definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualEndpointResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the VirtualEndpointResource 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 withExistingFlexibleServer(String resourceGroupName, String serverName); + } + + /** + * The stage of the VirtualEndpointResource 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.WithEndpointType, DefinitionStages.WithMembers { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualEndpointResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualEndpointResource create(Context context); + } + + /** The stage of the VirtualEndpointResource definition allowing to specify endpointType. */ + interface WithEndpointType { + /** + * Specifies the endpointType property: The endpoint type for the virtual endpoint.. + * + * @param endpointType The endpoint type for the virtual endpoint. + * @return the next definition stage. + */ + WithCreate withEndpointType(VirtualEndpointType endpointType); + } + + /** The stage of the VirtualEndpointResource definition allowing to specify members. */ + interface WithMembers { + /** + * Specifies the members property: List of members for a virtual endpoint. + * + * @param members List of members for a virtual endpoint. + * @return the next definition stage. + */ + WithCreate withMembers(List members); + } + } + + /** + * Begins update for the VirtualEndpointResource resource. + * + * @return the stage of resource update. + */ + VirtualEndpointResource.Update update(); + + /** The template for VirtualEndpointResource update. */ + interface Update extends UpdateStages.WithEndpointType, UpdateStages.WithMembers { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualEndpointResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualEndpointResource apply(Context context); + } + + /** The VirtualEndpointResource update stages. */ + interface UpdateStages { + /** The stage of the VirtualEndpointResource update allowing to specify endpointType. */ + interface WithEndpointType { + /** + * Specifies the endpointType property: The endpoint type for the virtual endpoint.. + * + * @param endpointType The endpoint type for the virtual endpoint. + * @return the next definition stage. + */ + Update withEndpointType(VirtualEndpointType endpointType); + } + + /** The stage of the VirtualEndpointResource update allowing to specify members. */ + interface WithMembers { + /** + * Specifies the members property: List of members for a virtual endpoint. + * + * @param members List of members for a virtual endpoint. + * @return the next definition stage. + */ + Update withMembers(List members); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualEndpointResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualEndpointResource refresh(Context context); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResourceForPatch.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResourceForPatch.java new file mode 100644 index 000000000000..a21d770b55d0 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointResourceForPatch.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a virtual endpoint for a server. */ +@Fluent +public class VirtualEndpointResourceForPatch { + /* + * Properties of the virtual endpoint resource. + */ + @JsonProperty(value = "properties") + private VirtualEndpointResourceProperties innerProperties; + + /** Creates an instance of VirtualEndpointResourceForPatch class. */ + public VirtualEndpointResourceForPatch() { + } + + /** + * Get the innerProperties property: Properties of the virtual endpoint resource. + * + * @return the innerProperties value. + */ + private VirtualEndpointResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the endpointType property: The endpoint type for the virtual endpoint. + * + * @return the endpointType value. + */ + public VirtualEndpointType endpointType() { + return this.innerProperties() == null ? null : this.innerProperties().endpointType(); + } + + /** + * Set the endpointType property: The endpoint type for the virtual endpoint. + * + * @param endpointType the endpointType value to set. + * @return the VirtualEndpointResourceForPatch object itself. + */ + public VirtualEndpointResourceForPatch withEndpointType(VirtualEndpointType endpointType) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualEndpointResourceProperties(); + } + this.innerProperties().withEndpointType(endpointType); + return this; + } + + /** + * Get the members property: List of members for a virtual endpoint. + * + * @return the members value. + */ + public List members() { + return this.innerProperties() == null ? null : this.innerProperties().members(); + } + + /** + * Set the members property: List of members for a virtual endpoint. + * + * @param members the members value to set. + * @return the VirtualEndpointResourceForPatch object itself. + */ + public VirtualEndpointResourceForPatch withMembers(List members) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualEndpointResourceProperties(); + } + this.innerProperties().withMembers(members); + return this; + } + + /** + * Get the virtualEndpoints property: List of virtual endpoints for a server. + * + * @return the virtualEndpoints value. + */ + public List virtualEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().virtualEndpoints(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointType.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointType.java new file mode 100644 index 000000000000..3cd204b33331 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointType.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The endpoint type for the virtual endpoint. */ +public final class VirtualEndpointType extends ExpandableStringEnum { + /** Static value ReadWrite for VirtualEndpointType. */ + public static final VirtualEndpointType READ_WRITE = fromString("ReadWrite"); + + /** + * Creates a new instance of VirtualEndpointType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualEndpointType() { + } + + /** + * Creates or finds a VirtualEndpointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualEndpointType. + */ + @JsonCreator + public static VirtualEndpointType fromString(String name) { + return fromString(name, VirtualEndpointType.class); + } + + /** + * Gets known VirtualEndpointType values. + * + * @return known VirtualEndpointType values. + */ + public static Collection values() { + return values(VirtualEndpointType.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpoints.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpoints.java new file mode 100644 index 000000000000..48557aa9c8a3 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpoints.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.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 VirtualEndpoints. */ +public interface VirtualEndpoints { + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtualEndpointName); + + /** + * Deletes a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtualEndpointName, Context context); + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtual endpoint along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serverName, String virtualEndpointName, Context context); + + /** + * Gets information about a virtual endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param virtualEndpointName The name of the virtual endpoint. + * @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 virtual endpoint. + */ + VirtualEndpointResource get(String resourceGroupName, String serverName, String virtualEndpointName); + + /** + * List all the servers in a given resource group. + * + * @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 endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName); + + /** + * List all the servers in a given resource group. + * + * @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 endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable listByServer(String resourceGroupName, String serverName, Context context); + + /** + * Gets information about a virtual endpoint. + * + * @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 virtual endpoint along with {@link Response}. + */ + VirtualEndpointResource getById(String id); + + /** + * Gets information about a virtual endpoint. + * + * @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 virtual endpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a virtual endpoint. + * + * @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 virtual endpoint. + * + * @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 VirtualEndpointResource resource. + * + * @param name resource name. + * @return the first stage of the new VirtualEndpointResource definition. + */ + VirtualEndpointResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointsListResult.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointsListResult.java new file mode 100644 index 000000000000..ff0b448f1785 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/VirtualEndpointsListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of virtual endpoints. */ +@Fluent +public final class VirtualEndpointsListResult { + /* + * The list of virtual endpoints + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of VirtualEndpointsListResult class. */ + public VirtualEndpointsListResult() { + } + + /** + * Get the value property: The list of virtual endpoints. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of virtual endpoints. + * + * @param value the value value to set. + * @return the VirtualEndpointsListResult object itself. + */ + public VirtualEndpointsListResult 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 VirtualEndpointsListResult object itself. + */ + public VirtualEndpointsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + 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/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaAndGeoBackupSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaAndGeoBackupSupportedEnum.java new file mode 100644 index 000000000000..296b49140f95 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaAndGeoBackupSupportedEnum.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. "Enabled" means zone + * redundant HA and geo-backup is supported. "Disabled" stands for zone redundant HA and geo-backup is not supported. + */ +public final class ZoneRedundantHaAndGeoBackupSupportedEnum + extends ExpandableStringEnum { + /** Static value Enabled for ZoneRedundantHaAndGeoBackupSupportedEnum. */ + public static final ZoneRedundantHaAndGeoBackupSupportedEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for ZoneRedundantHaAndGeoBackupSupportedEnum. */ + public static final ZoneRedundantHaAndGeoBackupSupportedEnum DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ZoneRedundantHaAndGeoBackupSupportedEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ZoneRedundantHaAndGeoBackupSupportedEnum() { + } + + /** + * Creates or finds a ZoneRedundantHaAndGeoBackupSupportedEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding ZoneRedundantHaAndGeoBackupSupportedEnum. + */ + @JsonCreator + public static ZoneRedundantHaAndGeoBackupSupportedEnum fromString(String name) { + return fromString(name, ZoneRedundantHaAndGeoBackupSupportedEnum.class); + } + + /** + * Gets known ZoneRedundantHaAndGeoBackupSupportedEnum values. + * + * @return known ZoneRedundantHaAndGeoBackupSupportedEnum values. + */ + public static Collection values() { + return values(ZoneRedundantHaAndGeoBackupSupportedEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaSupportedEnum.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaSupportedEnum.java new file mode 100644 index 000000000000..bd42da75ee94 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/java/com/azure/resourcemanager/postgresqlflexibleserver/models/ZoneRedundantHaSupportedEnum.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.postgresqlflexibleserver.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * A value indicating whether Zone Redundant HA is supported in this region. "Enabled" means zone redundant HA is + * supported. "Disabled" stands for zone redundant HA is not supported. + */ +public final class ZoneRedundantHaSupportedEnum extends ExpandableStringEnum { + /** Static value Enabled for ZoneRedundantHaSupportedEnum. */ + public static final ZoneRedundantHaSupportedEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for ZoneRedundantHaSupportedEnum. */ + public static final ZoneRedundantHaSupportedEnum DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ZoneRedundantHaSupportedEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ZoneRedundantHaSupportedEnum() { + } + + /** + * Creates or finds a ZoneRedundantHaSupportedEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding ZoneRedundantHaSupportedEnum. + */ + @JsonCreator + public static ZoneRedundantHaSupportedEnum fromString(String name) { + return fromString(name, ZoneRedundantHaSupportedEnum.class); + } + + /** + * Gets known ZoneRedundantHaSupportedEnum values. + * + * @return known ZoneRedundantHaSupportedEnum values. + */ + public static Collection values() { + return values(ZoneRedundantHaSupportedEnum.class); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/proxy-config.json b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/proxy-config.json new file mode 100644 index 000000000000..f0320af0048e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.AdministratorsClientImpl$AdministratorsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.BackupsClientImpl$BackupsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.LocationBasedCapabilitiesClientImpl$LocationBasedCapabilitiesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerCapabilitiesClientImpl$ServerCapabilitiesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilitiesClientImpl$CheckNameAvailabilitiesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilityWithLocationsClientImpl$CheckNameAvailabilityWithLocationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ConfigurationsClientImpl$ConfigurationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.DatabasesClientImpl$DatabasesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.FirewallRulesClientImpl$FirewallRulesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersClientImpl$ServersService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.FlexibleServersClientImpl$FlexibleServersService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.LtrBackupOperationsClientImpl$LtrBackupOperationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.MigrationsClientImpl$MigrationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ResourceProvidersClientImpl$ResourceProvidersService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.GetPrivateDnsZoneSuffixesClientImpl$GetPrivateDnsZoneSuffixesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionOperationsClientImpl$PrivateEndpointConnectionOperationsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.QuotaUsagesClientImpl$QuotaUsagesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ReplicasClientImpl$ReplicasService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.LogFilesClientImpl$LogFilesService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerThreatProtectionSettingsClientImpl$ServerThreatProtectionSettingsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualEndpointsClientImpl$VirtualEndpointsService" ], [ "com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualNetworkSubnetUsagesClientImpl$VirtualNetworkSubnetUsagesService" ] ] \ No newline at end of file diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/reflect-config.json b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/reflect-config.json new file mode 100644 index 000000000000..55d2400feec5 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-postgresqlflexibleserver/reflect-config.json @@ -0,0 +1,806 @@ +[ { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministratorAdd", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.AdministratorPropertiesForAdd", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ActiveDirectoryAdministratorInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.AdministratorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.AdministratorListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackupListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilitiesListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FlexibleServerCapabilityInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageEditionCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageMbCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageTierCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityBase", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerSkuCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.NameAvailabilityInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationForUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DatabaseListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRuleListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Sku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Storage", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Backup", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Network", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Replica", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerForUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerPropertiesForUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.BackupRequestBase", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrPreBackupResponseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrBackupOperationResponseProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LtrServerBackupOperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LtrServerBackupOperationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSubStateDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DbMigrationStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationSummaryItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationMessage", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DbLevelValidationStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DbServerMetadata", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerSku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.AdminCredentials", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceForPatch", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationResourcePropertiesForPatch", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResourceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationListResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Operation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkResourceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateLinkResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.QuotaUsagesListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.QuotaUsageInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.NameProperty", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LogFileListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.LogFileProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionSettingsModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerThreatProtectionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResourceForPatch", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualEndpointResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.DelegatedSubnetUsage", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServersTriggerLtrPreBackupHeaders", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.HaMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningSupportedEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.GeoBackupSupportedEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaSupportedEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ZoneRedundantHaAndGeoBackupSupportedEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrowthSupportedEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.OnlineResizeSupportedEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.RestrictedEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationDataType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StorageType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAuthEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordAuthEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.KeyStatusEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerPublicNetworkAccessState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailabilityMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ServerHAState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationRole", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointConnectionProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ExecutionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSubState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationDbState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ValidationState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationOption", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.SourceType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.StartDataMigrationEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.TriggerCutoverEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationNameAvailabilityReason", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.OperationOrigin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateSamples.java index f5349c444453..98b1a2640cd2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateSamples.java @@ -9,7 +9,7 @@ /** Samples for Administrators Create. */ public final class AdministratorsCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorAdd.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorAdd.json */ /** * Sample code: Adds an Active DIrectory Administrator for the server. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteSamples.java index 5796b304877f..5f5dec817871 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Administrators Delete. */ public final class AdministratorsDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorDelete.json */ /** * Sample code: AdministratorDelete. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetSamples.java index b1e85759ecd4..4c9cfc98d897 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for Administrators Get. */ public final class AdministratorsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorGet.json */ /** * Sample code: ServerGet. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerSamples.java index eea1e9d20b44..a2355312c9e6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerSamples.java @@ -7,7 +7,7 @@ /** Samples for Administrators ListByServer. */ public final class AdministratorsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/AdministratorsListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/AdministratorsListByServer.json */ /** * Sample code: AdministratorsListByServer. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetSamples.java index 962eea990921..29ed1e80b6ad 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for Backups Get. */ public final class BackupsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/BackupGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupGet.json */ /** * Sample code: Get a backup for a server. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerSamples.java index 46e415b711fd..da479266d1ad 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerSamples.java @@ -7,7 +7,7 @@ /** Samples for Backups ListByServer. */ public final class BackupsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/BackupListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/BackupListByServer.json */ /** * Sample code: List backups for a server. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java index b026fb4108c7..99f0e8d51211 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityExecuteSamples.java @@ -9,7 +9,7 @@ /** Samples for CheckNameAvailability Execute. */ public final class CheckNameAvailabilityExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CheckNameAvailability.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailability.json */ /** * Sample code: NameAvailability. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationExecuteSamples.java index d0ec62a10396..371da3b1237a 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationExecuteSamples.java @@ -9,7 +9,7 @@ /** Samples for CheckNameAvailabilityWithLocation Execute. */ public final class CheckNameAvailabilityWithLocationExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CheckNameAvailabilityLocationBased.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckNameAvailabilityLocationBased.json */ /** * Sample code: NameAvailability. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetSamples.java index db1602f3e061..0d9e000e3697 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for Configurations Get. */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationGet.json */ /** * Sample code: ConfigurationGet. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerSamples.java index fc79a7d7184e..8d107bb7cdb6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerSamples.java @@ -7,7 +7,7 @@ /** Samples for Configurations ListByServer. */ public final class ConfigurationsListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationListByServer.json */ /** * Sample code: ConfigurationList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutSamples.java index f5ef7ad4803c..02e108457b15 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutSamples.java @@ -7,7 +7,7 @@ /** Samples for Configurations Put. */ public final class ConfigurationsPutSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsUpdateSamples.java index 28c6e53dc3b2..1f57e92197c9 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsUpdateSamples.java @@ -9,7 +9,7 @@ /** Samples for Configurations Update. */ public final class ConfigurationsUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ConfigurationUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ConfigurationUpdate.json */ /** * Sample code: Update a user configuration. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateSamples.java index 9048179ee21f..2b06b8c4a105 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateSamples.java @@ -7,7 +7,7 @@ /** Samples for Databases Create. */ public final class DatabasesCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabaseCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseCreate.json */ /** * Sample code: Create a database. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteSamples.java index ed9a9036ff89..99d6a6a85907 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Databases Delete. */ public final class DatabasesDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabaseDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseDelete.json */ /** * Sample code: Delete a database. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetSamples.java index 310e8b131cfc..4568aed5930f 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetSamples.java @@ -7,7 +7,7 @@ /** Samples for Databases Get. */ public final class DatabasesGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabaseGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabaseGet.json */ /** * Sample code: Get a database. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerSamples.java index 1c81e0946ba9..c33e2f2fe1b9 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerSamples.java @@ -7,7 +7,7 @@ /** Samples for Databases ListByServer. */ public final class DatabasesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/DatabasesListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/DatabasesListByServer.json */ /** * Sample code: List databases in a server. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java index 5a38e69b3f49..2e5d3612845e 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateSamples.java @@ -7,7 +7,7 @@ /** Samples for FirewallRules CreateOrUpdate. */ public final class FirewallRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleCreate.json */ /** * Sample code: FirewallRuleCreate. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteSamples.java index 7205fa07fdd4..d071ed5834ae 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for FirewallRules Delete. */ public final class FirewallRulesDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleDelete.json */ /** * Sample code: FirewallRuleDelete. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetSamples.java index cce53009c3d7..48e15cad1dc2 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetSamples.java @@ -7,7 +7,7 @@ /** Samples for FirewallRules Get. */ public final class FirewallRulesGetSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleGet.json */ /** * Sample code: FirewallRuleList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerSamples.java index 9e596f2b11d7..90e17a731665 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerSamples.java @@ -7,7 +7,7 @@ /** Samples for FirewallRules ListByServer. */ public final class FirewallRulesListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/FirewallRuleListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/FirewallRuleListByServer.json */ /** * Sample code: FirewallRuleList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerStartLtrBackupSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerStartLtrBackupSamples.java new file mode 100644 index 000000000000..ad7665b1a98e --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerStartLtrBackupSamples.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.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; +import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest; +import java.util.Arrays; + +/** Samples for FlexibleServer StartLtrBackup. */ +public final class FlexibleServerStartLtrBackupSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionBackup.json + */ + /** + * Sample code: Sample_ExecuteBackup. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void sampleExecuteBackup( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .flexibleServers() + .startLtrBackup( + "rgLongTermRetention", + "pgsqlltrtestserver", + new LtrBackupRequest() + .withBackupSettings(new BackupSettings().withBackupName("backup1")) + .withTargetDetails(new BackupStoreDetails().withSasUriList(Arrays.asList("sasuri"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerTriggerLtrPreBackupSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerTriggerLtrPreBackupSamples.java new file mode 100644 index 000000000000..991863f3bc36 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerTriggerLtrPreBackupSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrPreBackupRequest; + +/** Samples for FlexibleServer TriggerLtrPreBackup. */ +public final class FlexibleServerTriggerLtrPreBackupSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionPreBackup.json + */ + /** + * Sample code: Sample_Prebackup. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void samplePrebackup(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .flexibleServers() + .triggerLtrPreBackupWithResponse( + "rgLongTermRetention", + "pgsqlltrtestserver", + new LtrPreBackupRequest().withBackupSettings(new BackupSettings().withBackupName("backup1")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java index 1fa3b6d2a937..8cf94fe95a88 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixExecuteSamples.java @@ -7,7 +7,7 @@ /** Samples for GetPrivateDnsZoneSuffix Execute. */ public final class GetPrivateDnsZoneSuffixExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/GetPrivateDnsZoneSuffix.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/GetPrivateDnsZoneSuffix.json */ /** * Sample code: GetPrivateDnsZoneSuffix. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteSamples.java index 715eb7a4d78b..14c88835c9e6 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteSamples.java @@ -7,7 +7,7 @@ /** Samples for LocationBasedCapabilities Execute. */ public final class LocationBasedCapabilitiesExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/CapabilitiesByLocation.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CapabilitiesByLocation.json */ /** * Sample code: CapabilitiesList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerSamples.java new file mode 100644 index 000000000000..0d077cff5843 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LogFilesListByServerSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for LogFiles ListByServer. */ +public final class LogFilesListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LogFilesListByServer.json + */ + /** + * Sample code: List all server log files for a server. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void listAllServerLogFilesForAServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.logFiles().listByServer("testrg", "postgresqltestsvc1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsGetSamples.java new file mode 100644 index 000000000000..b68d3634f0ba --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for LtrBackupOperations Get. */ +public final class LtrBackupOperationsGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationGet.json + */ + /** + * Sample code: Sample. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void sample(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .ltrBackupOperations() + .getWithResponse("rgLongTermRetention", "pgsqlltrtestserver", "backup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsListByServerSamples.java new file mode 100644 index 000000000000..09c7ff066014 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LtrBackupOperationsListByServerSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for LtrBackupOperations ListByServer. */ +public final class LtrBackupOperationsListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/LongTermRetentionOperationListByServer.json + */ + /** + * Sample code: Sample List of Long Tern Retention Operations by Flexible Server. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void sampleListOfLongTernRetentionOperationsByFlexibleServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .ltrBackupOperations() + .listByServer("rgLongTermRetention", "pgsqlltrtestserver", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsCreateSamples.java new file mode 100644 index 000000000000..aa1fecc8bf82 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsCreateSamples.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.AdminCredentials; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationOption; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationSecretParameters; +import com.azure.resourcemanager.postgresqlflexibleserver.models.OverwriteDbsInTargetEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SourceType; +import com.azure.resourcemanager.postgresqlflexibleserver.models.SslMode; +import java.util.Arrays; + +/** Samples for Migrations Create. */ +public final class MigrationsCreateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Validate_Only.json + */ + /** + * Sample code: Create Pre-migration Validation. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void createPreMigrationValidation( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withMigrationOption(MigrationOption.VALIDATE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters( + new MigrationSecretParameters() + .withAdminCredentials( + new AdminCredentials() + .withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_With_Other_Users.json + */ + /** + * Sample code: Migrations Create by passing user names. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsCreateByPassingUserNames( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters( + new MigrationSecretParameters() + .withAdminCredentials( + new AdminCredentials() + .withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder")) + .withSourceServerUsername("newadmin@testsource") + .withTargetServerUsername("targetadmin")) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .create(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create.json + */ + /** + * Sample code: Migrations_Create. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsCreate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withSourceDbServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource") + .withSecretParameters( + new MigrationSecretParameters() + .withAdminCredentials( + new AdminCredentials() + .withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json + */ + /** + * Sample code: Create Migration with other source types for Validate and Migrate. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void createMigrationWithOtherSourceTypesForValidateAndMigrate( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .define("testmigration") + .withRegion("westus") + .withExistingFlexibleServer("ffffffff-ffff-ffff-ffff-ffffffffffff", "testrg", "testtarget") + .withMigrationMode(MigrationMode.OFFLINE) + .withMigrationOption(MigrationOption.VALIDATE_AND_MIGRATE) + .withSourceType(SourceType.ON_PREMISES) + .withSslMode(SslMode.PREFER) + .withSourceDbServerResourceId("testsource:5432@pguser") + .withSecretParameters( + new MigrationSecretParameters() + .withAdminCredentials( + new AdminCredentials() + .withSourceServerPassword("fakeTokenPlaceholder") + .withTargetServerPassword("fakeTokenPlaceholder"))) + .withDbsToMigrate(Arrays.asList("db1", "db2", "db3", "db4")) + .withOverwriteDbsInTarget(OverwriteDbsInTargetEnum.TRUE) + .create(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteSamples.java new file mode 100644 index 000000000000..8136b53e221c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for Migrations Delete. */ +public final class MigrationsDeleteSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Delete.json + */ + /** + * Sample code: Migrations_Delete. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsDelete(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .deleteWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigration", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsGetSamples.java new file mode 100644 index 000000000000..bb172fc3237c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsGetSamples.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for Migrations Get. */ +public final class MigrationsGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json + */ + /** + * Sample code: Migrations_GetMigrationWithSuccessfulValidationOnly. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithSuccessfulValidationOnly( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigrationwithsuccessfulvalidationonly", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Get.json + */ + /** + * Sample code: Migrations_Get. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGet(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigration", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json + */ + /** + * Sample code: Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithSuccessfulValidationButMigrationFailure( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigrationwithsuccessfulvalidationbutmigrationfailure", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json + */ + /** + * Sample code: Migrations_GetMigrationWithSuccessfulValidationAndMigration. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithSuccessfulValidationAndMigration( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigrationwithsuccessfulvalidationandmigration", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json + */ + /** + * Sample code: Migrations_GetMigrationWithValidationFailures. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsGetMigrationWithValidationFailures( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigrationwithvalidationfailure", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsListByTargetServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsListByTargetServerSamples.java new file mode 100644 index 000000000000..d6783af7b801 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsListByTargetServerSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationListFilter; + +/** Samples for Migrations ListByTargetServer. */ +public final class MigrationsListByTargetServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_ListByTargetServer.json + */ + /** + * Sample code: Migrations_ListByTargetServer. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsListByTargetServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .migrations() + .listByTargetServer( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + MigrationListFilter.ALL, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsUpdateSamples.java new file mode 100644 index 000000000000..39bf3b933426 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MigrationsUpdateSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.CancelEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.LogicalReplicationOnSourceDbEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.MigrationResource; + +/** Samples for Migrations Update. */ +public final class MigrationsUpdateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Cancel.json + */ + /** + * Sample code: Cancel migration. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void cancelMigration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + MigrationResource resource = + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigration", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withCancel(CancelEnum.TRUE).apply(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/Migrations_Update.json + */ + /** + * Sample code: Migrations_Update. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void migrationsUpdate(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + MigrationResource resource = + manager + .migrations() + .getWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + "testmigration", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSetupLogicalReplicationOnSourceDbIfNeeded(LogicalReplicationOnSourceDbEnum.TRUE).apply(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java index 1c45fb814677..5f06aab64bcb 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/OperationList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/OperationList.json */ /** * Sample code: OperationList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationDeleteSamples.java new file mode 100644 index 000000000000..2a83882a6e10 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for PrivateEndpointConnectionOperation Delete. */ +public final class PrivateEndpointConnectionOperationDeleteSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Deletes a private endpoint connection with a given name. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void deletesAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .privateEndpointConnectionOperations() + .delete( + "Default", + "test-svr", + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationUpdateSamples.java new file mode 100644 index 000000000000..ceec2fd5a10c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionOperationUpdateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.postgresqlflexibleserver.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnectionOperation Update. */ +public final class PrivateEndpointConnectionOperationUpdateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Approve or reject a private endpoint connection with a given name. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .privateEndpointConnectionOperations() + .update( + "Default", + "test-svr", + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", + new PrivateEndpointConnectionInner() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..2e2bba7125da --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: Gets private endpoint connection. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getsPrivateEndpointConnection( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "Default", + "test-svr", + "private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java new file mode 100644 index 000000000000..3e2777da2843 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateEndpointConnectionsListByServerSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for PrivateEndpointConnections ListByServer. */ +public final class PrivateEndpointConnectionsListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: Gets list of private endpoint connections on a server. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getsListOfPrivateEndpointConnectionsOnAServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.privateEndpointConnections().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..db471773a349 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesGet.json + */ + /** + * Sample code: Gets a private link resource for PostgreSQL. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getsAPrivateLinkResourceForPostgreSQL( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.privateLinkResources().getWithResponse("Default", "test-svr", "plr", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java new file mode 100644 index 000000000000..be267cc26144 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/PrivateLinkResourcesListByServerSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for PrivateLinkResources ListByServer. */ +public final class PrivateLinkResourcesListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PrivateLinkResourcesList.json + */ + /** + * Sample code: Gets private link resources for PostgreSQL. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getsPrivateLinkResourcesForPostgreSQL( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.privateLinkResources().listByServer("Default", "test-svr", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.java new file mode 100644 index 000000000000..62d854a0e162 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/QuotaUsagesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for QuotaUsages List. */ +public final class QuotaUsagesListSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/QuotaUsagesForFlexibleServers.json + */ + /** + * Sample code: List of quota usages for flexible servers. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void listOfQuotaUsagesForFlexibleServers( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.quotaUsages().list("westus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicasListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicasListByServerSamples.java index e81f7761c493..78a1f92e752b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicasListByServerSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ReplicasListByServerSamples.java @@ -7,7 +7,7 @@ /** Samples for Replicas ListByServer. */ public final class ReplicasListByServerSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ReplicasListByServer.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ReplicasListByServer.json */ /** * Sample code: ReplicasListByServer. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProviderCheckMigrationNameAvailabilitySamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProviderCheckMigrationNameAvailabilitySamples.java new file mode 100644 index 000000000000..3161ce778645 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ResourceProviderCheckMigrationNameAvailabilitySamples.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.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.MigrationNameAvailabilityResourceInner; + +/** Samples for ResourceProvider CheckMigrationNameAvailability. */ +public final class ResourceProviderCheckMigrationNameAvailabilitySamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/CheckMigrationNameAvailability.json + */ + /** + * Sample code: CheckMigrationNameAvailability. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void checkMigrationNameAvailability( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .resourceProviders() + .checkMigrationNameAvailabilityWithResponse( + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "testrg", + "testtarget", + new MigrationNameAvailabilityResourceInner() + .withName("name1") + .withType("Microsoft.DBforPostgreSQL/flexibleServers/migrations"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListSamples.java new file mode 100644 index 000000000000..da891685f246 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerCapabilitiesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for ServerCapabilities List. */ +public final class ServerCapabilitiesListSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCapabilities.json + */ + /** + * Sample code: ServerCapabilitiesList. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void serverCapabilitiesList( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.serverCapabilities().list("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..6b5424d393b8 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsCreateOrUpdateSamples.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.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettingsModel; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionState; + +/** Samples for ServerThreatProtectionSettings CreateOrUpdate. */ +public final class ServerThreatProtectionSettingsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsCreate.json + */ + /** + * Sample code: Update a server's Threat Protection settings. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void updateAServerSThreatProtectionSettings( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + ServerThreatProtectionSettingsModel resource = + manager + .serverThreatProtectionSettings() + .getWithResponse( + "threatprotection-4799", + "threatprotection-6440", + ThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withState(ThreatProtectionState.ENABLED).apply(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetSamples.java new file mode 100644 index 000000000000..c4d6b51cd565 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.ThreatProtectionName; + +/** Samples for ServerThreatProtectionSettings Get. */ +public final class ServerThreatProtectionSettingsGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsGet.json + */ + /** + * Sample code: Get a server's Threat Protection settings. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getAServerSThreatProtectionSettings( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .serverThreatProtectionSettings() + .getWithResponse( + "threatprotection-6852", + "threatprotection-2080", + ThreatProtectionName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerSamples.java new file mode 100644 index 000000000000..621cc96bf8d9 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerThreatProtectionSettingsListByServerSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for ServerThreatProtectionSettings ListByServer. */ +public final class ServerThreatProtectionSettingsListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerThreatProtectionSettingsListByServer.json + */ + /** + * Sample code: Get a server's Advanced Threat Protection settings. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getAServerSAdvancedThreatProtectionSettings( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .serverThreatProtectionSettings() + .listByServer("threatprotection-6852", "threatprotection-2080", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java index d29495125db1..30f96779eb1b 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersCreateSamples.java @@ -7,6 +7,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAuthEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyType; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; +import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateMode; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; @@ -20,6 +21,7 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow; import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; import java.time.OffsetDateTime; @@ -29,7 +31,7 @@ /** Samples for Servers Create. */ public final class ServersCreateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json */ /** * Sample code: ServerCreateWithDataEncryptionEnabled. @@ -55,12 +57,14 @@ public static void serverCreateWithDataEncryptionEnabled( .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("password") .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512)) + .withStorage(new Storage().withStorageSizeGB(512).withAutoGrow(StorageAutoGrow.DISABLED)) .withDataEncryption( new DataEncryption() .withPrimaryKeyUri("fakeTokenPlaceholder") .withPrimaryUserAssignedIdentityId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId("") .withType(ArmServerKeyType.AZURE_KEY_VAULT)) .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) .withNetwork( @@ -76,7 +80,29 @@ public static void serverCreateWithDataEncryptionEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateGeoRestore.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReviveDropped.json + */ + /** + * Sample code: ServerCreateReviveDropped. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void serverCreateReviveDropped( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .servers() + .define("pgtestsvc5-rev") + .withRegion("westus") + .withExistingResourceGroup("testrg") + .withSourceServerResourceId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5") + .withPointInTimeUtc(OffsetDateTime.parse("2023-04-27T00:04:59.4078005+00:00")) + .withCreateMode(CreateMode.REVIVE_DROPPED) + .create(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json */ /** * Sample code: Create a database as a geo-restore in geo-paired location. @@ -90,6 +116,24 @@ public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( .define("pgtestsvc5geo") .withRegion("eastus") .withExistingResourceGroup("testrg") + .withIdentity( + new UserAssignedIdentity() + .withUserAssignedIdentities( + mapOf( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity", + new UserIdentity(), + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", + new UserIdentity())) + .withType(IdentityType.USER_ASSIGNED)) + .withDataEncryption( + new DataEncryption() + .withPrimaryKeyUri("fakeTokenPlaceholder") + .withPrimaryUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity") + .withType(ArmServerKeyType.AZURE_KEY_VAULT)) .withSourceServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) @@ -98,7 +142,7 @@ public static void createADatabaseAsAGeoRestoreInGeoPairedLocation( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreate.json */ /** * Sample code: Create a new server. @@ -116,7 +160,11 @@ public static void createANewServer(com.azure.resourcemanager.postgresqlflexible .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("password") .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512)) + .withStorage( + new Storage() + .withStorageSizeGB(512) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P20)) .withBackup(new Backup().withBackupRetentionDays(7).withGeoRedundantBackup(GeoRedundantBackupEnum.DISABLED)) .withNetwork( new Network() @@ -131,7 +179,7 @@ public static void createANewServer(com.azure.resourcemanager.postgresqlflexible } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateWithAadAuthEnabled.json */ /** * Sample code: Create a new server with active directory authentication enabled. @@ -150,7 +198,11 @@ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( .withAdministratorLogin("cloudsa") .withAdministratorLoginPassword("password") .withVersion(ServerVersion.ONE_TWO) - .withStorage(new Storage().withStorageSizeGB(512)) + .withStorage( + new Storage() + .withStorageSizeGB(512) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P20)) .withAuthConfig( new AuthConfig() .withActiveDirectoryAuth(ActiveDirectoryAuthEnum.ENABLED) @@ -171,7 +223,7 @@ public static void createANewServerWithActiveDirectoryAuthenticationEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreateReplica.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreateReplica.json */ /** * Sample code: ServerCreateReplica. @@ -185,6 +237,21 @@ public static void serverCreateReplica( .define("pgtestsvc5rep") .withRegion("westus") .withExistingResourceGroup("testrg") + .withIdentity( + new UserAssignedIdentity() + .withUserAssignedIdentities( + mapOf( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", + new UserIdentity())) + .withType(IdentityType.USER_ASSIGNED)) + .withDataEncryption( + new DataEncryption() + .withPrimaryKeyUri("fakeTokenPlaceholder") + .withPrimaryUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId("") + .withType(ArmServerKeyType.AZURE_KEY_VAULT)) .withSourceServerResourceId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername") .withPointInTimeUtc(OffsetDateTime.parse("2021-06-27T00:04:59.4078005+00:00")) @@ -193,7 +260,7 @@ public static void serverCreateReplica( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerCreatePointInTimeRestore.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerCreatePointInTimeRestore.json */ /** * Sample code: Create a database as a point in time restore. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteSamples.java index 506b982f2125..55b87be5d753 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Servers Delete. */ public final class ServersDeleteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerDelete.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerDelete.json */ /** * Sample code: ServerDelete. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersGetByResourceGroupSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersGetByResourceGroupSamples.java index f275aaaf5bb2..62aa1fc18433 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersGetByResourceGroupSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersGetByResourceGroupSamples.java @@ -7,7 +7,20 @@ /** Samples for Servers GetByResourceGroup. */ public final class ServersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerGet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithPrivateEndpoints.json + */ + /** + * Sample code: ServerGetWithPrivateEndpoints. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void serverGetWithPrivateEndpoints( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.servers().getByResourceGroupWithResponse("testrg", "pgtestsvc2", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGet.json */ /** * Sample code: ServerGet. @@ -19,7 +32,7 @@ public static void serverGet(com.azure.resourcemanager.postgresqlflexibleserver. } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerGetWithVnet.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerGetWithVnet.json */ /** * Sample code: ServerGetWithVnet. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListByResourceGroupSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListByResourceGroupSamples.java index f726b9ffd845..4425c97596cc 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListByResourceGroupSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Servers ListByResourceGroup. */ public final class ServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerListByResourceGroup.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerListByResourceGroup.json */ /** * Sample code: ServerListByResourceGroup. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListSamples.java index 61b05ecd6e2a..bd70fe70d5bd 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersListSamples.java @@ -7,7 +7,7 @@ /** Samples for Servers List. */ public final class ServersListSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerList.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerList.json */ /** * Sample code: ServerList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartSamples.java index 5d59750732a9..4f7d87803661 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartSamples.java @@ -10,7 +10,7 @@ /** Samples for Servers Restart. */ public final class ServersRestartSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerRestart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestart.json */ /** * Sample code: ServerRestart. @@ -22,7 +22,7 @@ public static void serverRestart(com.azure.resourcemanager.postgresqlflexibleser } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerRestartWithFailover.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerRestartWithFailover.json */ /** * Sample code: ServerRestartWithFailover. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartSamples.java index 8898c999baeb..625a2d1c7ffc 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartSamples.java @@ -7,7 +7,7 @@ /** Samples for Servers Start. */ public final class ServersStartSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerStart.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStart.json */ /** * Sample code: ServerStart. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopSamples.java index 434fb17f8be2..f9a4b90fc2f4 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopSamples.java @@ -7,7 +7,7 @@ /** Samples for Servers Stop. */ public final class ServersStopSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerStop.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerStop.json */ /** * Sample code: ServerStop. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersUpdateSamples.java index c6ae1d53fc1f..072ee72a6692 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersUpdateSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersUpdateSamples.java @@ -7,17 +7,22 @@ import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAuthEnum; import com.azure.resourcemanager.postgresqlflexibleserver.models.ArmServerKeyType; import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfig; +import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTiers; import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForUpdate; import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption; import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow; import com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordAuthEnum; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode; +import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica; +import com.azure.resourcemanager.postgresqlflexibleserver.models.ReplicationPromoteOption; import com.azure.resourcemanager.postgresqlflexibleserver.models.Server; import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersion; import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; +import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow; import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; import java.util.HashMap; @@ -26,7 +31,7 @@ /** Samples for Servers Update. */ public final class ServersUpdateSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithAadAuthEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithAadAuthEnabled.json */ /** * Sample code: ServerUpdateWithAadAuthEnabled. @@ -44,7 +49,11 @@ public static void serverUpdateWithAadAuthEnabled( .update() .withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLoginPassword("newpassword") - .withStorage(new Storage().withStorageSizeGB(1024)) + .withStorage( + new Storage() + .withStorageSizeGB(1024) + .withAutoGrow(StorageAutoGrow.DISABLED) + .withTier(AzureManagedDiskPerformanceTiers.P30)) .withBackup(new Backup().withBackupRetentionDays(20)) .withAuthConfig( new AuthConfig() @@ -56,7 +65,7 @@ public static void serverUpdateWithAadAuthEnabled( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithDataEncryptionEnabled.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json */ /** * Sample code: ServerUpdateWithDataEncryptionEnabled. @@ -77,24 +86,82 @@ public static void serverUpdateWithDataEncryptionEnabled( new UserAssignedIdentity() .withUserAssignedIdentities( mapOf( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity", + new UserIdentity(), "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", new UserIdentity())) .withType(IdentityType.USER_ASSIGNED)) .withAdministratorLoginPassword("newpassword") - .withStorage(new Storage().withStorageSizeGB(1024)) .withBackup(new Backup().withBackupRetentionDays(20)) .withDataEncryption( new DataEncryption() .withPrimaryKeyUri("fakeTokenPlaceholder") .withPrimaryUserAssignedIdentityId( "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity") + .withGeoBackupKeyUri("fakeTokenPlaceholder") + .withGeoBackupUserAssignedIdentityId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity") .withType(ArmServerKeyType.AZURE_KEY_VAULT)) .withCreateMode(CreateModeForUpdate.UPDATE) .apply(); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdate.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json + */ + /** + * Sample code: SwitchOver a replica server as planned, i.e. it will wait for replication to complete before + * promoting replica as Primary and original primary as replica. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + switchOverAReplicaServerAsPlannedIEItWillWaitForReplicationToCompleteBeforePromotingReplicaAsPrimaryAndOriginalPrimaryAsReplica( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = + manager + .servers() + .getByResourceGroupWithResponse( + "testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withReplica( + new Replica() + .withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER) + .withPromoteOption(ReplicationPromoteOption.PLANNED)) + .apply(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedSwitchover.json + */ + /** + * Sample code: SwitchOver a replica server as forced, i.e. it will replica as Primary and original primary as + * replica immediately without waiting for primary and replica to be in sync. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + switchOverAReplicaServerAsForcedIEItWillReplicaAsPrimaryAndOriginalPrimaryAsReplicaImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = + manager + .servers() + .getByResourceGroupWithResponse( + "testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withReplica( + new Replica() + .withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER) + .withPromoteOption(ReplicationPromoteOption.FORCED)) + .apply(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdate.json */ /** * Sample code: ServerUpdate. @@ -111,14 +178,18 @@ public static void serverUpdate(com.azure.resourcemanager.postgresqlflexibleserv .update() .withSku(new Sku().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE)) .withAdministratorLoginPassword("newpassword") - .withStorage(new Storage().withStorageSizeGB(1024)) + .withStorage( + new Storage() + .withStorageSizeGB(1024) + .withAutoGrow(StorageAutoGrow.ENABLED) + .withTier(AzureManagedDiskPerformanceTiers.P30)) .withBackup(new Backup().withBackupRetentionDays(20)) .withCreateMode(CreateModeForUpdate.UPDATE) .apply(); } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithMajorVersionUpgrade.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json */ /** * Sample code: ServerUpdateWithMajorVersionUpgrade. @@ -136,7 +207,7 @@ public static void serverUpdateWithMajorVersionUpgrade( } /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/ServerUpdateWithCustomerMaintenanceWindow.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json */ /** * Sample code: ServerUpdateWithCustomerMaintenanceWindow. @@ -162,6 +233,59 @@ public static void serverUpdateWithCustomerMaintenanceWindow( .apply(); } + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json + */ + /** + * Sample code: Promote a replica server as a Standalone server as forced, i.e. it will promote a replica server + * immediately without waiting for primary and replica to be in sync. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void + promoteAReplicaServerAsAStandaloneServerAsForcedIEItWillPromoteAReplicaServerImmediatelyWithoutWaitingForPrimaryAndReplicaToBeInSync( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = + manager + .servers() + .getByResourceGroupWithResponse( + "testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withReplica( + new Replica() + .withPromoteMode(ReadReplicaPromoteMode.STANDALONE) + .withPromoteOption(ReplicationPromoteOption.FORCED)) + .apply(); + } + + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json + */ + /** + * Sample code: Promote a replica server as a Standalone server as planned, i.e. it will wait for replication to + * complete. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void promoteAReplicaServerAsAStandaloneServerAsPlannedIEItWillWaitForReplicationToComplete( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + Server resource = + manager + .servers() + .getByResourceGroupWithResponse( + "testResourceGroup", "pgtestsvc4-replica", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withReplica( + new Replica() + .withPromoteMode(ReadReplicaPromoteMode.STANDALONE) + .withPromoteOption(ReplicationPromoteOption.PLANNED)) + .apply(); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateSamples.java new file mode 100644 index 000000000000..7de791bd26b9 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsCreateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; +import java.util.Arrays; + +/** Samples for VirtualEndpoints Create. */ +public final class VirtualEndpointsCreateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointCreate.json + */ + /** + * Sample code: Create a new virtual endpoint for a flexible server. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void createANewVirtualEndpointForAFlexibleServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .virtualEndpoints() + .define("pgVirtualEndpoint1") + .withExistingFlexibleServer("testrg", "pgtestsvc4") + .withEndpointType(VirtualEndpointType.READ_WRITE) + .withMembers(Arrays.asList("testPrimary1")) + .create(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsDeleteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsDeleteSamples.java new file mode 100644 index 000000000000..b5e99ef01929 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for VirtualEndpoints Delete. */ +public final class VirtualEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointDelete.json + */ + /** + * Sample code: Delete a virtual endpoint. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void deleteAVirtualEndpoint( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .virtualEndpoints() + .delete("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetSamples.java new file mode 100644 index 000000000000..ba73b828fb81 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for VirtualEndpoints Get. */ +public final class VirtualEndpointsGetSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsGet.json + */ + /** + * Sample code: Get a virtual endpoint. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void getAVirtualEndpoint( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager + .virtualEndpoints() + .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerSamples.java new file mode 100644 index 000000000000..9f02fd6d060c --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsListByServerSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.postgresqlflexibleserver.generated; + +/** Samples for VirtualEndpoints ListByServer. */ +public final class VirtualEndpointsListByServerSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointsListByServer.json + */ + /** + * Sample code: VirtualEndpointListByServer. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void virtualEndpointListByServer( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + manager.virtualEndpoints().listByServer("testrg", "pgtestsvc4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsUpdateSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsUpdateSamples.java new file mode 100644 index 000000000000..89a377582075 --- /dev/null +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualEndpointsUpdateSamples.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.postgresqlflexibleserver.generated; + +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointResource; +import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpointType; +import java.util.Arrays; + +/** Samples for VirtualEndpoints Update. */ +public final class VirtualEndpointsUpdateSamples { + /* + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualEndpointUpdate.json + */ + /** + * Sample code: Update a virtual endpoint for a server to update the. + * + * @param manager Entry point to PostgreSqlManager. + */ + public static void updateAVirtualEndpointForAServerToUpdateThe( + com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) { + VirtualEndpointResource resource = + manager + .virtualEndpoints() + .getWithResponse("testrg", "pgtestsvc4", "pgVirtualEndpoint1", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withEndpointType(VirtualEndpointType.READ_WRITE) + .withMembers(Arrays.asList("testReplica1")) + .apply(); + } +} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageExecuteSamples.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageExecuteSamples.java index b8ba5c147b2e..00b957fdefaa 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageExecuteSamples.java +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/samples/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageExecuteSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualNetworkSubnetUsage Execute. */ public final class VirtualNetworkSubnetUsageExecuteSamples { /* - * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/examples/VirtualNetworkSubnetUsage.json + * x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-06-01-preview/examples/VirtualNetworkSubnetUsage.json */ /** * Sample code: VirtualNetworkSubnetUsageList. diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.java deleted file mode 100644 index f28b1696a552..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorAddTests.java +++ /dev/null @@ -1,37 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministratorAdd; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class ActiveDirectoryAdministratorAddTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ActiveDirectoryAdministratorAdd model = - BinaryData - .fromString( - "{\"properties\":{\"principalType\":\"Unknown\",\"principalName\":\"uv\",\"tenantId\":\"xpyb\"}}") - .toObject(ActiveDirectoryAdministratorAdd.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("uv", model.principalName()); - Assertions.assertEquals("xpyb", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActiveDirectoryAdministratorAdd model = - new ActiveDirectoryAdministratorAdd() - .withPrincipalType(PrincipalType.UNKNOWN) - .withPrincipalName("uv") - .withTenantId("xpyb"); - model = BinaryData.fromObject(model).toObject(ActiveDirectoryAdministratorAdd.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("uv", model.principalName()); - Assertions.assertEquals("xpyb", model.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorInnerTests.java deleted file mode 100644 index f3d63398be3f..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ActiveDirectoryAdministratorInnerTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ActiveDirectoryAdministratorInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class ActiveDirectoryAdministratorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ActiveDirectoryAdministratorInner model = - BinaryData - .fromString( - "{\"properties\":{\"principalType\":\"Unknown\",\"principalName\":\"msxaobhd\",\"objectId\":\"mtqio\",\"tenantId\":\"zehtbmu\"},\"id\":\"ownoizhw\",\"name\":\"rxybqsoq\",\"type\":\"jgkdmbpazlobcu\"}") - .toObject(ActiveDirectoryAdministratorInner.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("msxaobhd", model.principalName()); - Assertions.assertEquals("mtqio", model.objectId()); - Assertions.assertEquals("zehtbmu", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActiveDirectoryAdministratorInner model = - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.UNKNOWN) - .withPrincipalName("msxaobhd") - .withObjectId("mtqio") - .withTenantId("zehtbmu"); - model = BinaryData.fromObject(model).toObject(ActiveDirectoryAdministratorInner.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("msxaobhd", model.principalName()); - Assertions.assertEquals("mtqio", model.objectId()); - Assertions.assertEquals("zehtbmu", model.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorListResultTests.java deleted file mode 100644 index 4f244da44c62..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorListResultTests.java +++ /dev/null @@ -1,64 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ActiveDirectoryAdministratorInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.AdministratorListResult; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"principalType\":\"User\",\"principalName\":\"xrifkwmrvkts\",\"objectId\":\"nt\",\"tenantId\":\"ipa\"},\"id\":\"ajpsquc\",\"name\":\"poyfdkfogkn\",\"type\":\"gjofjd\"},{\"properties\":{\"principalType\":\"Unknown\",\"principalName\":\"rd\",\"objectId\":\"pewnw\",\"tenantId\":\"itjz\"},\"id\":\"lusarh\",\"name\":\"ofcqhsm\",\"type\":\"urkdtmlx\"},{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"k\",\"objectId\":\"txukcdmp\",\"tenantId\":\"cryuan\"},\"id\":\"uxzdxtay\",\"name\":\"lhmwhfpmrqobm\",\"type\":\"u\"},{\"properties\":{\"principalType\":\"User\",\"principalName\":\"yrtih\",\"objectId\":\"tijbpzvgnwzsymgl\",\"tenantId\":\"fcyzkohdbihanufh\"},\"id\":\"bj\",\"name\":\"s\",\"type\":\"git\"}],\"nextLink\":\"qhabifpikxwcz\"}") - .toObject(AdministratorListResult.class); - Assertions.assertEquals(PrincipalType.USER, model.value().get(0).principalType()); - Assertions.assertEquals("xrifkwmrvkts", model.value().get(0).principalName()); - Assertions.assertEquals("nt", model.value().get(0).objectId()); - Assertions.assertEquals("ipa", model.value().get(0).tenantId()); - Assertions.assertEquals("qhabifpikxwcz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorListResult model = - new AdministratorListResult() - .withValue( - Arrays - .asList( - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.USER) - .withPrincipalName("xrifkwmrvkts") - .withObjectId("nt") - .withTenantId("ipa"), - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.UNKNOWN) - .withPrincipalName("rd") - .withObjectId("pewnw") - .withTenantId("itjz"), - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.GROUP) - .withPrincipalName("k") - .withObjectId("txukcdmp") - .withTenantId("cryuan"), - new ActiveDirectoryAdministratorInner() - .withPrincipalType(PrincipalType.USER) - .withPrincipalName("yrtih") - .withObjectId("tijbpzvgnwzsymgl") - .withTenantId("fcyzkohdbihanufh"))) - .withNextLink("qhabifpikxwcz"); - model = BinaryData.fromObject(model).toObject(AdministratorListResult.class); - Assertions.assertEquals(PrincipalType.USER, model.value().get(0).principalType()); - Assertions.assertEquals("xrifkwmrvkts", model.value().get(0).principalName()); - Assertions.assertEquals("nt", model.value().get(0).objectId()); - Assertions.assertEquals("ipa", model.value().get(0).tenantId()); - Assertions.assertEquals("qhabifpikxwcz", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesForAddTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesForAddTests.java deleted file mode 100644 index 72b2a7ea4da9..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesForAddTests.java +++ /dev/null @@ -1,37 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.AdministratorPropertiesForAdd; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorPropertiesForAddTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorPropertiesForAdd model = - BinaryData - .fromString( - "{\"principalType\":\"Unknown\",\"principalName\":\"hmtzopbsphrup\",\"tenantId\":\"gsybbejhp\"}") - .toObject(AdministratorPropertiesForAdd.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("hmtzopbsphrup", model.principalName()); - Assertions.assertEquals("gsybbejhp", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorPropertiesForAdd model = - new AdministratorPropertiesForAdd() - .withPrincipalType(PrincipalType.UNKNOWN) - .withPrincipalName("hmtzopbsphrup") - .withTenantId("gsybbejhp"); - model = BinaryData.fromObject(model).toObject(AdministratorPropertiesForAdd.class); - Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType()); - Assertions.assertEquals("hmtzopbsphrup", model.principalName()); - Assertions.assertEquals("gsybbejhp", model.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesTests.java deleted file mode 100644 index 06f0731f9a68..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorPropertiesTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.AdministratorProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import org.junit.jupiter.api.Assertions; - -public final class AdministratorPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdministratorProperties model = - BinaryData - .fromString( - "{\"principalType\":\"Group\",\"principalName\":\"nrbtcqqjnq\",\"objectId\":\"hqgnufooojywif\",\"tenantId\":\"esaagdfm\"}") - .toObject(AdministratorProperties.class); - Assertions.assertEquals(PrincipalType.GROUP, model.principalType()); - Assertions.assertEquals("nrbtcqqjnq", model.principalName()); - Assertions.assertEquals("hqgnufooojywif", model.objectId()); - Assertions.assertEquals("esaagdfm", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdministratorProperties model = - new AdministratorProperties() - .withPrincipalType(PrincipalType.GROUP) - .withPrincipalName("nrbtcqqjnq") - .withObjectId("hqgnufooojywif") - .withTenantId("esaagdfm"); - model = BinaryData.fromObject(model).toObject(AdministratorProperties.class); - Assertions.assertEquals(PrincipalType.GROUP, model.principalType()); - Assertions.assertEquals("nrbtcqqjnq", model.principalName()); - Assertions.assertEquals("hqgnufooojywif", model.objectId()); - Assertions.assertEquals("esaagdfm", model.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateMockTests.java deleted file mode 100644 index 1ae3ba8b317c..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsCreateMockTests.java +++ /dev/null @@ -1,78 +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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdministratorsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalType\":\"User\",\"principalName\":\"mciodhkhazxkhn\",\"objectId\":\"onlwntoeg\",\"tenantId\":\"dwbwhkszzcmrvexz\"},\"id\":\"bt\",\"name\":\"gsfraoyzkoow\",\"type\":\"lmnguxaw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ActiveDirectoryAdministrator response = - manager - .administrators() - .define("i") - .withExistingFlexibleServer("jitcjedftwwaez", "ojvdcpzfoqo") - .withPrincipalType(PrincipalType.SERVICE_PRINCIPAL) - .withPrincipalName("rzgszufoxci") - .withTenantId("p") - .create(); - - Assertions.assertEquals(PrincipalType.USER, response.principalType()); - Assertions.assertEquals("mciodhkhazxkhn", response.principalName()); - Assertions.assertEquals("onlwntoeg", response.objectId()); - Assertions.assertEquals("dwbwhkszzcmrvexz", response.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.java deleted file mode 100644 index 3afb54e8b634..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsDeleteMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdministratorsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.administrators().delete("kwyfzqwhxxbuyqax", "feqztppriol", "or", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.java deleted file mode 100644 index 9d28bbdb0d7c..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsGetWithResponseMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdministratorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalType\":\"Group\",\"principalName\":\"vglsbjjca\",\"objectId\":\"xbvtvudu\",\"tenantId\":\"cormr\"},\"id\":\"qtvcofudflvkgj\",\"name\":\"bgdknnqv\",\"type\":\"aznqntoru\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ActiveDirectoryAdministrator response = - manager - .administrators() - .getWithResponse("altol", "ncwsob", "wcsdbnwdcfhucq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PrincipalType.GROUP, response.principalType()); - Assertions.assertEquals("vglsbjjca", response.principalName()); - Assertions.assertEquals("xbvtvudu", response.objectId()); - Assertions.assertEquals("cormr", response.tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.java deleted file mode 100644 index ad42ea29b66d..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/AdministratorsListByServerMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ActiveDirectoryAdministrator; -import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdministratorsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principalType\":\"Unknown\",\"principalName\":\"l\",\"objectId\":\"ab\",\"tenantId\":\"oefki\"},\"id\":\"vtpuqujmqlgk\",\"name\":\"btndo\",\"type\":\"ongbjcnt\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.administrators().listByServer("sgsahmkycgr", "uwjuetaeburuvdmo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PrincipalType.UNKNOWN, response.iterator().next().principalType()); - Assertions.assertEquals("l", response.iterator().next().principalName()); - Assertions.assertEquals("ab", response.iterator().next().objectId()); - Assertions.assertEquals("oefki", response.iterator().next().tenantId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.java deleted file mode 100644 index 9879ff934f51..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Backup; -import com.azure.resourcemanager.postgresqlflexibleserver.models.GeoRedundantBackupEnum; -import org.junit.jupiter.api.Assertions; - -public final class BackupTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Backup model = - BinaryData - .fromString( - "{\"backupRetentionDays\":1405054510,\"geoRedundantBackup\":\"Enabled\",\"earliestRestoreDate\":\"2021-05-26T16:23:12Z\"}") - .toObject(Backup.class); - Assertions.assertEquals(1405054510, model.backupRetentionDays()); - Assertions.assertEquals(GeoRedundantBackupEnum.ENABLED, model.geoRedundantBackup()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Backup model = - new Backup().withBackupRetentionDays(1405054510).withGeoRedundantBackup(GeoRedundantBackupEnum.ENABLED); - model = BinaryData.fromObject(model).toObject(Backup.class); - Assertions.assertEquals(1405054510, model.backupRetentionDays()); - Assertions.assertEquals(GeoRedundantBackupEnum.ENABLED, model.geoRedundantBackup()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java deleted file mode 100644 index 924dc5044434..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"backupType\":\"Full\",\"completedTime\":\"2021-12-03T14:40:57Z\",\"source\":\"fdsd\"},\"id\":\"kgtdlmkkze\",\"name\":\"dlhewp\",\"type\":\"sdsttwvog\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerBackup response = - manager - .backups() - .getWithResponse("aldsy", "uximerqfobw", "znkbykutwpfhpagm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(Origin.FULL, response.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T14:40:57Z"), response.completedTime()); - Assertions.assertEquals("fdsd", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java deleted file mode 100644 index 3e95d02736ca..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/BackupsListByServerMockTests.java +++ /dev/null @@ -1,71 +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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BackupsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"backupType\":\"Full\",\"completedTime\":\"2021-02-25T20:44Z\",\"source\":\"wae\"},\"id\":\"uzkopbminrfd\",\"name\":\"oyuhhziui\",\"type\":\"fozbhdmsmlmzqhof\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.backups().listByServer("bbejdcngqqm", "akufgmjz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(Origin.FULL, response.iterator().next().backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T20:44Z"), response.iterator().next().completedTime()); - Assertions.assertEquals("wae", response.iterator().next().source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.java deleted file mode 100644 index 35a0bcd63d8c..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilitiesListResultTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilitiesListResult; - -public final class CapabilitiesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilitiesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"zone\":\"wyahuxinpmqnja\",\"supportedHAMode\":[\"xj\",\"prozvcputegjvwmf\",\"atscmd\",\"pjhulsuuvmkj\"],\"geoBackupSupported\":false,\"zoneRedundantHaSupported\":true,\"zoneRedundantHaAndGeoBackupSupported\":true,\"supportedFlexibleServerEditions\":[{\"name\":\"djpslw\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{}],\"status\":\"ryo\"},{\"name\":\"soacctazakl\",\"supportedStorageEditions\":[{}],\"supportedServerVersions\":[{},{},{}],\"status\":\"ryffdfdosy\"}],\"supportedHyperscaleNodeEditions\":[{\"name\":\"aojakhmsbzjhcrz\",\"supportedStorageEditions\":[{},{},{}],\"supportedServerVersions\":[{},{},{}],\"supportedNodeTypes\":[{},{}],\"status\":\"olthqtrgqjbp\"},{\"name\":\"fsinzgvfcjrwzoxx\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{},{}],\"supportedNodeTypes\":[{},{},{}],\"status\":\"fziton\"},{\"name\":\"qfpjk\",\"supportedStorageEditions\":[{},{},{},{}],\"supportedServerVersions\":[{},{},{}],\"supportedNodeTypes\":[{},{},{},{}],\"status\":\"hpf\"}],\"fastProvisioningSupported\":false,\"supportedFastProvisioningEditions\":[{\"supportedSku\":\"i\",\"supportedStorageGb\":5402318839281112329,\"supportedServerVersions\":\"uybbkpodep\"},{\"supportedSku\":\"ginuvamih\",\"supportedStorageGb\":3328523477846905780,\"supportedServerVersions\":\"rxzxtheo\"}],\"status\":\"si\"}],\"nextLink\":\"evcciqihnhun\"}") - .toObject(CapabilitiesListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilitiesListResult model = new CapabilitiesListResult(); - model = BinaryData.fromObject(model).toObject(CapabilitiesListResult.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilityPropertiesInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilityPropertiesInnerTests.java deleted file mode 100644 index 46b9b49cfe3f..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CapabilityPropertiesInnerTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.CapabilityPropertiesInner; - -public final class CapabilityPropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityPropertiesInner model = - BinaryData - .fromString( - "{\"zone\":\"wjzrnfygxgisp\",\"supportedHAMode\":[\"tzfkufubl\"],\"geoBackupSupported\":false,\"zoneRedundantHaSupported\":false,\"zoneRedundantHaAndGeoBackupSupported\":true,\"supportedFlexibleServerEditions\":[{\"name\":\"e\",\"supportedStorageEditions\":[{\"name\":\"jbasvmsmjqulngs\",\"supportedStorageMB\":[{},{},{},{}],\"status\":\"ybkzgcwr\"},{\"name\":\"lxxwrljdouskc\",\"supportedStorageMB\":[{},{},{},{}],\"status\":\"cr\"},{\"name\":\"dkwt\",\"supportedStorageMB\":[{},{},{}],\"status\":\"njbiksqrglssain\"}],\"supportedServerVersions\":[{\"name\":\"nzl\",\"supportedVersionsToUpgrade\":[\"mppeebvmgxs\",\"bkyqduu\"],\"supportedVcores\":[{}],\"status\":\"jczdzevndh\"},{\"name\":\"wpdappdsbdkv\",\"supportedVersionsToUpgrade\":[\"jfeusnh\",\"tjelt\",\"rl\",\"hugjzzdatqxhoc\"],\"supportedVcores\":[{},{}],\"status\":\"blgphuticn\"},{\"name\":\"kao\",\"supportedVersionsToUpgrade\":[\"i\",\"tyhxhurokft\",\"xolniwpwcukjfk\"],\"supportedVcores\":[{},{}],\"status\":\"xklrypl\"}],\"status\":\"kbasyypn\"}],\"supportedHyperscaleNodeEditions\":[{\"name\":\"gcbacphejkot\",\"supportedStorageEditions\":[{\"name\":\"oulzndlikwyq\",\"supportedStorageMB\":[{},{},{}],\"status\":\"ibmadgakeqsrxy\"},{\"name\":\"qqedqytbciqfou\",\"supportedStorageMB\":[{},{},{}],\"status\":\"nkzsmodmglou\"}],\"supportedServerVersions\":[{\"name\":\"wtmutduq\",\"supportedVersionsToUpgrade\":[\"pspwgcuertu\"],\"supportedVcores\":[{},{},{},{}],\"status\":\"svqwhbmdgbbjfd\"}],\"supportedNodeTypes\":[{\"name\":\"mbe\",\"nodeType\":\"pbhtqqrolfpfpsa\",\"status\":\"bquxigjy\"},{\"name\":\"zjaoyfhrtxil\",\"nodeType\":\"rkujy\",\"status\":\"l\"},{\"name\":\"uvfqawrlyxwj\",\"nodeType\":\"prbnwbxgjvtbv\",\"status\":\"sszdnru\"}],\"status\":\"guhmuouqfpr\"},{\"name\":\"wbnguitnwui\",\"supportedStorageEditions\":[{\"name\":\"x\",\"supportedStorageMB\":[{},{},{},{}],\"status\":\"uckyf\"}],\"supportedServerVersions\":[{\"name\":\"idf\",\"supportedVersionsToUpgrade\":[\"dzuhtymwi\",\"dkfthwxmnt\",\"i\"],\"supportedVcores\":[{},{},{}],\"status\":\"vkmijcmmxdcuf\"},{\"name\":\"srp\",\"supportedVersionsToUpgrade\":[\"idnsezcxtb\",\"sgfyccsnew\",\"dwzjeiach\",\"oosflnr\"],\"supportedVcores\":[{},{}],\"status\":\"pteehzzv\"},{\"name\":\"yqrimzin\",\"supportedVersionsToUpgrade\":[\"wjdk\",\"rsoodqxhcrmnoh\",\"t\"],\"supportedVcores\":[{},{},{}],\"status\":\"dsoifiyipj\"}],\"supportedNodeTypes\":[{\"name\":\"pgrjbz\",\"nodeType\":\"rcjxvsnbyxqabn\",\"status\":\"cpc\"},{\"name\":\"hurzafblj\",\"nodeType\":\"pbtoqcjmkl\",\"status\":\"vbqid\"},{\"name\":\"ajzyul\",\"nodeType\":\"u\",\"status\":\"krlkhbzhfepg\"}],\"status\":\"qex\"},{\"name\":\"ocxscpaierhhbcs\",\"supportedStorageEditions\":[{\"name\":\"majtjaod\",\"supportedStorageMB\":[{},{},{},{}],\"status\":\"bdxkqpxokaj\"},{\"name\":\"npime\",\"supportedStorageMB\":[{},{}],\"status\":\"xgcp\"},{\"name\":\"gmaajrm\",\"supportedStorageMB\":[{},{}],\"status\":\"zrlovmclwhijcoej\"}],\"supportedServerVersions\":[{\"name\":\"aqsqsycbkbfk\",\"supportedVersionsToUpgrade\":[\"dkexxppofm\",\"axcfjpgddtocjjx\"],\"supportedVcores\":[{},{},{}],\"status\":\"o\"},{\"name\":\"xhdzxibqeojnx\",\"supportedVersionsToUpgrade\":[\"vddntwn\",\"eic\",\"twnpzaoqvuhrhcf\",\"cyddglmjthjqk\"],\"supportedVcores\":[{},{},{},{}],\"status\":\"icxm\"},{\"name\":\"iwqvhkh\",\"supportedVersionsToUpgrade\":[\"igdtopbob\",\"og\",\"m\",\"w\"],\"supportedVcores\":[{}],\"status\":\"uhrzayvvt\"},{\"name\":\"vdfgiotk\",\"supportedVersionsToUpgrade\":[\"tqxln\",\"xlefgugnxkrx\"],\"supportedVcores\":[{}],\"status\":\"dt\"}],\"supportedNodeTypes\":[{\"name\":\"vqdra\",\"nodeType\":\"jybige\",\"status\":\"qfbow\"},{\"name\":\"anyktzlcuiywg\",\"nodeType\":\"wgndrvynhzgpp\",\"status\":\"cgyncocpecf\"}],\"status\":\"mcoo\"},{\"name\":\"xlzevgbmqjqabcy\",\"supportedStorageEditions\":[{\"name\":\"kwlzuvccfwnfn\",\"supportedStorageMB\":[{},{}],\"status\":\"ionle\"},{\"name\":\"etqgtzxdpnq\",\"supportedStorageMB\":[{},{},{}],\"status\":\"xrjfeallnwsub\"},{\"name\":\"njampm\",\"supportedStorageMB\":[{},{}],\"status\":\"scxaq\"},{\"name\":\"ochcbonqvpkvl\",\"supportedStorageMB\":[{},{},{},{}],\"status\":\"ea\"}],\"supportedServerVersions\":[{\"name\":\"heoflokeyyienjbd\",\"supportedVersionsToUpgrade\":[\"grhpdjpju\",\"asxazjpqyegualhb\",\"xhejjzzvdud\",\"wdslfhotwmcy\"],\"supportedVcores\":[{},{},{},{}],\"status\":\"bjnpg\"},{\"name\":\"ftadehxnltyfs\",\"supportedVersionsToUpgrade\":[\"usue\",\"nzwdejba\"],\"supportedVcores\":[{},{},{},{}],\"status\":\"zdmohctbqvu\"},{\"name\":\"xdn\",\"supportedVersionsToUpgrade\":[\"owgujjugwdkcglhs\"],\"supportedVcores\":[{}],\"status\":\"dyggdtjixhbku\"},{\"name\":\"qweykhmenev\",\"supportedVersionsToUpgrade\":[\"xfw\",\"ybcibvyvdcsit\"],\"supportedVcores\":[{},{}],\"status\":\"amdecte\"}],\"supportedNodeTypes\":[{\"name\":\"scjeypv\",\"nodeType\":\"zrkgqhcjrefovg\",\"status\":\"qsl\"},{\"name\":\"yvxyqjp\",\"nodeType\":\"attpngjcrcczsq\",\"status\":\"hvmdajvnysounq\"},{\"name\":\"a\",\"nodeType\":\"ae\",\"status\":\"fhyhltrpmopjmcma\"}],\"status\":\"okth\"}],\"fastProvisioningSupported\":false,\"supportedFastProvisioningEditions\":[{\"supportedSku\":\"dsfcpkvxodpuoz\",\"supportedStorageGb\":8781423731526704607,\"supportedServerVersions\":\"agfuaxbezyiu\"},{\"supportedSku\":\"ktwh\",\"supportedStorageGb\":1253263563157785214,\"supportedServerVersions\":\"ywqsmbsurexim\"},{\"supportedSku\":\"yocf\",\"supportedStorageGb\":4617663659478224869,\"supportedServerVersions\":\"mddystkiiux\"}],\"status\":\"yudxorrqnbp\"}") - .toObject(CapabilityPropertiesInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityPropertiesInner model = new CapabilityPropertiesInner(); - model = BinaryData.fromObject(model).toObject(CapabilityPropertiesInner.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.java deleted file mode 100644 index c2e87ede362c..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilitiesExecuteWithResponseMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NameAvailability; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilitiesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"name\":\"rrjreafxtsgu\",\"type\":\"jglikkxwslolb\",\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"m\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilities() - .executeWithResponse( - new CheckNameAvailabilityRequest().withName("sxkm").withType("a"), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("m", response.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index 6abdfc8f3261..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityRequestTests.java +++ /dev/null @@ -1,30 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"jyofdxluusdtto\",\"type\":\"aboekqv\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("jyofdxluusdtto", model.name()); - Assertions.assertEquals("aboekqv", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model = - new CheckNameAvailabilityRequest().withName("jyofdxluusdtto").withType("aboekqv"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("jyofdxluusdtto", model.name()); - Assertions.assertEquals("aboekqv", model.type()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityResponseTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityResponseTests.java deleted file mode 100644 index 169427f41888..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityResponseTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityResponse; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityResponse model = - BinaryData - .fromString("{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"idzyexznelixhnr\"}") - .toObject(CheckNameAvailabilityResponse.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); - Assertions.assertEquals("idzyexznelixhnr", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponse model = - new CheckNameAvailabilityResponse() - .withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.INVALID) - .withMessage("idzyexznelixhnr"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponse.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); - Assertions.assertEquals("idzyexznelixhnr", model.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.java deleted file mode 100644 index 5b99dff4a1c9..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NameAvailability; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CheckNameAvailabilityWithLocationsExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"name\":\"njwmwkpnbsazejj\",\"type\":\"kagfhsxtt\",\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"faazpxdtnkdmkqjj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailability response = - manager - .checkNameAvailabilityWithLocations() - .executeWithResponse( - "felfktg", - new CheckNameAvailabilityRequest().withName("crpw").withType("eznoig"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("faazpxdtnkdmkqjj", response.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.java deleted file mode 100644 index 55e1ca8118c3..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationForUpdateTests.java +++ /dev/null @@ -1,30 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationForUpdate; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationForUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationForUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"value\":\"bmwmbesldnkw\",\"description\":\"pp\",\"defaultValue\":\"lcxog\",\"dataType\":\"Integer\",\"allowedValues\":\"nzmnsikvm\",\"source\":\"ze\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"xmhhvhgureo\",\"documentationLink\":\"wobdagxtibqdx\"}}") - .toObject(ConfigurationForUpdate.class); - Assertions.assertEquals("bmwmbesldnkw", model.value()); - Assertions.assertEquals("ze", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationForUpdate model = new ConfigurationForUpdate().withValue("bmwmbesldnkw").withSource("ze"); - model = BinaryData.fromObject(model).toObject(ConfigurationForUpdate.class); - Assertions.assertEquals("bmwmbesldnkw", model.value()); - Assertions.assertEquals("ze", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationInnerTests.java deleted file mode 100644 index ce52663b4724..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationInnerTests.java +++ /dev/null @@ -1,30 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationInner; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationInner model = - BinaryData - .fromString( - "{\"properties\":{\"value\":\"oygmift\",\"description\":\"zdnds\",\"defaultValue\":\"nayqi\",\"dataType\":\"Enumeration\",\"allowedValues\":\"uhavhql\",\"source\":\"humaqolbgyc\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"cym\",\"documentationLink\":\"olpsslqlf\"},\"id\":\"dnbbglzps\",\"name\":\"iydmcwyhzdxs\",\"type\":\"adbzmnvdfznud\"}") - .toObject(ConfigurationInner.class); - Assertions.assertEquals("oygmift", model.value()); - Assertions.assertEquals("humaqolbgyc", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationInner model = new ConfigurationInner().withValue("oygmift").withSource("humaqolbgyc"); - model = BinaryData.fromObject(model).toObject(ConfigurationInner.class); - Assertions.assertEquals("oygmift", model.value()); - Assertions.assertEquals("humaqolbgyc", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationListResultTests.java deleted file mode 100644 index 87389c6b2983..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationListResultTests.java +++ /dev/null @@ -1,42 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ConfigurationListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"value\":\"hb\",\"description\":\"knalaulppg\",\"defaultValue\":\"tpnapnyiropuhpig\",\"dataType\":\"Enumeration\",\"allowedValues\":\"lgqg\",\"source\":\"xmedjvcsly\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":false,\"unit\":\"zhxgktrmgucn\",\"documentationLink\":\"kteo\"},\"id\":\"lwptfdy\",\"name\":\"pfqbuaceopzf\",\"type\":\"rhhuaopppcqeqx\"},{\"properties\":{\"value\":\"dahzxctobg\",\"description\":\"dmoizpostmg\",\"defaultValue\":\"fbunrmfqjhhk\",\"dataType\":\"Enumeration\",\"allowedValues\":\"jy\",\"source\":\"hx\",\"isDynamicConfig\":false,\"isReadOnly\":true,\"isConfigPendingRestart\":false,\"unit\":\"vkr\",\"documentationLink\":\"wbxqzvszjfau\"},\"id\":\"fdxxivetvtcqaqtd\",\"name\":\"qmcbxvwvxyslqbhs\",\"type\":\"xoblytkbl\"},{\"properties\":{\"value\":\"wwwfbkr\",\"description\":\"nsvs\",\"defaultValue\":\"johxcrsb\",\"dataType\":\"Integer\",\"allowedValues\":\"srruvwbhsqfsubcg\",\"source\":\"irx\",\"isDynamicConfig\":true,\"isReadOnly\":true,\"isConfigPendingRestart\":true,\"unit\":\"jfdtwssotftpvj\",\"documentationLink\":\"exilzznfqqnvwpmq\"},\"id\":\"ruoujmk\",\"name\":\"jhwqytjrybnw\",\"type\":\"ewgdrjervn\"}],\"nextLink\":\"nqpeh\"}") - .toObject(ConfigurationListResult.class); - Assertions.assertEquals("hb", model.value().get(0).value()); - Assertions.assertEquals("xmedjvcsly", model.value().get(0).source()); - Assertions.assertEquals("nqpeh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationListResult model = - new ConfigurationListResult() - .withValue( - Arrays - .asList( - new ConfigurationInner().withValue("hb").withSource("xmedjvcsly"), - new ConfigurationInner().withValue("dahzxctobg").withSource("hx"), - new ConfigurationInner().withValue("wwwfbkr").withSource("irx"))) - .withNextLink("nqpeh"); - model = BinaryData.fromObject(model).toObject(ConfigurationListResult.class); - Assertions.assertEquals("hb", model.value().get(0).value()); - Assertions.assertEquals("xmedjvcsly", model.value().get(0).source()); - Assertions.assertEquals("nqpeh", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationPropertiesTests.java deleted file mode 100644 index 0b39e0132068..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationPropertiesTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ConfigurationProperties; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationProperties model = - BinaryData - .fromString( - "{\"value\":\"dvxzbncblylpst\",\"description\":\"hh\",\"defaultValue\":\"rzdzucerscdnt\",\"dataType\":\"Integer\",\"allowedValues\":\"iwjmygtdssls\",\"source\":\"mweriofzpy\",\"isDynamicConfig\":false,\"isReadOnly\":false,\"isConfigPendingRestart\":false,\"unit\":\"ets\",\"documentationLink\":\"szhedplvw\"}") - .toObject(ConfigurationProperties.class); - Assertions.assertEquals("dvxzbncblylpst", model.value()); - Assertions.assertEquals("mweriofzpy", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationProperties model = - new ConfigurationProperties().withValue("dvxzbncblylpst").withSource("mweriofzpy"); - model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class); - Assertions.assertEquals("dvxzbncblylpst", model.value()); - Assertions.assertEquals("mweriofzpy", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index 448b8522a8e1..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"value\":\"bfpncurdo\",\"description\":\"iithtywu\",\"defaultValue\":\"cbihwqk\",\"dataType\":\"Integer\",\"allowedValues\":\"twjchrdg\",\"source\":\"hxumwctondzj\",\"isDynamicConfig\":false,\"isReadOnly\":false,\"isConfigPendingRestart\":false,\"unit\":\"gg\",\"documentationLink\":\"sb\"},\"id\":\"ovvtgseinqfiu\",\"name\":\"x\",\"type\":\"knpirgnepttwq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .getWithResponse("lmcuvhixb", "xyfwnylrcool", "ttpkiwkkbnujrywv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bfpncurdo", response.value()); - Assertions.assertEquals("hxumwctondzj", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.java deleted file mode 100644 index 0be2a39b29ea..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsListByServerMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"value\":\"xqtnq\",\"description\":\"ezl\",\"defaultValue\":\"ffiakp\",\"dataType\":\"Integer\",\"allowedValues\":\"m\",\"source\":\"d\",\"isDynamicConfig\":false,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"eozphv\",\"documentationLink\":\"uyqncygupkvipmd\"},\"id\":\"wx\",\"name\":\"upev\",\"type\":\"hfstotxhojujbyp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.configurations().listByServer("wuenvr", "pyouaibrebqaays", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xqtnq", response.iterator().next().value()); - Assertions.assertEquals("d", response.iterator().next().source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.java deleted file mode 100644 index d631455cba0e..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ConfigurationsPutMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Configuration; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationsPutMockTests { - @Test - public void testPut() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"value\":\"tqmieox\",\"description\":\"ggufhyaomtb\",\"defaultValue\":\"havgrvk\",\"dataType\":\"Enumeration\",\"allowedValues\":\"jzhpjbibgjmfx\",\"source\":\"vfcluyovwxnbkfe\",\"isDynamicConfig\":true,\"isReadOnly\":false,\"isConfigPendingRestart\":true,\"unit\":\"zdgiruj\",\"documentationLink\":\"bomvzzbtdcqv\"},\"id\":\"iyujviylwdshfs\",\"name\":\"n\",\"type\":\"bgye\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Configuration response = - manager - .configurations() - .define("frddhcrati") - .withExistingFlexibleServer("sniffc", "mqnrojlpijnkr") - .withValue("onasxifto") - .withSource("qxvcxgfrpdsofb") - .create(); - - Assertions.assertEquals("tqmieox", response.value()); - Assertions.assertEquals("vfcluyovwxnbkfe", response.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.java deleted file mode 100644 index 852ce73e7dd9..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseInnerTests.java +++ /dev/null @@ -1,30 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseInner; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseInner model = - BinaryData - .fromString( - "{\"properties\":{\"charset\":\"akbogqxndlkzgxh\",\"collation\":\"iplbpodxunkbebxm\"},\"id\":\"yyntwl\",\"name\":\"bqtkoievseotgqr\",\"type\":\"ltmuwlauwzizx\"}") - .toObject(DatabaseInner.class); - Assertions.assertEquals("akbogqxndlkzgxh", model.charset()); - Assertions.assertEquals("iplbpodxunkbebxm", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInner model = new DatabaseInner().withCharset("akbogqxndlkzgxh").withCollation("iplbpodxunkbebxm"); - model = BinaryData.fromObject(model).toObject(DatabaseInner.class); - Assertions.assertEquals("akbogqxndlkzgxh", model.charset()); - Assertions.assertEquals("iplbpodxunkbebxm", model.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseListResultTests.java deleted file mode 100644 index 2b0c40db319b..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabaseListResultTests.java +++ /dev/null @@ -1,37 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DatabaseListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"charset\":\"ebmnzbtbhjpglk\",\"collation\":\"ohdneuel\"},\"id\":\"hsd\",\"name\":\"htozfikdow\",\"type\":\"quuvxzxcl\"}],\"nextLink\":\"thhqzonosggbh\"}") - .toObject(DatabaseListResult.class); - Assertions.assertEquals("ebmnzbtbhjpglk", model.value().get(0).charset()); - Assertions.assertEquals("ohdneuel", model.value().get(0).collation()); - Assertions.assertEquals("thhqzonosggbh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseListResult model = - new DatabaseListResult() - .withValue(Arrays.asList(new DatabaseInner().withCharset("ebmnzbtbhjpglk").withCollation("ohdneuel"))) - .withNextLink("thhqzonosggbh"); - model = BinaryData.fromObject(model).toObject(DatabaseListResult.class); - Assertions.assertEquals("ebmnzbtbhjpglk", model.value().get(0).charset()); - Assertions.assertEquals("ohdneuel", model.value().get(0).collation()); - Assertions.assertEquals("thhqzonosggbh", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasePropertiesTests.java deleted file mode 100644 index 52f9afc07352..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasePropertiesTests.java +++ /dev/null @@ -1,29 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.DatabaseProperties; -import org.junit.jupiter.api.Assertions; - -public final class DatabasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseProperties model = - BinaryData - .fromString("{\"charset\":\"pgcjefuzmuvp\",\"collation\":\"tdum\"}") - .toObject(DatabaseProperties.class); - Assertions.assertEquals("pgcjefuzmuvp", model.charset()); - Assertions.assertEquals("tdum", model.collation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseProperties model = new DatabaseProperties().withCharset("pgcjefuzmuvp").withCollation("tdum"); - model = BinaryData.fromObject(model).toObject(DatabaseProperties.class); - Assertions.assertEquals("pgcjefuzmuvp", model.charset()); - Assertions.assertEquals("tdum", model.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateMockTests.java deleted file mode 100644 index bcc1a5696bef..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesCreateMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"charset\":\"novqfzge\",\"collation\":\"dftuljltduce\"},\"id\":\"tmczuomejwcwwqi\",\"name\":\"knssxmojm\",\"type\":\"vpkjpr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .define("aeqphchqnr") - .withExistingFlexibleServer("jslb", "wkojgcyztsfmzn") - .withCharset("x") - .withCollation("uwrykqgaifmvikl") - .create(); - - Assertions.assertEquals("novqfzge", response.charset()); - Assertions.assertEquals("dftuljltduce", response.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.java deleted file mode 100644 index 10b556987317..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesDeleteMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.databases().delete("rymsgaojfmw", "cotmr", "hirctymoxoftpipi", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java deleted file mode 100644 index e49d033d576d..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"charset\":\"rsre\",\"collation\":\"vxurisjnhnytxifq\"},\"id\":\"gxmrhublwp\",\"name\":\"esutrgjupauutpw\",\"type\":\"qhih\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Database response = - manager - .databases() - .getWithResponse("yczuhxacpq", "lihhyuspskasdvlm", "wdgzxulucv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rsre", response.charset()); - Assertions.assertEquals("vxurisjnhnytxifq", response.collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.java deleted file mode 100644 index dc6f95f29ae1..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DatabasesListByServerMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Database; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DatabasesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"charset\":\"vfoimwksli\",\"collation\":\"izjx\"},\"id\":\"dfcea\",\"name\":\"vlhv\",\"type\":\"gdyftumrtwna\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.databases().listByServer("jqgwzp", "fqntcyp", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vfoimwksli", response.iterator().next().charset()); - Assertions.assertEquals("izjx", response.iterator().next().collation()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.java deleted file mode 100644 index 92855ebcc0cb..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/DelegatedSubnetUsageTests.java +++ /dev/null @@ -1,24 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.DelegatedSubnetUsage; - -public final class DelegatedSubnetUsageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DelegatedSubnetUsage model = - BinaryData - .fromString("{\"subnetName\":\"hmlwpaztzpo\",\"usage\":6124178728244060008}") - .toObject(DelegatedSubnetUsage.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DelegatedSubnetUsage model = new DelegatedSubnetUsage(); - model = BinaryData.fromObject(model).toObject(DelegatedSubnetUsage.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.java deleted file mode 100644 index be9a6de72e66..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FastProvisioningEditionCapabilityTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FastProvisioningEditionCapability; - -public final class FastProvisioningEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FastProvisioningEditionCapability model = - BinaryData - .fromString( - "{\"supportedSku\":\"jzuaejxdultskzbb\",\"supportedStorageGb\":2312273597088062526,\"supportedServerVersions\":\"veekgpwozuhkfp\"}") - .toObject(FastProvisioningEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FastProvisioningEditionCapability model = new FastProvisioningEditionCapability(); - model = BinaryData.fromObject(model).toObject(FastProvisioningEditionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleInnerTests.java deleted file mode 100644 index 1f2f9fce4c97..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleInnerTests.java +++ /dev/null @@ -1,30 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleInner; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"startIpAddress\":\"ohfwds\",\"endIpAddress\":\"n\"},\"id\":\"ljuti\",\"name\":\"swacffgdkzz\",\"type\":\"wkfvhqcrailvp\"}") - .toObject(FirewallRuleInner.class); - Assertions.assertEquals("ohfwds", model.startIpAddress()); - Assertions.assertEquals("n", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleInner model = new FirewallRuleInner().withStartIpAddress("ohfwds").withEndIpAddress("n"); - model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); - Assertions.assertEquals("ohfwds", model.startIpAddress()); - Assertions.assertEquals("n", model.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleListResultTests.java deleted file mode 100644 index 88a406d20147..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRuleListResultTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRuleListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRuleListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"startIpAddress\":\"fcnihgwq\",\"endIpAddress\":\"pnedgf\"},\"id\":\"vkcvqvpkeqd\",\"name\":\"vdrhvoo\",\"type\":\"sotbob\"},{\"properties\":{\"startIpAddress\":\"dopcjwvnh\",\"endIpAddress\":\"ld\"},\"id\":\"gx\",\"name\":\"xrslpm\",\"type\":\"twuoegrpkhjwni\"}],\"nextLink\":\"sluicpdggkzz\"}") - .toObject(FirewallRuleListResult.class); - Assertions.assertEquals("fcnihgwq", model.value().get(0).startIpAddress()); - Assertions.assertEquals("pnedgf", model.value().get(0).endIpAddress()); - Assertions.assertEquals("sluicpdggkzz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleListResult model = - new FirewallRuleListResult() - .withValue( - Arrays - .asList( - new FirewallRuleInner().withStartIpAddress("fcnihgwq").withEndIpAddress("pnedgf"), - new FirewallRuleInner().withStartIpAddress("dopcjwvnh").withEndIpAddress("ld"))) - .withNextLink("sluicpdggkzz"); - model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); - Assertions.assertEquals("fcnihgwq", model.value().get(0).startIpAddress()); - Assertions.assertEquals("pnedgf", model.value().get(0).endIpAddress()); - Assertions.assertEquals("sluicpdggkzz", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulePropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulePropertiesTests.java deleted file mode 100644 index 8cf7a90a85fc..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulePropertiesTests.java +++ /dev/null @@ -1,30 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.FirewallRuleProperties; -import org.junit.jupiter.api.Assertions; - -public final class FirewallRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FirewallRuleProperties model = - BinaryData - .fromString("{\"startIpAddress\":\"ppfufl\",\"endIpAddress\":\"wdmhdlxyjrxs\"}") - .toObject(FirewallRuleProperties.class); - Assertions.assertEquals("ppfufl", model.startIpAddress()); - Assertions.assertEquals("wdmhdlxyjrxs", model.endIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FirewallRuleProperties model = - new FirewallRuleProperties().withStartIpAddress("ppfufl").withEndIpAddress("wdmhdlxyjrxs"); - model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); - Assertions.assertEquals("ppfufl", model.startIpAddress()); - Assertions.assertEquals("wdmhdlxyjrxs", model.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.java deleted file mode 100644 index 0514901bd00b..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesCreateOrUpdateMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"startIpAddress\":\"uwrbehwagoh\",\"endIpAddress\":\"uffkmrqemvvh\"},\"id\":\"tdrjfutacoebj\",\"name\":\"ewzcjznmwcp\",\"type\":\"guaadraufactkahz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .define("fmluiqtqzfavyvn") - .withExistingFlexibleServer("ookk", "fqjbvleo") - .withStartIpAddress("qybaryeua") - .withEndIpAddress("jkqa") - .create(); - - Assertions.assertEquals("uwrbehwagoh", response.startIpAddress()); - Assertions.assertEquals("uffkmrqemvvh", response.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.java deleted file mode 100644 index 98fb0bfbcad6..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesDeleteMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.firewallRules().delete("kwcf", "ql", "yxgtczh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java deleted file mode 100644 index 6008d4ec5289..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"startIpAddress\":\"kgxywr\",\"endIpAddress\":\"kpyklyhp\"},\"id\":\"odpvruudlgzib\",\"name\":\"hostgktstvdxecl\",\"type\":\"edqbc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FirewallRule response = - manager - .firewallRules() - .getWithResponse("ydbsd", "hmkxmaehvbb", "uripltfnhtba", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kgxywr", response.startIpAddress()); - Assertions.assertEquals("kpyklyhp", response.endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.java deleted file mode 100644 index d94c4edf7f9f..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FirewallRulesListByServerMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FirewallRule; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FirewallRulesListByServerMockTests { - @Test - public void testListByServer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"startIpAddress\":\"rqjfsmlm\",\"endIpAddress\":\"txhwgfws\"},\"id\":\"a\",\"name\":\"coezbrhubskh\",\"type\":\"dyg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.firewallRules().listByServer("hzlhplodqkdlww", "fbumlkx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rqjfsmlm", response.iterator().next().startIpAddress()); - Assertions.assertEquals("txhwgfws", response.iterator().next().endIpAddress()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerEditionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerEditionCapabilityTests.java deleted file mode 100644 index 5d9cbef314a6..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/FlexibleServerEditionCapabilityTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FlexibleServerEditionCapability; - -public final class FlexibleServerEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FlexibleServerEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"zvyifqrvkdvj\",\"supportedStorageEditions\":[{\"name\":\"mvvd\",\"supportedStorageMB\":[{\"name\":\"kpnpulexxbczwtr\",\"supportedIops\":4653794584543146117,\"storageSizeMB\":1317414773933917011,\"supportedUpgradableTierList\":[{},{},{}],\"status\":\"ovm\"},{\"name\":\"kacspkw\",\"supportedIops\":9019954696773982094,\"storageSizeMB\":7249564448679749970,\"supportedUpgradableTierList\":[{},{},{}],\"status\":\"flbvvnchrkcciwwz\"}],\"status\":\"qkhr\"}],\"supportedServerVersions\":[{\"name\":\"wkuofoskghsauu\",\"supportedVersionsToUpgrade\":[\"mvxi\",\"duugidyjr\"],\"supportedVcores\":[{\"name\":\"aos\",\"vCores\":2143456307324889666,\"supportedIops\":4051313136213287553,\"supportedMemoryPerVcoreMB\":287468799693076440,\"status\":\"ocohslkevleg\"}],\"status\":\"fbuhfmvfaxkffe\"},{\"name\":\"th\",\"supportedVersionsToUpgrade\":[\"ez\"],\"supportedVcores\":[{\"name\":\"xmzsbbzogg\",\"vCores\":7717795130142477786,\"supportedIops\":3568340417000656363,\"supportedMemoryPerVcoreMB\":8593552720128453851,\"status\":\"xjnspy\"},{\"name\":\"tko\",\"vCores\":3980056682158656120,\"supportedIops\":3290062663385259489,\"supportedMemoryPerVcoreMB\":316131865784554272,\"status\":\"tiukbldngkpoci\"},{\"name\":\"z\",\"vCores\":911296392791855673,\"supportedIops\":7699505413324678544,\"supportedMemoryPerVcoreMB\":675318684186893935,\"status\":\"iucgygevqzn\"},{\"name\":\"pmr\",\"vCores\":557239132862310129,\"supportedIops\":8926601809796435270,\"supportedMemoryPerVcoreMB\":229202411338757943,\"status\":\"pyd\"}],\"status\":\"yhxdeoejzicwi\"},{\"name\":\"jttgzf\",\"supportedVersionsToUpgrade\":[\"hcbkhajde\",\"eamdp\",\"agalpbuxwgipwhon\",\"wkgshwa\"],\"supportedVcores\":[{\"name\":\"zbinjeputtm\",\"vCores\":8855720569573412705,\"supportedIops\":9169702468107282807,\"supportedMemoryPerVcoreMB\":2762275817927994814,\"status\":\"yqzrnkcqvyxlw\"},{\"name\":\"lsicohoqqnwv\",\"vCores\":3263586208444372741,\"supportedIops\":1033785149258539896,\"supportedMemoryPerVcoreMB\":3153727360520202232,\"status\":\"mmqhgyxzkonocuk\"},{\"name\":\"lyaxuc\",\"vCores\":6528833878276793812,\"supportedIops\":1922016953134738106,\"supportedMemoryPerVcoreMB\":2514389459149223363,\"status\":\"pewr\"},{\"name\":\"mwvvjektcxsenhw\",\"vCores\":961124014694533513,\"supportedIops\":4986041102570951835,\"supportedMemoryPerVcoreMB\":8621829788027916589,\"status\":\"qdqgbi\"}],\"status\":\"lihkaetcktvfc\"},{\"name\":\"fsnkymuctq\",\"supportedVersionsToUpgrade\":[\"bebrjcxerfuwuttt\",\"fvjrbirphxepcy\",\"ahfn\"],\"supportedVcores\":[{\"name\":\"qxj\",\"vCores\":8484849300760600701,\"supportedIops\":8463316449918745617,\"supportedMemoryPerVcoreMB\":2270588281817751740,\"status\":\"jljyoxgv\"},{\"name\":\"tbgsncghkj\",\"vCores\":1424414082099964347,\"supportedIops\":4319774285609495271,\"supportedMemoryPerVcoreMB\":8613430323770215410,\"status\":\"fvgxbfsmxneh\"},{\"name\":\"vecxgodebfqkk\",\"vCores\":8422654337875438873,\"supportedIops\":3982659969367884384,\"supportedMemoryPerVcoreMB\":2067637314540840468,\"status\":\"lzlfbxzpuz\"},{\"name\":\"ispnqzahmgkbrp\",\"vCores\":7247932824726952770,\"supportedIops\":762877145565948123,\"supportedMemoryPerVcoreMB\":1340075206936885297,\"status\":\"pikad\"}],\"status\":\"vtq\"}],\"status\":\"n\"}") - .toObject(FlexibleServerEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FlexibleServerEditionCapability model = new FlexibleServerEditionCapability(); - model = BinaryData.fromObject(model).toObject(FlexibleServerEditionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.java deleted file mode 100644 index da7d63d3ad5b..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GetPrivateDnsZoneSuffixesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "\"zwwva\""; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - String response = - manager.getPrivateDnsZoneSuffixes().executeWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("zwwva", response); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.java deleted file mode 100644 index 3ca3bac9ae75..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HighAvailabilityTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailability; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HighAvailabilityMode; -import org.junit.jupiter.api.Assertions; - -public final class HighAvailabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HighAvailability model = - BinaryData - .fromString( - "{\"mode\":\"ZoneRedundant\",\"state\":\"Healthy\",\"standbyAvailabilityZone\":\"adgvraeaene\"}") - .toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.ZONE_REDUNDANT, model.mode()); - Assertions.assertEquals("adgvraeaene", model.standbyAvailabilityZone()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HighAvailability model = - new HighAvailability() - .withMode(HighAvailabilityMode.ZONE_REDUNDANT) - .withStandbyAvailabilityZone("adgvraeaene"); - model = BinaryData.fromObject(model).toObject(HighAvailability.class); - Assertions.assertEquals(HighAvailabilityMode.ZONE_REDUNDANT, model.mode()); - Assertions.assertEquals("adgvraeaene", model.standbyAvailabilityZone()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HyperscaleNodeEditionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HyperscaleNodeEditionCapabilityTests.java deleted file mode 100644 index 5819a9d3143f..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/HyperscaleNodeEditionCapabilityTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.HyperscaleNodeEditionCapability; - -public final class HyperscaleNodeEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HyperscaleNodeEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"qhakauhashsf\",\"supportedStorageEditions\":[{\"name\":\"owzxcu\",\"supportedStorageMB\":[{\"name\":\"ooxdjebwpuc\",\"supportedIops\":6176263530057609955,\"storageSizeMB\":6213483555580723643,\"supportedUpgradableTierList\":[{}],\"status\":\"uecivyhz\"},{\"name\":\"uojgj\",\"supportedIops\":5062126351477079238,\"storageSizeMB\":6905862249105518012,\"supportedUpgradableTierList\":[{},{},{}],\"status\":\"cdytdxw\"},{\"name\":\"xnrj\",\"supportedIops\":7022663417329031305,\"storageSizeMB\":6962157826226813076,\"supportedUpgradableTierList\":[{}],\"status\":\"skxfbk\"},{\"name\":\"cg\",\"supportedIops\":6732175570490023476,\"storageSizeMB\":7330294444739560743,\"supportedUpgradableTierList\":[{},{},{},{}],\"status\":\"uwhvylwzbtdhxujz\"}],\"status\":\"mpowuwpr\"}],\"supportedServerVersions\":[{\"name\":\"eualupjmkhf\",\"supportedVersionsToUpgrade\":[\"bcswsrt\",\"riplrbpbewtg\",\"fgb\"],\"supportedVcores\":[{\"name\":\"xzvlvqhjkbegib\",\"vCores\":6232281043746114213,\"supportedIops\":3339255508658819137,\"supportedMemoryPerVcoreMB\":2986160897527591596,\"status\":\"oayqc\"}],\"status\":\"rtzju\"}],\"supportedNodeTypes\":[{\"name\":\"zmh\",\"nodeType\":\"ongmtsa\",\"status\":\"cbpwxqpsrknft\"},{\"name\":\"vriuhprwmdyvx\",\"nodeType\":\"ayriwwroyqbexrm\",\"status\":\"ibycno\"},{\"name\":\"knme\",\"nodeType\":\"sgzvahapjyzhpv\",\"status\":\"zcjrvxdjzlmwlx\"}],\"status\":\"ug\"}") - .toObject(HyperscaleNodeEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HyperscaleNodeEditionCapability model = new HyperscaleNodeEditionCapability(); - model = BinaryData.fromObject(model).toObject(HyperscaleNodeEditionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteMockTests.java deleted file mode 100644 index 3377e0dcef0a..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/LocationBasedCapabilitiesExecuteMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CapabilityProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LocationBasedCapabilitiesExecuteMockTests { - @Test - public void testExecute() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"zone\":\"hxicslfaoqz\",\"supportedHAMode\":[\"ylhalnswhcc\",\"ph\",\"aivwitqscywu\",\"gwol\"],\"geoBackupSupported\":true,\"zoneRedundantHaSupported\":true,\"zoneRedundantHaAndGeoBackupSupported\":false,\"supportedFlexibleServerEditions\":[{\"name\":\"i\",\"supportedStorageEditions\":[{\"name\":\"gzd\",\"supportedStorageMB\":[{}],\"status\":\"eypqwdxggicccn\"}],\"supportedServerVersions\":[{\"name\":\"exmk\",\"supportedVersionsToUpgrade\":[\"stvlzywemhzrnc\",\"dtclusiypb\",\"fgytguslfeadcyg\"],\"supportedVcores\":[{},{},{}],\"status\":\"hejhzisx\"},{\"name\":\"pelol\",\"supportedVersionsToUpgrade\":[\"ksrpqv\"],\"supportedVcores\":[{},{}],\"status\":\"aehtwd\"}],\"status\":\"ftswibyrcdlbhsh\"},{\"name\":\"p\",\"supportedStorageEditions\":[{\"name\":\"twitykhev\",\"supportedStorageMB\":[{},{},{}],\"status\":\"dcpnmdyodnw\"},{\"name\":\"ltjcvnhltiugcxna\",\"supportedStorageMB\":[{},{}],\"status\":\"qiby\"}],\"supportedServerVersions\":[{\"name\":\"owx\",\"supportedVersionsToUpgrade\":[\"djrkvfgbvfvpd\",\"odacizs\",\"q\",\"hkr\"],\"supportedVcores\":[{},{},{}],\"status\":\"eibq\"},{\"name\":\"qkgh\",\"supportedVersionsToUpgrade\":[\"dzwmkrefajpj\",\"rwkq\",\"yhgbijtjivfx\"],\"supportedVcores\":[{},{},{}],\"status\":\"bibsystawfsdjpvk\"},{\"name\":\"bjxbkzbzk\",\"supportedVersionsToUpgrade\":[\"cjabudurgkakmo\"],\"supportedVcores\":[{},{}],\"status\":\"jk\"},{\"name\":\"fhmouwq\",\"supportedVersionsToUpgrade\":[\"rfzeey\",\"bizikayuhq\"],\"supportedVcores\":[{},{}],\"status\":\"sybbqwr\"}],\"status\":\"ldgmfpgvmpip\"},{\"name\":\"ltha\",\"supportedStorageEditions\":[{\"name\":\"smwutwbdsrezpd\",\"supportedStorageMB\":[{},{}],\"status\":\"uyowqkdwy\"}],\"supportedServerVersions\":[{\"name\":\"bi\",\"supportedVersionsToUpgrade\":[\"pikpz\",\"mejzanlfzxia\",\"rmbzo\"],\"supportedVcores\":[{},{}],\"status\":\"xrjqcirgzpfrlazs\"},{\"name\":\"nwoiind\",\"supportedVersionsToUpgrade\":[\"pj\"],\"supportedVcores\":[{},{},{}],\"status\":\"tlhflsjcdhszf\"},{\"name\":\"fbgofeljagrqmqh\",\"supportedVersionsToUpgrade\":[\"riiiojnalghfkv\",\"vsexsowuelu\"],\"supportedVcores\":[{},{},{},{}],\"status\":\"hhxvrhmzkwpj\"}],\"status\":\"wspughftqsxhqx\"},{\"name\":\"xukndxdigr\",\"supportedStorageEditions\":[{\"name\":\"fzdm\",\"supportedStorageMB\":[{},{},{},{}],\"status\":\"fi\"},{\"name\":\"hbotzingamvppho\",\"supportedStorageMB\":[{},{}],\"status\":\"udphqamvdkfwyn\"},{\"name\":\"vtbvkayh\",\"supportedStorageMB\":[{}],\"status\":\"yqiatkzwp\"},{\"name\":\"p\",\"supportedStorageMB\":[{},{},{}],\"status\":\"a\"}],\"supportedServerVersions\":[{\"name\":\"v\",\"supportedVersionsToUpgrade\":[\"yajguqfhwygzlv\",\"nk\"],\"supportedVcores\":[{},{},{},{}],\"status\":\"emdwzrmuhapfc\"}],\"status\":\"psqxq\"}],\"supportedHyperscaleNodeEditions\":[{\"name\":\"uoymgccelvezry\",\"supportedStorageEditions\":[{\"name\":\"feo\",\"supportedStorageMB\":[{},{}],\"status\":\"wkyhkobopgxe\"},{\"name\":\"owepbqpcrfkb\",\"supportedStorageMB\":[{},{},{},{}],\"status\":\"njv\"},{\"name\":\"wxlp\",\"supportedStorageMB\":[{},{},{}],\"status\":\"tn\"}],\"supportedServerVersions\":[{\"name\":\"syingwfqatmtdht\",\"supportedVersionsToUpgrade\":[\"ypgik\",\"gszywk\"],\"supportedVcores\":[{},{},{}],\"status\":\"yuzhlhkjoqrvq\"},{\"name\":\"atjinrvgoupmfiib\",\"supportedVersionsToUpgrade\":[\"jioolvrwxk\"],\"supportedVcores\":[{},{}],\"status\":\"gllqwjy\"}],\"supportedNodeTypes\":[{\"name\":\"yvblmhvkzu\",\"nodeType\":\"xvvy\",\"status\":\"s\"},{\"name\":\"byrqufeg\",\"nodeType\":\"vwz\",\"status\":\"nhlmctlpdng\"},{\"name\":\"vgbmhr\",\"nodeType\":\"kw\",\"status\":\"ijejvegrhbpn\"}],\"status\":\"xexccbdreaxhcexd\"}],\"fastProvisioningSupported\":true,\"supportedFastProvisioningEditions\":[{\"supportedSku\":\"qkghtpwijnhy\",\"supportedStorageGb\":6975213925943191762,\"supportedServerVersions\":\"cxzbfvoowvr\"},{\"supportedSku\":\"t\",\"supportedStorageGb\":1342853990361185080,\"supportedServerVersions\":\"y\"}],\"status\":\"tronzmyhgfi\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.locationBasedCapabilities().execute("rmaequ", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.java deleted file mode 100644 index b8df9ea2cda4..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/MaintenanceWindowTests.java +++ /dev/null @@ -1,39 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindow; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceWindowTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceWindow model = - BinaryData - .fromString( - "{\"customWindow\":\"zar\",\"startHour\":1854977873,\"startMinute\":333965716,\"dayOfWeek\":1564647724}") - .toObject(MaintenanceWindow.class); - Assertions.assertEquals("zar", model.customWindow()); - Assertions.assertEquals(1854977873, model.startHour()); - Assertions.assertEquals(333965716, model.startMinute()); - Assertions.assertEquals(1564647724, model.dayOfWeek()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceWindow model = - new MaintenanceWindow() - .withCustomWindow("zar") - .withStartHour(1854977873) - .withStartMinute(333965716) - .withDayOfWeek(1564647724); - model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("zar", model.customWindow()); - Assertions.assertEquals(1854977873, model.startHour()); - Assertions.assertEquals(333965716, model.startMinute()); - Assertions.assertEquals(1564647724, model.dayOfWeek()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java deleted file mode 100644 index 65f55c2851a7..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NameAvailabilityInnerTests.java +++ /dev/null @@ -1,37 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.NameAvailabilityInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.CheckNameAvailabilityReason; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityInner model = - BinaryData - .fromString( - "{\"name\":\"lns\",\"type\":\"bxwyjsflhhcaa\",\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"sxyawjoyaqcs\"}") - .toObject(NameAvailabilityInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("sxyawjoyaqcs", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityInner model = - new NameAvailabilityInner() - .withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("sxyawjoyaqcs"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("sxyawjoyaqcs", model.message()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.java deleted file mode 100644 index 58e780c1b4b7..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NetworkTests.java +++ /dev/null @@ -1,30 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Network; -import org.junit.jupiter.api.Assertions; - -public final class NetworkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Network model = - BinaryData - .fromString( - "{\"publicNetworkAccess\":\"Enabled\",\"delegatedSubnetResourceId\":\"jxywsuws\",\"privateDnsZoneArmResourceId\":\"s\"}") - .toObject(Network.class); - Assertions.assertEquals("jxywsuws", model.delegatedSubnetResourceId()); - Assertions.assertEquals("s", model.privateDnsZoneArmResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Network model = new Network().withDelegatedSubnetResourceId("jxywsuws").withPrivateDnsZoneArmResourceId("s"); - model = BinaryData.fromObject(model).toObject(Network.class); - Assertions.assertEquals("jxywsuws", model.delegatedSubnetResourceId()); - Assertions.assertEquals("s", model.privateDnsZoneArmResourceId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NodeTypeCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NodeTypeCapabilityTests.java deleted file mode 100644 index 8421e4c0b9ae..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/NodeTypeCapabilityTests.java +++ /dev/null @@ -1,24 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.NodeTypeCapability; - -public final class NodeTypeCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NodeTypeCapability model = - BinaryData - .fromString("{\"name\":\"zovawjvz\",\"nodeType\":\"luthn\",\"status\":\"rnxipei\"}") - .toObject(NodeTypeCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeTypeCapability model = new NodeTypeCapability(); - model = BinaryData.fromObject(model).toObject(NodeTypeCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationDisplayTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationDisplayTests.java deleted file mode 100644 index b91479d637c2..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"sbvdkcrodtjinfw\",\"resource\":\"fltkacjv\",\"operation\":\"kdlfoa\",\"description\":\"gkfpaga\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationListResultInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationListResultInnerTests.java deleted file mode 100644 index 6d668559f555..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationListResultInnerTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Operation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"hgwxrtfudx\",\"display\":{\"provider\":\"gyqagvrvmnpkuk\",\"resource\":\"i\",\"operation\":\"blxgwimf\",\"description\":\"hfjx\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"a\":\"dataoqreyfkzikfjawn\",\"elpcirelsfeaenwa\":\"datavxwc\",\"xbjhwuaanozjosph\":\"datafatkld\"}},{\"name\":\"ulpjr\",\"display\":{\"provider\":\"glrvimjwosytxi\",\"resource\":\"skfc\",\"operation\":\"qumiek\",\"description\":\"zzikhlyfjhdg\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"qidbqfatpxllrxcy\":\"datanyga\",\"dmjsjqb\":\"datamoadsuvarmy\",\"yc\":\"datahhyxxrw\"}},{\"name\":\"uhpkxkgymar\",\"display\":{\"provider\":\"ajxq\",\"resource\":\"jhkycub\",\"operation\":\"dgssofwqmzqal\",\"description\":\"mnjijpxacqqudf\"},\"isDataAction\":true,\"origin\":\"system\",\"properties\":{\"ayffim\":\"dataabjy\",\"gsexne\":\"datazrtuzq\",\"wmewzsyy\":\"datafdnw\",\"judpfrxt\":\"dataeuzsoi\"}}],\"nextLink\":\"hzv\"}") - .toObject(OperationListResultInner.class); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("hzv", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResultInner model = - new OperationListResultInner() - .withValue( - Arrays - .asList( - new Operation().withIsDataAction(true), - new Operation().withIsDataAction(true), - new Operation().withIsDataAction(true))) - .withNextLink("hzv"); - model = BinaryData.fromObject(model).toObject(OperationListResultInner.class); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("hzv", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationTests.java deleted file mode 100644 index 6b97deff727a..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationTests.java +++ /dev/null @@ -1,28 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Operation; -import org.junit.jupiter.api.Assertions; - -public final class OperationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Operation model = - BinaryData - .fromString( - "{\"name\":\"tdwkqbrq\",\"display\":{\"provider\":\"axhexiilivp\",\"resource\":\"iirqtd\",\"operation\":\"axoruzfgsquy\",\"description\":\"rxxle\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"wnwxuqlcvyd\":\"dataezw\",\"ebwnujhe\":\"datapatdooaojkniodko\"}}") - .toObject(Operation.class); - Assertions.assertEquals(true, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Operation model = new Operation().withIsDataAction(true); - model = BinaryData.fromObject(model).toObject(Operation.class); - Assertions.assertEquals(true, model.isDataAction()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListWithResponseMockTests.java deleted file mode 100644 index 5f579c6c8f2f..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/OperationsListWithResponseMockTests.java +++ /dev/null @@ -1,68 +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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.OperationListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"myst\",\"display\":{\"provider\":\"qypfcv\",\"resource\":\"rchpqbmfpjbabwid\",\"operation\":\"xsspuunnoxyhk\",\"description\":\"qddrihpfhoqcaae\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"x\":\"datavlp\",\"zkdnc\":\"datakzbrmsgeivsiy\",\"wyrpgogtqxepnyl\":\"datadxonbzoggculap\"}},{\"name\":\"uajlyj\",\"display\":{\"provider\":\"of\",\"resource\":\"hvfcibyfmow\",\"operation\":\"rkjpvdwxfzwii\",\"description\":\"zjb\"},\"isDataAction\":true,\"origin\":\"NotSpecified\",\"properties\":{\"vldspa\":\"datakambtrnegvmnvuqe\",\"kdmflvestmjlx\":\"datatjb\"}},{\"name\":\"ilozapeewchpxlk\",\"display\":{\"provider\":\"uziycsl\",\"resource\":\"ufuztcktyhjtq\",\"operation\":\"cgzulwmmrqzzr\",\"description\":\"vpglydz\"},\"isDataAction\":true,\"origin\":\"user\",\"properties\":{\"tpzdmovzvfvaawzq\":\"datavtoepryutnw\"}},{\"name\":\"f\",\"display\":{\"provider\":\"ur\",\"resource\":\"laecxndticok\",\"operation\":\"zmlqtmldgxo\",\"description\":\"irclnpk\"},\"isDataAction\":false,\"origin\":\"NotSpecified\",\"properties\":{\"lmxhomdyn\":\"dataykhyawfvjlboxqvk\",\"raauzzpt\":\"datadwdigumb\"}}],\"nextLink\":\"zysdzh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationListResult response = - manager.operations().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(true, response.value().get(0).isDataAction()); - Assertions.assertEquals("zysdzh", response.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.java deleted file mode 100644 index cc9e8a1aabb9..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/RestartParameterTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; -import org.junit.jupiter.api.Assertions; - -public final class RestartParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RestartParameter model = - BinaryData - .fromString("{\"restartWithFailover\":true,\"failoverMode\":\"PlannedSwitchover\"}") - .toObject(RestartParameter.class); - Assertions.assertEquals(true, model.restartWithFailover()); - Assertions.assertEquals(FailoverMode.PLANNED_SWITCHOVER, model.failoverMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RestartParameter model = - new RestartParameter().withRestartWithFailover(true).withFailoverMode(FailoverMode.PLANNED_SWITCHOVER); - model = BinaryData.fromObject(model).toObject(RestartParameter.class); - Assertions.assertEquals(true, model.restartWithFailover()); - Assertions.assertEquals(FailoverMode.PLANNED_SWITCHOVER, model.failoverMode()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java deleted file mode 100644 index 13c031372dd1..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupInnerTests.java +++ /dev/null @@ -1,38 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupInner model = - BinaryData - .fromString( - "{\"properties\":{\"backupType\":\"Full\",\"completedTime\":\"2021-02-10T03:30:23Z\",\"source\":\"x\"},\"id\":\"ivyqniwbybrkxvd\",\"name\":\"mjgr\",\"type\":\"fwvuk\"}") - .toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T03:30:23Z"), model.completedTime()); - Assertions.assertEquals("x", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupInner model = - new ServerBackupInner() - .withBackupType(Origin.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-02-10T03:30:23Z")) - .withSource("x"); - model = BinaryData.fromObject(model).toObject(ServerBackupInner.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T03:30:23Z"), model.completedTime()); - Assertions.assertEquals("x", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.java deleted file mode 100644 index bf6bad745cbb..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupListResultTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupInner; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerBackupListResult; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"backupType\":\"Full\",\"completedTime\":\"2021-08-18T11:52:54Z\",\"source\":\"hkryhtn\"},\"id\":\"czwlokjyem\",\"name\":\"kvnipjoxz\",\"type\":\"nchgej\"}],\"nextLink\":\"odmailzyd\"}") - .toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T11:52:54Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hkryhtn", model.value().get(0).source()); - Assertions.assertEquals("odmailzyd", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupListResult model = - new ServerBackupListResult() - .withValue( - Arrays - .asList( - new ServerBackupInner() - .withBackupType(Origin.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-08-18T11:52:54Z")) - .withSource("hkryhtn"))) - .withNextLink("odmailzyd"); - model = BinaryData.fromObject(model).toObject(ServerBackupListResult.class); - Assertions.assertEquals(Origin.FULL, model.value().get(0).backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T11:52:54Z"), model.value().get(0).completedTime()); - Assertions.assertEquals("hkryhtn", model.value().get(0).source()); - Assertions.assertEquals("odmailzyd", model.nextLink()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java deleted file mode 100644 index 7072c8edb845..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerBackupPropertiesTests.java +++ /dev/null @@ -1,37 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.ServerBackupProperties; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Origin; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ServerBackupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerBackupProperties model = - BinaryData - .fromString("{\"backupType\":\"Full\",\"completedTime\":\"2021-02-24T15:23:22Z\",\"source\":\"cs\"}") - .toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T15:23:22Z"), model.completedTime()); - Assertions.assertEquals("cs", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerBackupProperties model = - new ServerBackupProperties() - .withBackupType(Origin.FULL) - .withCompletedTime(OffsetDateTime.parse("2021-02-24T15:23:22Z")) - .withSource("cs"); - model = BinaryData.fromObject(model).toObject(ServerBackupProperties.class); - Assertions.assertEquals(Origin.FULL, model.backupType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T15:23:22Z"), model.completedTime()); - Assertions.assertEquals("cs", model.source()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.java deleted file mode 100644 index fedbadf4e1dd..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServerVersionCapabilityTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerVersionCapability; - -public final class ServerVersionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVersionCapability model = - BinaryData - .fromString( - "{\"name\":\"dxyt\",\"supportedVersionsToUpgrade\":[\"yrxvwfudwpznt\",\"hdzhlrqj\",\"hckfrlhrx\",\"bkyvp\"],\"supportedVcores\":[{\"name\":\"uzbpzkafku\",\"vCores\":8812234948991108432,\"supportedIops\":4066142529374885485,\"supportedMemoryPerVcoreMB\":5441826391386286828,\"status\":\"seyvj\"},{\"name\":\"rts\",\"vCores\":6845900513521781120,\"supportedIops\":6698294689469432122,\"supportedMemoryPerVcoreMB\":1190726733123875676,\"status\":\"fm\"},{\"name\":\"gkvtmelmqkrhah\",\"vCores\":9144697658006681867,\"supportedIops\":8641218324516083606,\"supportedMemoryPerVcoreMB\":6531016586304771464,\"status\":\"dhmdua\"},{\"name\":\"exq\",\"vCores\":6851389169185127110,\"supportedIops\":4668891538540973425,\"supportedMemoryPerVcoreMB\":6898104589669073559,\"status\":\"gvxp\"}],\"status\":\"omzlfmi\"}") - .toObject(ServerVersionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVersionCapability model = new ServerVersionCapability(); - model = BinaryData.fromObject(model).toObject(ServerVersionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteMockTests.java deleted file mode 100644 index edc5f34f21ff..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersDeleteMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().delete("v", "jjziuxxpsh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.java deleted file mode 100644 index b6ba545a8d57..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersRestartMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.FailoverMode; -import com.azure.resourcemanager.postgresqlflexibleserver.models.RestartParameter; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersRestartMockTests { - @Test - public void testRestart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .servers() - .restart( - "ibrxkp", - "loazuruocbgoo", - new RestartParameter().withRestartWithFailover(false).withFailoverMode(FailoverMode.PLANNED_SWITCHOVER), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.java deleted file mode 100644 index 67d55aaa18a5..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStartMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersStartMockTests { - @Test - public void testStart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().start("ybfhjxa", "vvjgslor", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.java deleted file mode 100644 index bc9fc17b93a0..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/ServersStopMockTests.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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServersStopMockTests { - @Test - public void testStop() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.servers().stop("il", "yw", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java deleted file mode 100644 index 2506a916a770..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/SkuTests.java +++ /dev/null @@ -1,27 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Sku; -import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString("{\"name\":\"dd\",\"tier\":\"GeneralPurpose\"}").toObject(Sku.class); - Assertions.assertEquals("dd", model.name()); - Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("dd").withTier(SkuTier.GENERAL_PURPOSE); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("dd", model.name()); - Assertions.assertEquals(SkuTier.GENERAL_PURPOSE, model.tier()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageEditionCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageEditionCapabilityTests.java deleted file mode 100644 index 60b29cf7a7b0..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageEditionCapabilityTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageEditionCapability; - -public final class StorageEditionCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageEditionCapability model = - BinaryData - .fromString( - "{\"name\":\"ynhijggme\",\"supportedStorageMB\":[{\"name\":\"arbu\",\"supportedIops\":9176240008202772297,\"storageSizeMB\":1534872494227355670,\"supportedUpgradableTierList\":[{\"name\":\"hj\",\"tierName\":\"nmpxttdb\",\"iops\":5309093572451246570,\"isBaseline\":true,\"status\":\"kx\"},{\"name\":\"skpbhenbtkcxywn\",\"tierName\":\"nrs\",\"iops\":7048602184307652974,\"isBaseline\":true,\"status\":\"by\"},{\"name\":\"zfcl\",\"tierName\":\"axdbabph\",\"iops\":9100039922871045362,\"isBaseline\":false,\"status\":\"tsthsucocm\"}],\"status\":\"yazttbtwwrqpue\"},{\"name\":\"kzywbiex\",\"supportedIops\":5180032300799662241,\"storageSizeMB\":5184713929986968832,\"supportedUpgradableTierList\":[{\"name\":\"xujwbhqwalmuzyo\",\"tierName\":\"epdkzja\",\"iops\":1503648344859889256,\"isBaseline\":true,\"status\":\"wbavxbniwdj\"}],\"status\":\"zt\"},{\"name\":\"bpg\",\"supportedIops\":4841147507527178453,\"storageSizeMB\":2947950628514829526,\"supportedUpgradableTierList\":[{\"name\":\"zpfzabglc\",\"tierName\":\"xwtctyqiklbbovpl\",\"iops\":5461698347546224486,\"isBaseline\":false,\"status\":\"u\"},{\"name\":\"osvmk\",\"tierName\":\"sxqu\",\"iops\":2455965823671467627,\"isBaseline\":true,\"status\":\"gsxnkjzkdeslpv\"}],\"status\":\"pwiyig\"}],\"status\":\"pkdwzbai\"}") - .toObject(StorageEditionCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageEditionCapability model = new StorageEditionCapability(); - model = BinaryData.fromObject(model).toObject(StorageEditionCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageMBCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageMBCapabilityTests.java deleted file mode 100644 index bd1fb6b0249e..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageMBCapabilityTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageMBCapability; - -public final class StorageMBCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageMBCapability model = - BinaryData - .fromString( - "{\"name\":\"bbaumnyquped\",\"supportedIops\":2245881351334058994,\"storageSizeMB\":3205247320582775463,\"supportedUpgradableTierList\":[{\"name\":\"mtxpsiebtfh\",\"tierName\":\"esap\",\"iops\":8858985212786310258,\"isBaseline\":true,\"status\":\"jjdhtld\"},{\"name\":\"yzxuutkncw\",\"tierName\":\"wsvlxotogtwrupqs\",\"iops\":3534987396424038530,\"isBaseline\":false,\"status\":\"kvceoveilovnotyf\"},{\"name\":\"cnjbkcnxdhbt\",\"tierName\":\"phywpnvj\",\"iops\":7014692184557191333,\"isBaseline\":true,\"status\":\"clfp\"},{\"name\":\"hoxus\",\"tierName\":\"pabgyeps\",\"iops\":8481136103419413526,\"isBaseline\":true,\"status\":\"gxywpmue\"}],\"status\":\"jzwf\"}") - .toObject(StorageMBCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageMBCapability model = new StorageMBCapability(); - model = BinaryData.fromObject(model).toObject(StorageMBCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTests.java deleted file mode 100644 index 36d0f8cd6cd3..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTests.java +++ /dev/null @@ -1,24 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage; -import org.junit.jupiter.api.Assertions; - -public final class StorageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Storage model = BinaryData.fromString("{\"storageSizeGB\":1847154217}").toObject(Storage.class); - Assertions.assertEquals(1847154217, model.storageSizeGB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Storage model = new Storage().withStorageSizeGB(1847154217); - model = BinaryData.fromObject(model).toObject(Storage.class); - Assertions.assertEquals(1847154217, model.storageSizeGB()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTierCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTierCapabilityTests.java deleted file mode 100644 index ecf862709635..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/StorageTierCapabilityTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageTierCapability; - -public final class StorageTierCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTierCapability model = - BinaryData - .fromString( - "{\"name\":\"q\",\"tierName\":\"ids\",\"iops\":2625716572119326025,\"isBaseline\":true,\"status\":\"laocqxtccmg\"}") - .toObject(StorageTierCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTierCapability model = new StorageTierCapability(); - model = BinaryData.fromObject(model).toObject(StorageTierCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserAssignedIdentityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 77fb654be3da..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,58 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = - BinaryData - .fromString( - "{\"userAssignedIdentities\":{\"zoymibmrqyibahw\":{\"principalId\":\"uejrjxgc\",\"clientId\":\"ibrhosxsdqr\"},\"iwbwoenwashrtdtk\":{\"principalId\":\"uszdtmhrkwof\",\"clientId\":\"voqacpiexpbt\"},\"obyu\":{\"principalId\":\"qxwbpokulpiu\",\"clientId\":\"aasipqi\"}},\"type\":\"UserAssigned\",\"tenantId\":\"pqlpq\"}") - .toObject(UserAssignedIdentity.class); - Assertions.assertEquals("uejrjxgc", model.userAssignedIdentities().get("zoymibmrqyibahw").principalId()); - Assertions.assertEquals("ibrhosxsdqr", model.userAssignedIdentities().get("zoymibmrqyibahw").clientId()); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = - new UserAssignedIdentity() - .withUserAssignedIdentities( - mapOf( - "zoymibmrqyibahw", - new UserIdentity().withPrincipalId("uejrjxgc").withClientId("ibrhosxsdqr"), - "iwbwoenwashrtdtk", - new UserIdentity().withPrincipalId("uszdtmhrkwof").withClientId("voqacpiexpbt"), - "obyu", - new UserIdentity().withPrincipalId("qxwbpokulpiu").withClientId("aasipqi"))) - .withType(IdentityType.USER_ASSIGNED); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - Assertions.assertEquals("uejrjxgc", model.userAssignedIdentities().get("zoymibmrqyibahw").principalId()); - Assertions.assertEquals("ibrhosxsdqr", model.userAssignedIdentities().get("zoymibmrqyibahw").clientId()); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java deleted file mode 100644 index 6a6e1e002477..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/UserIdentityTests.java +++ /dev/null @@ -1,29 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity; -import org.junit.jupiter.api.Assertions; - -public final class UserIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserIdentity model = - BinaryData - .fromString("{\"principalId\":\"ciuqgbdb\",\"clientId\":\"auvfbtkuwhhmhyk\"}") - .toObject(UserIdentity.class); - Assertions.assertEquals("ciuqgbdb", model.principalId()); - Assertions.assertEquals("auvfbtkuwhhmhyk", model.clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentity model = new UserIdentity().withPrincipalId("ciuqgbdb").withClientId("auvfbtkuwhhmhyk"); - model = BinaryData.fromObject(model).toObject(UserIdentity.class); - Assertions.assertEquals("ciuqgbdb", model.principalId()); - Assertions.assertEquals("auvfbtkuwhhmhyk", model.clientId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VcoreCapabilityTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VcoreCapabilityTests.java deleted file mode 100644 index d4991f4e66df..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VcoreCapabilityTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VcoreCapability; - -public final class VcoreCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VcoreCapability model = - BinaryData - .fromString( - "{\"name\":\"wbnb\",\"vCores\":8988719472980860271,\"supportedIops\":2980894048729421181,\"supportedMemoryPerVcoreMB\":7656352592429288126,\"status\":\"io\"}") - .toObject(VcoreCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VcoreCapability model = new VcoreCapability(); - model = BinaryData.fromObject(model).toObject(VcoreCapability.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java deleted file mode 100644 index e8eefd692d5a..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageParameterTests.java +++ /dev/null @@ -1,28 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkSubnetUsageParameterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = - BinaryData - .fromString("{\"virtualNetworkArmResourceId\":\"qblylsyxkqj\"}") - .toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("qblylsyxkqj", model.virtualNetworkArmResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageParameter model = - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("qblylsyxkqj"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageParameter.class); - Assertions.assertEquals("qblylsyxkqj", model.virtualNetworkArmResourceId()); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java deleted file mode 100644 index 90c715923817..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsageResultInnerTests.java +++ /dev/null @@ -1,25 +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.postgresqlflexibleserver.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.VirtualNetworkSubnetUsageResultInner; - -public final class VirtualNetworkSubnetUsageResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = - BinaryData - .fromString( - "{\"delegatedSubnetsUsage\":[{\"subnetName\":\"r\",\"usage\":8025061741771664109},{\"subnetName\":\"xsdszuempsb\",\"usage\":587644245918175507}],\"location\":\"eyvpnqicvinvkj\",\"subscriptionId\":\"dxrbuukzcle\"}") - .toObject(VirtualNetworkSubnetUsageResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkSubnetUsageResultInner model = new VirtualNetworkSubnetUsageResultInner(); - model = BinaryData.fromObject(model).toObject(VirtualNetworkSubnetUsageResultInner.class); - } -} diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java deleted file mode 100644 index 9e1fb7a16817..000000000000 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/src/test/java/com/azure/resourcemanager/postgresqlflexibleserver/generated/VirtualNetworkSubnetUsagesExecuteWithResponseMockTests.java +++ /dev/null @@ -1,71 +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.postgresqlflexibleserver.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageParameter; -import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsageResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VirtualNetworkSubnetUsagesExecuteWithResponseMockTests { - @Test - public void testExecuteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"delegatedSubnetsUsage\":[{\"subnetName\":\"m\",\"usage\":7207683080078231959},{\"subnetName\":\"u\",\"usage\":3084183772230605439}],\"location\":\"fwgckhocxvdfffw\",\"subscriptionId\":\"qrouda\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PostgreSqlManager manager = - PostgreSqlManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VirtualNetworkSubnetUsageResult response = - manager - .virtualNetworkSubnetUsages() - .executeWithResponse( - "tdhlfkqo", - new VirtualNetworkSubnetUsageParameter().withVirtualNetworkArmResourceId("ykvgtrdcnifmz"), - com.azure.core.util.Context.NONE) - .getValue(); - } -}